aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/simple.el18
2 files changed, 21 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f59b457252c..7ea8d3aa116 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,9 @@
12010-09-01 Stefan Monnier <monnier@iro.umontreal.ca> 12010-09-01 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * simple.el (blink-paren-function): Move from C to here.
4 (blink-paren-post-self-insert-function): New function.
5 (post-self-insert-hook): Use it.
6
3 * emacs-lisp/pcase.el (pcase-split-memq): 7 * emacs-lisp/pcase.el (pcase-split-memq):
4 Fix overenthusiastic optimisation. 8 Fix overenthusiastic optimisation.
5 (pcase-u1): Handle the case of a lambda pred. 9 (pcase-u1): Handle the case of a lambda pred.
diff --git a/lisp/simple.el b/lisp/simple.el
index 6a99f785852..610698cc09b 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -5607,7 +5607,23 @@ it skips the contents of comments that end before point."
5607 (message "Matches %s" 5607 (message "Matches %s"
5608 (substring-no-properties open-paren-line-string))))))))) 5608 (substring-no-properties open-paren-line-string)))))))))
5609 5609
5610(setq blink-paren-function 'blink-matching-open) 5610(defvar blink-paren-function 'blink-matching-open
5611 "Function called, if non-nil, whenever a close parenthesis is inserted.
5612More precisely, a char with closeparen syntax is self-inserted.")
5613
5614(defun blink-paren-post-self-insert-function ()
5615 (when (and (eq (char-before) last-command-event) ; Sanity check.
5616 (memq (char-syntax last-command-event) '(?\) ?\$))
5617 blink-paren-function
5618 (not executing-kbd-macro)
5619 (not noninteractive))
5620 (funcall blink-paren-function)))
5621
5622(add-hook 'post-self-insert-hook #'blink-paren-post-self-insert-function
5623 ;; Most likely, this hook is nil, so this arg doesn't matter,
5624 ;; but I use it as a reminder that this function usually
5625 ;; likes to be run after others since it does `sit-for'.
5626 'append)
5611 5627
5612;; This executes C-g typed while Emacs is waiting for a command. 5628;; This executes C-g typed while Emacs is waiting for a command.
5613;; Quitting out of a program does not go through here; 5629;; Quitting out of a program does not go through here;