branch: elpa/helm
commit 753563ee010e865f3f0fd9d491c2052eb1347fd8
Author: Thierry Volpiatto <thie...@posteo.net>
Commit: Thierry Volpiatto <thie...@posteo.net>

    Fix persistent-action in helm-mark-ring-default-action
    
    Do not run in PA the hook which is modifying the mark.
    Also make clear in which buffer we are working.
---
 helm-ring.el | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/helm-ring.el b/helm-ring.el
index 02521997f5..2aeee576be 100644
--- a/helm-ring.el
+++ b/helm-ring.el
@@ -292,12 +292,14 @@ yanked string."
     (helm-aif (marker-buffer candidate)
         (progn
           (switch-to-buffer it)
-          (helm-log-run-hook "helm-mark-ring-default-action" 
'helm-goto-line-before-hook)
-          (helm-match-line-cleanup)
-          (with-helm-current-buffer
-            (unless helm-yank-point (setq helm-yank-point (point))))
-          (helm-goto-char target)
-          (helm-highlight-current-line))
+          (with-selected-window (get-buffer-window it)
+            (unless helm-in-persistent-action
+              (helm-log-run-hook
+               "helm-mark-ring-default-action" 'helm-goto-line-before-hook))
+            (helm-match-line-cleanup)
+            (unless helm-yank-point (setq helm-yank-point (point)))
+            (helm-goto-char target)
+            (helm-highlight-current-line)))
       ;; marker points to no buffer, no need to dereference it, just
       ;; delete it.
       (setq mark-ring (delete target mark-ring))

Reply via email to