summaryrefslogtreecommitdiff
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorRoland Winkler <winkler@gnu.org>2022-12-29 23:22:48 -0600
committerRoland Winkler <winkler@gnu.org>2022-12-29 23:22:48 -0600
commitab38abfdf75e091b9970dd3ba977aaa1b6067cc3 (patch)
treeb4cb211f2e75fe0c7f46121d4572df5a66e605f4 /lisp/textmodes
parentd086cd6cf877c6ca7af6712f9b79b52dd0caa934 (diff)
downloademacs-ab38abfdf75e091b9970dd3ba977aaa1b6067cc3.tar.gz
emacs-ab38abfdf75e091b9970dd3ba977aaa1b6067cc3.tar.bz2
emacs-ab38abfdf75e091b9970dd3ba977aaa1b6067cc3.zip
lisp/textmodes/bibtex.el: Treat $ as punctuation in BibTeX fields (bug#50202)
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/bibtex.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index f4b557f443f..a1a3cbd8f14 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -1822,8 +1822,9 @@ Initialized by `bibtex-set-dialect'.")
1 '(11))))
(defvar bibtex-font-lock-keywords
- ;; entry type and reference key
- `((,bibtex-any-entry-maybe-empty-head
+ `(("\\$[^$\n]+\\$" . font-lock-string-face) ; bug#50202
+ ;; entry type and reference key
+ (,bibtex-any-entry-maybe-empty-head
(,bibtex-type-in-head font-lock-function-name-face)
(,bibtex-key-in-head font-lock-constant-face nil t))
;; optional field names (treated as comments)
@@ -3631,8 +3632,11 @@ if that value is non-nil.
(setq-local fill-paragraph-function #'bibtex-fill-field)
(setq-local font-lock-defaults
'(bibtex-font-lock-keywords
- nil t ((?$ . "\"")
- ;; Mathematical expressions should be fontified as strings
+ nil t ((?$ . ".")
+ ;; Mathematical expressions should be fontified
+ ;; as strings. Yet `$' may also appear in certain
+ ;; fields like `URL' when it does not delimit
+ ;; a math expression (bug#50202).
(?\" . ".")
;; Quotes are field delimiters and quote-delimited
;; entries should be fontified in the same way as