GNU bug report logs - #14595
Erroneous composition of lambda in emacs-lisp buffers with prog-prettify-symbols enabled

Previous Next

Package: emacs;

Reported by: Juanma Barranquero <lekktu <at> gmail.com>

Date: Wed, 12 Jun 2013 03:21:02 UTC

Severity: normal

Found in version 24.3.50

Done: Juanma Barranquero <lekktu <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #23 received at 14595 <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 14595 <at> debbugs.gnu.org
Subject: Re: bug#14595: Erroneous composition of lambda in emacs-lisp buffers
 with prog-prettify-symbols enabled
Date: Sat, 15 Jun 2013 22:51:35 +0200
On Sat, Jun 15, 2013 at 7:49 PM, Juanma Barranquero <lekktu <at> gmail.com> wrote:

> In other words, this simple patch fixes the problem:

This one is presumably cheaper:

=== modified file 'lisp/progmodes/prog-mode.el'
--- lisp/progmodes/prog-mode.el 2013-06-06 21:32:13 +0000
+++ lisp/progmodes/prog-mode.el 2013-06-15 20:50:09 +0000
@@ -74,15 +74,17 @@
   (let* ((start (match-beginning 0))
  (end (match-end 0))
  (syntaxes (if (eq (char-syntax (char-after start)) ?w)
-       '(?w) '(?. ?\\))))
+       '(?w) '(?. ?\\)))
+         match)
     (if (or (memq (char-syntax (or (char-before start) ?\ )) syntaxes)
     (memq (char-syntax (or (char-after end) ?\ )) syntaxes)
-            (nth 8 (syntax-ppss)))
+            ;; syntax-ppss can modify the match data
+            (progn (setq match (match-string 0)) (nth 8 (syntax-ppss))))
  ;; No composition for you.  Let's actually remove any composition
  ;; we may have added earlier and which is now incorrect.
  (remove-text-properties start end '(composition))
       ;; That's a symbol alright, so add the composition.
-      (compose-region start end (cdr (assoc (match-string 0) alist)))))
+      (compose-region start end (cdr (assoc match alist)))))
   ;; Return nil because we're not adding any face property.
   nil)




This bug report was last modified 12 years and 36 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.