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

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

[nongnu] elpa/helm 6184d8b40d 5/7: Make two new commands with helm-make-


From: ELPA Syncer
Subject: [nongnu] elpa/helm 6184d8b40d 5/7: Make two new commands with helm-make-command-from-action
Date: Sat, 17 Sep 2022 04:58:55 -0400 (EDT)

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

    Make two new commands with helm-make-command-from-action
---
 helm-buffers.el | 12 +++++-------
 helm-files.el   | 11 ++++-------
 2 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/helm-buffers.el b/helm-buffers.el
index b97b91ac72..5a524b3c5e 100644
--- a/helm-buffers.el
+++ b/helm-buffers.el
@@ -1160,13 +1160,11 @@ Can be used by any source that list buffers."
   (with-current-buffer buf
     (helm-browse-project helm-current-prefix-arg)))
 
-(defun helm-buffers-run-browse-project ()
-  "Run `helm-buffers-browse-project' from key."
-  (interactive)
-  (with-helm-alive-p
-      (if helm-buffers-in-project-p
-          (user-error "You are already browsing this project")
-          (helm-exit-and-execute-action 'helm-buffers-browse-project))))
+(helm-make-command-from-action helm-buffers-run-browse-project
+    "Run `helm-buffers-browse-project' from key."
+  'helm-buffers-browse-project
+  (cl-assert (not helm-buffers-in-project-p)
+             nil "You are already browsing this project"))
 
 (defun helm-buffers-quit-and-find-file-fn (source)
   (let* ((sel (helm-get-selection nil nil source))
diff --git a/helm-files.el b/helm-files.el
index 1abdd58d54..f815b67451 100644
--- a/helm-files.el
+++ b/helm-files.el
@@ -5827,13 +5827,10 @@ selecting them."
               ;; unspecified e.g user hit C-k foo RET.
               (t (find-file candidate)))))))
 
-(defun helm-ff-find-file-other-tab ()
-  "Run find file in other tab action from `helm-source-buffers-list'."
-  (interactive)
-  (cl-assert (fboundp 'tab-bar-mode) nil "Tab-bar-mode not available")
-  (with-helm-alive-p
-    (helm-exit-and-execute-action 'find-file-other-tab)))
-(put 'helm-ff-find-file-other-tab 'helm-only t)
+(helm-make-command-from-action helm-ff-find-file-other-tab
+    "Run find file in other tab action from `helm-source-buffers-list'."
+  'find-file-other-tab
+  (cl-assert (fboundp 'tab-bar-mode) nil "Tab-bar-mode not available"))
 
 (defun helm-ff--new-dirs-to-update (path)
   "Collect directories to update when creating new directory PATH."



reply via email to

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