diff options
| author | Stefan Monnier | 2010-09-01 16:41:17 +0200 |
|---|---|---|
| committer | Stefan Monnier | 2010-09-01 16:41:17 +0200 |
| commit | 8f4e9110cad4aa7fbbfa4765221f4a6392ca7af3 (patch) | |
| tree | 3dee31a308543acddc9363cd2e6638f962f8c695 /lisp | |
| parent | 4de81ee0d223f3ffda6c22ac630ace93f0fc47f7 (diff) | |
| download | emacs-8f4e9110cad4aa7fbbfa4765221f4a6392ca7af3.tar.gz emacs-8f4e9110cad4aa7fbbfa4765221f4a6392ca7af3.zip | |
* lisp/simple.el (blink-paren-function): Move from C to here.
(blink-paren-post-self-insert-function): New function.
(post-self-insert-hook): Use it.
* src/cmds.c (Vblink_paren_function): Remove.
(internal_self_insert): Make it insert N chars at a time.
Don't call blink-paren-function.
(Fself_insert_command): Adjust accordingly.
(syms_of_cmds): Don't declare blink-paren-function.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/simple.el | 18 |
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 @@ | |||
| 1 | 2010-09-01 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2010-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. | ||
| 5612 | More 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; |