diff options
| author | Roland Winkler | 2022-12-29 23:22:48 -0600 |
|---|---|---|
| committer | Roland Winkler | 2022-12-29 23:22:48 -0600 |
| commit | ab38abfdf75e091b9970dd3ba977aaa1b6067cc3 (patch) | |
| tree | b4cb211f2e75fe0c7f46121d4572df5a66e605f4 /lisp | |
| parent | d086cd6cf877c6ca7af6712f9b79b52dd0caa934 (diff) | |
| download | emacs-ab38abfdf75e091b9970dd3ba977aaa1b6067cc3.tar.gz emacs-ab38abfdf75e091b9970dd3ba977aaa1b6067cc3.zip | |
lisp/textmodes/bibtex.el: Treat $ as punctuation in BibTeX fields (bug#50202)
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/textmodes/bibtex.el | 12 |
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'.") | |||
| 1822 | 1 '(11)))) | 1822 | 1 '(11)))) |
| 1823 | 1823 | ||
| 1824 | (defvar bibtex-font-lock-keywords | 1824 | (defvar bibtex-font-lock-keywords |
| 1825 | ;; entry type and reference key | 1825 | `(("\\$[^$\n]+\\$" . font-lock-string-face) ; bug#50202 |
| 1826 | `((,bibtex-any-entry-maybe-empty-head | 1826 | ;; entry type and reference key |
| 1827 | (,bibtex-any-entry-maybe-empty-head | ||
| 1827 | (,bibtex-type-in-head font-lock-function-name-face) | 1828 | (,bibtex-type-in-head font-lock-function-name-face) |
| 1828 | (,bibtex-key-in-head font-lock-constant-face nil t)) | 1829 | (,bibtex-key-in-head font-lock-constant-face nil t)) |
| 1829 | ;; optional field names (treated as comments) | 1830 | ;; optional field names (treated as comments) |
| @@ -3631,8 +3632,11 @@ if that value is non-nil. | |||
| 3631 | (setq-local fill-paragraph-function #'bibtex-fill-field) | 3632 | (setq-local fill-paragraph-function #'bibtex-fill-field) |
| 3632 | (setq-local font-lock-defaults | 3633 | (setq-local font-lock-defaults |
| 3633 | '(bibtex-font-lock-keywords | 3634 | '(bibtex-font-lock-keywords |
| 3634 | nil t ((?$ . "\"") | 3635 | nil t ((?$ . ".") |
| 3635 | ;; Mathematical expressions should be fontified as strings | 3636 | ;; Mathematical expressions should be fontified |
| 3637 | ;; as strings. Yet `$' may also appear in certain | ||
| 3638 | ;; fields like `URL' when it does not delimit | ||
| 3639 | ;; a math expression (bug#50202). | ||
| 3636 | (?\" . ".") | 3640 | (?\" . ".") |
| 3637 | ;; Quotes are field delimiters and quote-delimited | 3641 | ;; Quotes are field delimiters and quote-delimited |
| 3638 | ;; entries should be fontified in the same way as | 3642 | ;; entries should be fontified in the same way as |