diff options
author | Juri Linkov <juri@linkov.net> | 2020-11-15 22:32:39 +0200 |
---|---|---|
committer | Juri Linkov <juri@linkov.net> | 2020-11-15 22:32:39 +0200 |
commit | 81588748bd85827468e297d3e44a72844438e807 (patch) | |
tree | 3523ae43b965f962e6742498aa1ab95667bce9b3 /lisp/emacs-lisp | |
parent | 4ddc38fc59845f7fa088121f435f62d1c0295c69 (diff) | |
download | emacs-81588748bd85827468e297d3e44a72844438e807.tar.gz emacs-81588748bd85827468e297d3e44a72844438e807.tar.bz2 emacs-81588748bd85827468e297d3e44a72844438e807.zip |
New user options 'copy-region-blink-delay' and 'delete-pair-blink-delay'
* lisp/emacs-lisp/lisp.el (delete-pair-blink-delay): New defcustom.
(delete-pair): Use it. (Bug#4136)
* lisp/simple.el (copy-region-blink-delay): New defcustom.
(indicate-copied-region): Use it. (Bug#42865)
Thanks to Sean Whitton <spwhitton@spwhitton.name>.
(indicate-copied-region): Use 'query-replace-descr' not to show
newlines literally. Use "Copied text" instead of misleading
"Saved text" (bug#42865).
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/lisp.el | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 35590123ee6..124900168c3 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -784,9 +784,17 @@ This command assumes point is not in a string or comment." (interactive "P") (insert-pair arg ?\( ?\))) +(defcustom delete-pair-blink-delay blink-matching-delay + "Time in seconds to delay after showing a paired character to delete. +It's used by the command `delete-pair'. The value 0 disables blinking." + :type 'number + :group 'lisp + :version "28.1") + (defun delete-pair (&optional arg) "Delete a pair of characters enclosing ARG sexps that follow point. -A negative ARG deletes a pair around the preceding ARG sexps instead." +A negative ARG deletes a pair around the preceding ARG sexps instead. +The option `delete-pair-blink-delay' can disable blinking." (interactive "P") (if arg (setq arg (prefix-numeric-value arg)) @@ -802,6 +810,9 @@ A negative ARG deletes a pair around the preceding ARG sexps instead." (if (= (length p) 3) (cdr p) p)) insert-pair-alist)) (error "Not after matching pair")) + (when (and (numberp delete-pair-blink-delay) + (> delete-pair-blink-delay 0)) + (sit-for delete-pair-blink-delay)) (delete-char 1))) (delete-char -1)) (save-excursion @@ -814,6 +825,9 @@ A negative ARG deletes a pair around the preceding ARG sexps instead." (if (= (length p) 3) (cdr p) p)) insert-pair-alist)) (error "Not before matching pair")) + (when (and (numberp delete-pair-blink-delay) + (> delete-pair-blink-delay 0)) + (sit-for delete-pair-blink-delay)) (delete-char -1))) (delete-char 1)))) |