aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2014-11-30 23:07:19 -0500
committerStefan Monnier2014-11-30 23:07:19 -0500
commite97b6e6f11ceb85f4f3cbe1ecbbc46aa0a8de48a (patch)
tree201b64ff41ae23b23f9e704923b25ca0e696b810
parent59c4d5f95337d6393edb5ffe6b9ef74e4f89058f (diff)
downloademacs-e97b6e6f11ceb85f4f3cbe1ecbbc46aa0a8de48a.tar.gz
emacs-e97b6e6f11ceb85f4f3cbe1ecbbc46aa0a8de48a.zip
* lisp/progmodes/prog-mode.el (prettify-symbols--compose-symbol): Refine.
Fix handling of symbols with different syntax at beginning/end or with symbol rather than word syntax.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/progmodes/prog-mode.el8
2 files changed, 11 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 726d9b02ac8..ac36c059bd3 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12014-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * progmodes/prog-mode.el (prettify-symbols--compose-symbol):
4 Fix handling of symbols with different syntax at beginning/end or with
5 symbol rather than word syntax.
6
12014-11-30 Eli Zaretskii <eliz@gnu.org> 72014-11-30 Eli Zaretskii <eliz@gnu.org>
2 8
3 * simple.el (line-move): If noninteractive, call line-move-1, not 9 * simple.el (line-move): If noninteractive, call line-move-1, not
diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el
index 407466932d9..e0e57462405 100644
--- a/lisp/progmodes/prog-mode.el
+++ b/lisp/progmodes/prog-mode.el
@@ -66,11 +66,13 @@ Regexp match data 0 points to the chars."
66 ;; Check that the chars should really be composed into a symbol. 66 ;; Check that the chars should really be composed into a symbol.
67 (let* ((start (match-beginning 0)) 67 (let* ((start (match-beginning 0))
68 (end (match-end 0)) 68 (end (match-end 0))
69 (syntaxes (if (eq (char-syntax (char-after start)) ?w) 69 (syntaxes-beg (if (memq (char-syntax (char-after start)) '(?w ?_))
70 '(?w ?_) '(?. ?\\)))
71 (syntaxes-end (if (memq (char-syntax (char-before end)) '(?w ?_))
70 '(?w ?_) '(?. ?\\))) 72 '(?w ?_) '(?. ?\\)))
71 match) 73 match)
72 (if (or (memq (char-syntax (or (char-before start) ?\s)) syntaxes) 74 (if (or (memq (char-syntax (or (char-before start) ?\s)) syntaxes-beg)
73 (memq (char-syntax (or (char-after end) ?\s)) syntaxes) 75 (memq (char-syntax (or (char-after end) ?\s)) syntaxes-end)
74 ;; syntax-ppss could modify the match data (bug#14595) 76 ;; syntax-ppss could modify the match data (bug#14595)
75 (progn (setq match (match-string 0)) (nth 8 (syntax-ppss)))) 77 (progn (setq match (match-string 0)) (nth 8 (syntax-ppss))))
76 ;; No composition for you. Let's actually remove any composition 78 ;; No composition for you. Let's actually remove any composition