[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/helm d7e7075c3c 2/2: Add switch to shell action from buffe
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/helm d7e7075c3c 2/2: Add switch to shell action from buffers |
Date: |
Sun, 31 Jul 2022 12:58:39 -0400 (EDT) |
branch: elpa/helm
commit d7e7075c3cd72e8ffc59f0a68baa58e34a321b52
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>
Add switch to shell action from buffers
---
helm-buffers.el | 16 ++++++++++++++++
helm-types.el | 2 ++
2 files changed, 18 insertions(+)
diff --git a/helm-buffers.el b/helm-buffers.el
index 022e721eb0..b97b91ac72 100644
--- a/helm-buffers.el
+++ b/helm-buffers.el
@@ -28,9 +28,11 @@
(declare-function helm-comp-read "helm-mode")
(declare-function helm-browse-project "helm-files")
+(declare-function helm-ff-switch-to-shell "helm-files")
(defvar dired-buffers)
(defvar org-directory)
+(defvar helm-ff-default-directory)
(defgroup helm-buffers nil
@@ -254,6 +256,7 @@ Note that this variable is buffer-local.")
(define-key map (kbd "M-R") #'helm-buffer-run-rename-buffer)
(define-key map (kbd "M-m") #'helm-toggle-all-marks)
(define-key map (kbd "M-a") #'helm-mark-all)
+ (define-key map (kbd "M-e") #'helm-buffer-run-switch-to-shell)
(define-key map (kbd "C-]") #'helm-toggle-buffers-details)
(define-key map (kbd "C-c a")
#'helm-buffers-toggle-show-hidden-buffers)
(define-key map (kbd "C-M-SPC") #'helm-buffers-mark-similar-buffers)
@@ -910,6 +913,19 @@ If REGEXP-FLAG is given use `query-replace-regexp'."
(helm-exit-and-execute-action 'helm-kill-marked-buffers)))
(put 'helm-buffer-run-kill-buffers 'helm-only t)
+(defun helm-buffer-switch-to-shell (candidate)
+ (require 'helm-files)
+ (let ((helm-ff-default-directory
+ (with-current-buffer candidate
+ default-directory)))
+ (helm-ff-switch-to-shell nil)))
+
+(defun helm-buffer-run-switch-to-shell ()
+ (interactive)
+ (with-helm-alive-p
+ (helm-exit-and-execute-action 'helm-buffer-switch-to-shell)))
+(put 'helm-buffer-run-switch-to-shell 'no-helm-mx t)
+
(defun helm-buffer-run-grep ()
"Run Grep action from `helm-source-buffers-list'."
(interactive)
diff --git a/helm-types.el b/helm-types.el
index 887711e9f8..d59e0319ef 100644
--- a/helm-types.el
+++ b/helm-types.el
@@ -181,6 +181,8 @@
'helm-switch-to-buffer-at-linum
"Browse project `C-x C-d'"
'helm-buffers-browse-project
+ "Switch to shell"
+ 'helm-buffer-switch-to-shell
"Query replace regexp `C-M-%'"
'helm-buffer-query-replace-regexp
"Query replace `M-%'" 'helm-buffer-query-replace