emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/helm aacfb9248a 3/3: Add an action to switch to buffer fra


From: ELPA Syncer
Subject: [nongnu] elpa/helm aacfb9248a 3/3: Add an action to switch to buffer frame if some Issue #2522
Date: Sat, 11 Jun 2022 04:58:33 -0400 (EDT)

branch: elpa/helm
commit aacfb9248a714b40eed2df95991fd30dc91b8d71
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>

    Add an action to switch to buffer frame if some Issue #2522
---
 helm-buffers.el | 8 ++++++++
 helm-types.el   | 2 ++
 2 files changed, 10 insertions(+)

diff --git a/helm-buffers.el b/helm-buffers.el
index 2db8a09dd1..ce91161fc5 100644
--- a/helm-buffers.el
+++ b/helm-buffers.el
@@ -966,6 +966,14 @@ If REGEXP-FLAG is given use `query-replace-regexp'."
     (select-frame (make-frame))
     (helm-window-show-buffers bufs)))
 
+(defun helm-buffers-maybe-raise-buffer-frame (candidate)
+  "Raise buffer frame handling buffer CANDIDATE and switch to it."
+  (let ((oframe (window-frame (get-buffer-window candidate 0))))
+    (unless (eql oframe (selected-frame))
+      (raise-frame oframe))
+    (with-selected-frame oframe
+      (switch-to-buffer candidate))))
+
 (defun helm-buffer-switch-other-frame ()
   "Run switch to other frame action from `helm-source-buffers-list'."
   (interactive)
diff --git a/helm-types.el b/helm-types.el
index 003b57af42..887711e9f8 100644
--- a/helm-types.el
+++ b/helm-types.el
@@ -172,6 +172,8 @@
    'helm-buffer-switch-buffers-other-window
    "Switch to buffer(s) other frame `C-c C-o'"
    'helm-buffer-switch-to-buffer-other-frame
+   "Raise buffer frame maybe"
+   'helm-buffers-maybe-raise-buffer-frame
    (lambda () (and (fboundp 'tab-bar-mode)
                    "Switch to buffer(s) other tab `C-c C-t'"))
    'helm-buffers-switch-to-buffer-other-tab



reply via email to

[Prev in Thread] Current Thread [Next in Thread]