summaryrefslogtreecommitdiff
path: root/helm-regexp.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2014-07-16 13:16:48 +0200
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2014-07-16 13:16:48 +0200
commitd0bd6b28c4f8fd70dfa2a5aa33d64954e93b85f5 (patch)
tree69ffb94d13c7edff1053ff1a46dcd976881bae94 /helm-regexp.el
parent6b28a8b141756c307dd2a22724d9e69e40aeae61 (diff)
* helm-regexp.el (helm-moccur-auto-update-on-resume): New var.
(helm-moccur-resume-fn): Use it.
Diffstat (limited to 'helm-regexp.el')
-rw-r--r--helm-regexp.el23
1 files changed, 20 insertions, 3 deletions
diff --git a/helm-regexp.el b/helm-regexp.el
index 0846ad4e..09bcdffb 100644
--- a/helm-regexp.el
+++ b/helm-regexp.el
@@ -289,6 +289,8 @@ Same as `helm-moccur-goto-line' but go in new frame."
(requires-pattern . 2))
"Helm source for multi occur.")
+(defvar helm-moccur-auto-update-on-resume t)
+
(defun helm-moccur-resume-fn ()
(with-helm-buffer
(let (new-tick-ls)
@@ -297,9 +299,24 @@ Same as `helm-moccur-goto-line' but go in new frame."
do (push new-tick new-tick-ls)
for tick in helm-multi-occur-buffer-tick
always (= tick new-tick))
- (when (y-or-n-p "Helm occur Buffer outdated, update? ")
- (run-with-idle-timer 0.1 nil #'helm-force-update)
- (setq helm-multi-occur-buffer-tick (reverse new-tick-ls)))))))
+ (helm-aif helm-moccur-auto-update-on-resume
+ (when (or (eq it 'noask)
+ (y-or-n-p "Helm (m)occur Buffer outdated, update? "))
+ (run-with-idle-timer 0.1 nil (lambda ()
+ (with-helm-buffer
+ (helm-force-update)
+ (message "Helm (m)occur Buffer have been udated")
+ (sit-for 1) (message nil))))
+ (setq helm-multi-occur-buffer-tick (reverse new-tick-ls)))
+ (run-with-idle-timer 0.1 nil (lambda ()
+ (with-helm-buffer
+ (let ((ov (make-overlay (point-min) (point-max))))
+ (overlay-put ov 'face '((:background "DimGray")))
+ (sit-for 0.3) (delete-overlay ov)
+ (message "[Helm occur Buffer outdated (C-c C-u to update)]")))))
+ (with-helm-after-update-hook
+ (setq helm-multi-occur-buffer-tick (reverse new-tick-ls))
+ (message "Helm (m)occur Buffer have been udated")))))))
(defun helm-moccur-filter-one-by-one (candidate)
"`filter-one-by-one' function for `helm-source-moccur'."