summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2018-11-13 06:12:00 +0100
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2018-11-13 06:12:00 +0100
commitc252f3c286b9fd62ead417d11caeaa23562905f8 (patch)
tree28845635866734408a597c5c29032bd293730ab6
parentac9cd9bdd7f7f02886edc3057d9d756981a37bcd (diff)
Delete char backward without updating
* helm.el (helm-suspend-update): New. (helm-toggle-suspend-update): Use it. (helm-delete-backward-no-update):Use it.
-rw-r--r--helm.el31
1 files changed, 24 insertions, 7 deletions
diff --git a/helm.el b/helm.el
index 50ecc130..10bfe19b 100644
--- a/helm.el
+++ b/helm.el
@@ -3289,16 +3289,33 @@ For ANY-PRESELECT ANY-RESUME ANY-KEYMAP ANY-DEFAULT ANY-HISTORY, See `helm'."
This can be useful for example for quietly writing a complex regexp
without helm constantly updating."
(interactive)
- (with-helm-alive-p
- (when (setq helm-suspend-update-flag (not helm-suspend-update-flag))
+ (helm-suspend-update (not helm-suspend-update-flag) t))
+(put 'helm-toggle-suspend-update 'helm-only t)
+
+(defun helm-suspend-update (arg &optional verbose)
+ (with-helm-buffer
+ (when (setq helm-suspend-update-flag
+ (helm-acase arg
+ (1 t)
+ (-1 nil)
+ (t it)))
(helm-kill-async-processes)
(setq helm-pattern ""))
- (message (if helm-suspend-update-flag
- "Helm update suspended!"
- "Helm update re-enabled!"))
+ (when verbose
+ (message (if helm-suspend-update-flag
+ "Helm update suspended!"
+ "Helm update re-enabled!")))
(helm-aif (helm-get-current-source)
- (with-helm-buffer (helm-display-mode-line it t)))))
-(put 'helm-toggle-suspend-update 'helm-only t)
+ (helm-display-mode-line it t))))
+
+(defun helm-delete-backward-no-update ()
+ (interactive)
+ (with-helm-alive-p
+ (helm-suspend-update 1)
+ (delete-char -1)
+ (run-with-idle-timer 1 nil (lambda ()
+ (helm-suspend-update -1)
+ (helm-force-update)))))
(defun helm--suspend-read-passwd (old--fn &rest args)
"Suspend helm while reading password.