summaryrefslogtreecommitdiff
path: root/helm-buffers.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2016-12-16 07:54:34 +0100
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2016-12-16 09:10:08 +0100
commit8e809f422d34df7a3d556b4b616ac03738e783fc (patch)
tree1f9a6b2f6e3c1bebe165817b836d59803889f96a /helm-buffers.el
parentc47c1f54d1abbe184bac5bdc6739033416510487 (diff)
Fix revert and save marked buffers.
* helm-buffers.el (helm-buffer-revert-and-update): Do it. (helm-buffer-save-and-update): Do it.
Diffstat (limited to 'helm-buffers.el')
-rw-r--r--helm-buffers.el30
1 files changed, 16 insertions, 14 deletions
diff --git a/helm-buffers.el b/helm-buffers.el
index ec401c17..7c4aa37d 100644
--- a/helm-buffers.el
+++ b/helm-buffers.el
@@ -613,12 +613,13 @@ If REGEXP-FLAG is given use `query-replace-regexp'."
(mapc 'helm-revert-buffer (helm-marked-candidates)))
(defun helm-buffer-revert-and-update (_candidate)
- (let ((marked (helm-marked-candidates))
- (preselect (helm-buffers--quote-truncated-buffer
- (helm-get-selection))))
- (cl-loop for buf in marked do (helm-revert-buffer buf))
- (when (> (length marked) 1) (helm-unmark-all))
- (helm-force-update preselect)))
+ (with-helm-buffer
+ (let ((marked (helm-marked-candidates))
+ (preselect (helm-buffers--quote-truncated-buffer
+ (helm-get-selection))))
+ (cl-loop for buf in marked do (helm-revert-buffer buf))
+ (when helm-marked-candidates (helm-unmark-all))
+ (helm-update preselect))))
(defun helm-buffer-revert-persistent ()
"Revert buffer without quitting helm."
@@ -629,14 +630,15 @@ If REGEXP-FLAG is given use `query-replace-regexp'."
(put 'helm-buffer-revert-persistent 'helm-only t)
(defun helm-buffer-save-and-update (_candidate)
- (let ((marked (helm-marked-candidates))
- (preselect (helm-get-selection nil t))
- (enable-recursive-minibuffers t))
- (cl-loop for buf in marked do
- (with-current-buffer (get-buffer buf)
- (when (buffer-file-name) (save-buffer))))
- (when (> (length marked) 1) (helm-unmark-all))
- (helm-force-update (regexp-quote preselect))))
+ (with-helm-buffer
+ (let ((marked (helm-marked-candidates))
+ (preselect (helm-get-selection nil t))
+ (enable-recursive-minibuffers t))
+ (cl-loop for buf in marked do
+ (with-current-buffer (get-buffer buf)
+ (when (buffer-file-name) (save-buffer))))
+ (when helm-marked-candidates (helm-unmark-all))
+ (helm-update (regexp-quote preselect)))))
(defun helm-buffer-save-persistent ()
"Save buffer without quitting helm."