diff options
| author | Juanma Barranquero | 2013-06-16 03:26:42 +0200 |
|---|---|---|
| committer | Juanma Barranquero | 2013-06-16 03:26:42 +0200 |
| commit | f3d674dfd1b346d271aa935a8b458375ca1bb264 (patch) | |
| tree | d7b7b040deddcb4ec72868aa1e435616ac54495a | |
| parent | 02f473a47539f078c23fae5a3ecbf2c0c7fe0a5f (diff) | |
| download | emacs-f3d674dfd1b346d271aa935a8b458375ca1bb264.tar.gz 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'.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/progmodes/prog-mode.el | 8 |
2 files changed, 10 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f7f42011575..4f3cf82e7e0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-06-16 Juanma Barranquero <lekktu@gmail.com> | ||
| 2 | |||
| 3 | * progmodes/prog-mode.el (prog--prettify-font-lock-compose-symbol): | ||
| 4 | Save relevant match data before calling `syntax-ppss' (bug#14595). | ||
| 5 | |||
| 1 | 2013-06-15 Juri Linkov <juri@jurta.org> | 6 | 2013-06-15 Juri Linkov <juri@jurta.org> |
| 2 | 7 | ||
| 3 | * files-x.el (modify-file-local-variable-prop-line): Add local | 8 | * 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." | |||
| 74 | (let* ((start (match-beginning 0)) | 74 | (let* ((start (match-beginning 0)) |
| 75 | (end (match-end 0)) | 75 | (end (match-end 0)) |
| 76 | (syntaxes (if (eq (char-syntax (char-after start)) ?w) | 76 | (syntaxes (if (eq (char-syntax (char-after start)) ?w) |
| 77 | '(?w) '(?. ?\\)))) | 77 | '(?w) '(?. ?\\))) |
| 78 | match) | ||
| 78 | (if (or (memq (char-syntax (or (char-before start) ?\ )) syntaxes) | 79 | (if (or (memq (char-syntax (or (char-before start) ?\ )) syntaxes) |
| 79 | (memq (char-syntax (or (char-after end) ?\ )) syntaxes) | 80 | (memq (char-syntax (or (char-after end) ?\ )) syntaxes) |
| 80 | (nth 8 (syntax-ppss))) | 81 | ;; syntax-ppss could modify the match data (bug#14595) |
| 82 | (progn (setq match (match-string 0)) (nth 8 (syntax-ppss)))) | ||
| 81 | ;; No composition for you. Let's actually remove any composition | 83 | ;; No composition for you. Let's actually remove any composition |
| 82 | ;; we may have added earlier and which is now incorrect. | 84 | ;; we may have added earlier and which is now incorrect. |
| 83 | (remove-text-properties start end '(composition)) | 85 | (remove-text-properties start end '(composition)) |
| 84 | ;; That's a symbol alright, so add the composition. | 86 | ;; That's a symbol alright, so add the composition. |
| 85 | (compose-region start end (cdr (assoc (match-string 0) alist))))) | 87 | (compose-region start end (cdr (assoc match alist))))) |
| 86 | ;; Return nil because we're not adding any face property. | 88 | ;; Return nil because we're not adding any face property. |
| 87 | nil) | 89 | nil) |
| 88 | 90 | ||