emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r116760: Support the old `blink-matching-paren' beha


From: Dmitry Gutov
Subject: [Emacs-diffs] trunk r116760: Support the old `blink-matching-paren' behavior
Date: Fri, 14 Mar 2014 18:01:45 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116760
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/17008
committer: Dmitry Gutov <address@hidden>
branch nick: trunk
timestamp: Fri 2014-03-14 20:01:39 +0200
message:
  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.
modified:
  etc/NEWS                       news-20100311060928-aoit31wvzf25yr1z-1
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/simple.el                 simple.el-20091113204419-o5vbwnq5f7feedwu-403
=== modified file 'etc/NEWS'
--- a/etc/NEWS  2014-03-12 07:14:30 +0000
+++ b/etc/NEWS  2014-03-14 18:01:39 +0000
@@ -423,6 +423,11 @@
 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
 

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-03-14 17:54:12 +0000
+++ b/lisp/ChangeLog    2014-03-14 18:01:39 +0000
@@ -1,3 +1,9 @@
+2014-03-14  Dmitry Gutov  <address@hidden>
+
+       * 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  <address@hidden>
 
        * finder.el (finder-no-scan-regexp): Add leim-list.

=== modified file 'lisp/simple.el'
--- a/lisp/simple.el    2014-03-11 17:10:07 +0000
+++ b/lisp/simple.el    2014-03-14 18:01:39 +0000
@@ -6341,8 +6341,12 @@
   :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 @@
             (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)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]