diff options
author | Juanma Barranquero <lekktu@gmail.com> | 2013-06-16 03:26:42 +0200 |
---|---|---|
committer | Juanma Barranquero <lekktu@gmail.com> | 2013-06-16 03:26:42 +0200 |
commit | f3d674dfd1b346d271aa935a8b458375ca1bb264 (patch) | |
tree | d7b7b040deddcb4ec72868aa1e435616ac54495a /lisp/progmodes/prog-mode.el | |
parent | 02f473a47539f078c23fae5a3ecbf2c0c7fe0a5f (diff) | |
download | emacs-f3d674dfd1b346d271aa935a8b458375ca1bb264.tar.gz emacs-f3d674dfd1b346d271aa935a8b458375ca1bb264.tar.bz2 emacs-f3d674dfd1b346d271aa935a8b458375ca1bb264.zip |
* lisp/progmodes/prog-mode.el: Fix bug#14595.
(prog--prettify-font-lock-compose-symbol): Save relevant match data
before calling `syntax-ppss'.
Diffstat (limited to 'lisp/progmodes/prog-mode.el')
-rw-r--r-- | lisp/progmodes/prog-mode.el | 8 |
1 files changed, 5 insertions, 3 deletions
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) |