[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-24 e97b6e6: * lisp/progmodes/prog-mode.el (prettify-
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] emacs-24 e97b6e6: * lisp/progmodes/prog-mode.el (prettify-symbols--compose-symbol): Refine. |
Date: |
Mon, 01 Dec 2014 04:07:28 +0000 |
branch: emacs-24
commit e97b6e6f11ceb85f4f3cbe1ecbbc46aa0a8de48a
Author: Stefan Monnier <address@hidden>
Date: Sun Nov 30 23:07:19 2014 -0500
* 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.
---
lisp/ChangeLog | 6 ++++++
lisp/progmodes/prog-mode.el | 8 +++++---
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 726d9b0..ac36c05 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2014-12-01 Stefan Monnier <address@hidden>
+
+ * progmodes/prog-mode.el (prettify-symbols--compose-symbol):
+ Fix handling of symbols with different syntax at beginning/end or with
+ symbol rather than word syntax.
+
2014-11-30 Eli Zaretskii <address@hidden>
* 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 4074669..e0e5746 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."
;; Check that the chars should really be composed into a symbol.
(let* ((start (match-beginning 0))
(end (match-end 0))
- (syntaxes (if (eq (char-syntax (char-after start)) ?w)
+ (syntaxes-beg (if (memq (char-syntax (char-after start)) '(?w ?_))
+ '(?w ?_) '(?. ?\\)))
+ (syntaxes-end (if (memq (char-syntax (char-before end)) '(?w ?_))
'(?w ?_) '(?. ?\\)))
match)
- (if (or (memq (char-syntax (or (char-before start) ?\s)) syntaxes)
- (memq (char-syntax (or (char-after end) ?\s)) syntaxes)
+ (if (or (memq (char-syntax (or (char-before start) ?\s)) syntaxes-beg)
+ (memq (char-syntax (or (char-after end) ?\s)) syntaxes-end)
;; syntax-ppss could modify the match data (bug#14595)
(progn (setq match (match-string 0)) (nth 8 (syntax-ppss))))
;; No composition for you. Let's actually remove any composition
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-24 e97b6e6: * lisp/progmodes/prog-mode.el (prettify-symbols--compose-symbol): Refine.,
Stefan Monnier <=