diff options
| author | Tassilo Horn | 2015-09-25 23:02:28 +0200 |
|---|---|---|
| committer | Tassilo Horn | 2015-09-25 23:04:39 +0200 |
| commit | 188f657a827b04d72376f8b483c7d4b678e96fac (patch) | |
| tree | b25caf1ac5d5c07b8ea5d4247378a8aa90d20a6e /lisp/textmodes | |
| parent | b1dfa84abea1c6357dc2adbd1b5f278ed0d910d0 (diff) | |
| download | emacs-188f657a827b04d72376f8b483c7d4b678e96fac.tar.gz emacs-188f657a827b04d72376f8b483c7d4b678e96fac.zip | |
Fix false negatives in tex--prettify-symbols-compose-p.
* lisp/textmodes/tex-mode.el (tex--prettify-symbols-compose-p): Fix some
false negatives.
Diffstat (limited to 'lisp/textmodes')
| -rw-r--r-- | lisp/textmodes/tex-mode.el | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 25ffb5ed578..16162e14ef2 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el | |||
| @@ -3409,16 +3409,20 @@ There might be text before point." | |||
| 3409 | 3409 | ||
| 3410 | (defun tex--prettify-symbols-compose-p (start end _match) | 3410 | (defun tex--prettify-symbols-compose-p (start end _match) |
| 3411 | (let* ((after-char (char-after end)) | 3411 | (let* ((after-char (char-after end)) |
| 3412 | (after-syntax (char-syntax after-char))) | 3412 | (after-syntax (char-syntax after-char))) |
| 3413 | (not (or | 3413 | (not (or |
| 3414 | ;; Don't compose \alpha@foo. | 3414 | ;; Don't compose \alpha@foo. |
| 3415 | (eq after-syntax ?_) | 3415 | (eq after-char ?@) |
| 3416 | ;; Don't compose inside verbatim blocks! | 3416 | ;; The \alpha in \alpha2 or \alpha-\beta may be composed but |
| 3417 | (nth 8 (syntax-ppss)) | 3417 | ;; of course \alphax may not. |
| 3418 | ;; The \alpha in \alpha2 may be composed but of course \alphax may not. | ||
| 3419 | (and (eq after-syntax ?w) | 3418 | (and (eq after-syntax ?w) |
| 3420 | (or (< after-char ?0) | 3419 | (not (memq after-char |
| 3421 | (> after-char ?9))))))) | 3420 | '(?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9 ?+ ?- ?' ?\")))) |
| 3421 | ;; Don't compose inside verbatim blocks. | ||
| 3422 | (let* ((face (get-text-property end 'face)) | ||
| 3423 | (faces (if (consp face) face (list face)))) | ||
| 3424 | (or (memq 'tex-verbatim faces) | ||
| 3425 | (memq 'font-latex-verbatim-face faces))))))) | ||
| 3422 | 3426 | ||
| 3423 | (run-hooks 'tex-mode-load-hook) | 3427 | (run-hooks 'tex-mode-load-hook) |
| 3424 | 3428 | ||