]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/progmodes/prog-mode.el (prettify-symbols--compose-symbol): Refine.
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 1 Dec 2014 04:07:19 +0000 (23:07 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 1 Dec 2014 04:07:19 +0000 (23:07 -0500)
Fix handling of symbols with different syntax at beginning/end or with
symbol rather than word syntax.

lisp/ChangeLog
lisp/progmodes/prog-mode.el

index 726d9b02ac8ca63cf81f39a352ab7362c86c5309..ac36c059bd30d366c5190bcd01c46c0d0d54a5a3 100644 (file)
@@ -1,3 +1,9 @@
+2014-12-01  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * 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  <eliz@gnu.org>
 
        * simple.el (line-move): If noninteractive, call line-move-1, not
index 407466932d9cf049daf7d916137939dd81aa9b46..e0e574624055557a412b2dfda5e95db7295ce839 100644 (file)
@@ -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