From: Juanma Barranquero Date: Sun, 16 Jun 2013 01:26:42 +0000 (+0200) Subject: * lisp/progmodes/prog-mode.el: Fix bug#14595. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~2016^2~90 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f3d674dfd1b346d271aa935a8b458375ca1bb264;p=emacs.git * lisp/progmodes/prog-mode.el: Fix bug#14595. (prog--prettify-font-lock-compose-symbol): Save relevant match data before calling `syntax-ppss'. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f7f42011575..4f3cf82e7e0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-06-16 Juanma Barranquero + + * progmodes/prog-mode.el (prog--prettify-font-lock-compose-symbol): + Save relevant match data before calling `syntax-ppss' (bug#14595). + 2013-06-15 Juri Linkov * files-x.el (modify-file-local-variable-prop-line): Add local diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el index e2700414636..03505051c1f 100644 --- a/lisp/progmodes/prog-mode.el +++ b/lisp/progmodes/prog-mode.el @@ -74,15 +74,17 @@ Regexp match data 0 points to the chars." (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 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 ;; 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)