[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 188f657: Fix false negatives in tex--prettify-symbo
From: |
Tassilo Horn |
Subject: |
[Emacs-diffs] master 188f657: Fix false negatives in tex--prettify-symbols-compose-p. |
Date: |
Fri, 25 Sep 2015 21:05:12 +0000 |
branch: master
commit 188f657a827b04d72376f8b483c7d4b678e96fac
Author: Tassilo Horn <address@hidden>
Commit: Tassilo Horn <address@hidden>
Fix false negatives in tex--prettify-symbols-compose-p.
* lisp/textmodes/tex-mode.el (tex--prettify-symbols-compose-p): Fix some
false negatives.
---
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 25ffb5e..16162e1 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -3409,16 +3409,20 @@ There might be text before point."
(defun tex--prettify-symbols-compose-p (start end _match)
(let* ((after-char (char-after end))
- (after-syntax (char-syntax after-char)))
+ (after-syntax (char-syntax after-char)))
(not (or
;; Don't compose address@hidden
- (eq after-syntax ?_)
- ;; Don't compose inside verbatim blocks!
- (nth 8 (syntax-ppss))
- ;; The \alpha in \alpha2 may be composed but of course \alphax may
not.
+ (eq after-char ?@)
+ ;; The \alpha in \alpha2 or \alpha-\beta may be composed but
+ ;; of course \alphax may not.
(and (eq after-syntax ?w)
- (or (< after-char ?0)
- (> after-char ?9)))))))
+ (not (memq after-char
+ '(?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9 ?+ ?- ?' ?\"))))
+ ;; Don't compose inside verbatim blocks.
+ (let* ((face (get-text-property end 'face))
+ (faces (if (consp face) face (list face))))
+ (or (memq 'tex-verbatim faces)
+ (memq 'font-latex-verbatim-face faces)))))))
(run-hooks 'tex-mode-load-hook)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 188f657: Fix false negatives in tex--prettify-symbols-compose-p.,
Tassilo Horn <=