Commit 50d434d1 authored by Dmitry Gutov's avatar Dmitry Gutov

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
parent 37230635
......@@ -423,6 +423,11 @@ macros in registers.
This searches the region for identical lines, and removes all but one
copy of each repeated line. The lines need not be sorted.
---
** `blink-matching-paren' now only highlights the matching open-paren
by default, instead of moving cursor. Set this variable to `jump' to
enable the old behavior.
* Changes in Specialized Modes and Packages in Emacs 24.4
......
2014-03-14 Dmitry Gutov <dgutov@yandex.ru>
* simple.el (blink-matching-paren): Describe the new value,
`jump', enabling the old behavior.
(blink-matching-open): Use that value. (Bug#17008)
2014-03-14 Glenn Morris <rgm@gnu.org>
* finder.el (finder-no-scan-regexp): Add leim-list.
......
......@@ -6341,8 +6341,12 @@ If called from Lisp, enable the mode if ARG is omitted or nil."
:group 'paren-matching)
(defcustom blink-matching-paren t
"Non-nil means show matching open-paren when close-paren is inserted."
:type 'boolean
"Non-nil means show matching open-paren when close-paren is inserted.
If t, highlight the paren. If `jump', move cursor to its position."
:type '(choice
(const :tag "Disable" nil)
(const :tag "Highlight" t)
(const :tag "Move cursor" jump))
:group 'paren-blinking)
(defcustom blink-matching-paren-on-screen t
......@@ -6452,17 +6456,21 @@ The function should return non-nil if the two tokens do not match.")
(message "No matching parenthesis found"))))
((not blinkpos) nil)
((pos-visible-in-window-p blinkpos)
;; Matching open within window, temporarily highlight char
;; after blinkpos but only if `blink-matching-paren-on-screen'
;; Matching open within window, temporarily move to or highlight
;; char after blinkpos but only if `blink-matching-paren-on-screen'
;; is non-nil.
(and blink-matching-paren-on-screen
(not show-paren-mode)
(unwind-protect
(progn
(move-overlay blink-matching--overlay blinkpos (1+ blinkpos)
(current-buffer))
(if (eq blink-matching-paren 'jump)
(save-excursion
(goto-char blinkpos)
(sit-for blink-matching-delay))
(delete-overlay blink-matching--overlay))))
(unwind-protect
(progn
(move-overlay blink-matching--overlay blinkpos (1+ blinkpos)
(current-buffer))
(sit-for blink-matching-delay))
(delete-overlay blink-matching--overlay)))))
(t
(save-excursion
(goto-char blinkpos)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment