aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2014-03-14 20:01:39 +0200
committerDmitry Gutov2014-03-14 20:01:39 +0200
commit50d434d19883a12e50f736d8216e8e36566d2424 (patch)
tree1fcdfc334f969902bf9d6ee7be1c428a5deef311
parent3723063530471df09f28b419a472959be8363642 (diff)
downloademacs-50d434d19883a12e50f736d8216e8e36566d2424.tar.gz
emacs-50d434d19883a12e50f736d8216e8e36566d2424.zip
Support the old `blink-matching-paren' behavior
* lisp/simple.el (blink-matching-paren): Describe the new value, `jump', enabling the old behavior. (blink-matching-open): Use that value. Fixes: debbugs:17008
-rw-r--r--etc/NEWS5
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/simple.el26
3 files changed, 28 insertions, 9 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 04796bf37e2..3d69fe90b20 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -423,6 +423,11 @@ macros in registers.
423This searches the region for identical lines, and removes all but one 423This searches the region for identical lines, and removes all but one
424copy of each repeated line. The lines need not be sorted. 424copy of each repeated line. The lines need not be sorted.
425 425
426---
427** `blink-matching-paren' now only highlights the matching open-paren
428by default, instead of moving cursor. Set this variable to `jump' to
429enable the old behavior.
430
426 431
427* Changes in Specialized Modes and Packages in Emacs 24.4 432* Changes in Specialized Modes and Packages in Emacs 24.4
428 433
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e1d98e3f18a..769b77809bc 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12014-03-14 Dmitry Gutov <dgutov@yandex.ru>
2
3 * simple.el (blink-matching-paren): Describe the new value,
4 `jump', enabling the old behavior.
5 (blink-matching-open): Use that value. (Bug#17008)
6
12014-03-14 Glenn Morris <rgm@gnu.org> 72014-03-14 Glenn Morris <rgm@gnu.org>
2 8
3 * finder.el (finder-no-scan-regexp): Add leim-list. 9 * finder.el (finder-no-scan-regexp): Add leim-list.
diff --git a/lisp/simple.el b/lisp/simple.el
index 881a633f972..d84708217b4 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -6341,8 +6341,12 @@ If called from Lisp, enable the mode if ARG is omitted or nil."
6341 :group 'paren-matching) 6341 :group 'paren-matching)
6342 6342
6343(defcustom blink-matching-paren t 6343(defcustom blink-matching-paren t
6344 "Non-nil means show matching open-paren when close-paren is inserted." 6344 "Non-nil means show matching open-paren when close-paren is inserted.
6345 :type 'boolean 6345If t, highlight the paren. If `jump', move cursor to its position."
6346 :type '(choice
6347 (const :tag "Disable" nil)
6348 (const :tag "Highlight" t)
6349 (const :tag "Move cursor" jump))
6346 :group 'paren-blinking) 6350 :group 'paren-blinking)
6347 6351
6348(defcustom blink-matching-paren-on-screen t 6352(defcustom blink-matching-paren-on-screen t
@@ -6452,17 +6456,21 @@ The function should return non-nil if the two tokens do not match.")
6452 (message "No matching parenthesis found")))) 6456 (message "No matching parenthesis found"))))
6453 ((not blinkpos) nil) 6457 ((not blinkpos) nil)
6454 ((pos-visible-in-window-p blinkpos) 6458 ((pos-visible-in-window-p blinkpos)
6455 ;; Matching open within window, temporarily highlight char 6459 ;; Matching open within window, temporarily move to or highlight
6456 ;; after blinkpos but only if `blink-matching-paren-on-screen' 6460 ;; char after blinkpos but only if `blink-matching-paren-on-screen'
6457 ;; is non-nil. 6461 ;; is non-nil.
6458 (and blink-matching-paren-on-screen 6462 (and blink-matching-paren-on-screen
6459 (not show-paren-mode) 6463 (not show-paren-mode)
6460 (unwind-protect 6464 (if (eq blink-matching-paren 'jump)
6461 (progn 6465 (save-excursion
6462 (move-overlay blink-matching--overlay blinkpos (1+ blinkpos) 6466 (goto-char blinkpos)
6463 (current-buffer))
6464 (sit-for blink-matching-delay)) 6467 (sit-for blink-matching-delay))
6465 (delete-overlay blink-matching--overlay)))) 6468 (unwind-protect
6469 (progn
6470 (move-overlay blink-matching--overlay blinkpos (1+ blinkpos)
6471 (current-buffer))
6472 (sit-for blink-matching-delay))
6473 (delete-overlay blink-matching--overlay)))))
6466 (t 6474 (t
6467 (save-excursion 6475 (save-excursion
6468 (goto-char blinkpos) 6476 (goto-char blinkpos)