aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2015-08-18 18:56:00 +0300
committerDmitry Gutov2015-08-18 19:07:26 +0300
commit9c1e7d5a2666cdf63abcc6623a8489d7bd47fe22 (patch)
tree834d33e7c34ad7a0ecfaca31bb0e5416cdda7df8
parentc29a51df2de7eb800edf8e2235ee6c34bd1c9562 (diff)
downloademacs-9c1e7d5a2666cdf63abcc6623a8489d7bd47fe22.tar.gz
emacs-9c1e7d5a2666cdf63abcc6623a8489d7bd47fe22.zip
Refine the previous change
* lisp/simple.el (blink-matching-open): Use minibuffer-message outside of save-excursion (bug#21286).
-rw-r--r--lisp/simple.el20
1 files changed, 7 insertions, 13 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index afb2d4a9ecb..0d691eabdf2 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -7004,12 +7004,9 @@ The function should return non-nil if the two tokens do not match.")
7004 (sit-for blink-matching-delay)) 7004 (sit-for blink-matching-delay))
7005 (delete-overlay blink-matching--overlay))))) 7005 (delete-overlay blink-matching--overlay)))))
7006 (t 7006 (t
7007 (save-excursion 7007 (let ((open-paren-line-string
7008 (let* ((orig-pos (prog1 7008 (save-excursion
7009 (point) 7009 (goto-char blinkpos)
7010 (goto-char blinkpos)))
7011
7012 (open-paren-line-string
7013 ;; Show what precedes the open in its line, if anything. 7010 ;; Show what precedes the open in its line, if anything.
7014 (cond 7011 (cond
7015 ((save-excursion (skip-chars-backward " \t") (not (bolp))) 7012 ((save-excursion (skip-chars-backward " \t") (not (bolp)))
@@ -7036,13 +7033,10 @@ The function should return non-nil if the two tokens do not match.")
7036 "..." 7033 "..."
7037 (buffer-substring blinkpos (1+ blinkpos)))) 7034 (buffer-substring blinkpos (1+ blinkpos))))
7038 ;; There is nothing to show except the char itself. 7035 ;; There is nothing to show except the char itself.
7039 (t (buffer-substring blinkpos (1+ blinkpos)))))) 7036 (t (buffer-substring blinkpos (1+ blinkpos)))))))
7040 ;; Because minibuffer-message causes a full redisplay, go back 7037 (minibuffer-message
7041 ;; to the original point before that happens. 7038 "Matches %s"
7042 (goto-char orig-pos) 7039 (substring-no-properties open-paren-line-string))))))))
7043 (minibuffer-message
7044 "Matches %s"
7045 (substring-no-properties open-paren-line-string)))))))))
7046 7040
7047(defvar blink-paren-function 'blink-matching-open 7041(defvar blink-paren-function 'blink-matching-open
7048 "Function called, if non-nil, whenever a close parenthesis is inserted. 7042 "Function called, if non-nil, whenever a close parenthesis is inserted.