Replace ambrevar/prefer-eshell by helm-ff-preferred-shell-mode.

master
Pierre Neidhardt 2020-06-26 17:16:57 +02:00
parent c7fd33bda8
commit 2d5ed4e490
2 changed files with 7 additions and 7 deletions

View File

@ -215,8 +215,7 @@ This should be faster then `seq-uniq'."
;; (add-hook 'eshell-mode-hook 'ambrevar/fix-local-epa-file-encrypt-to)
;;; Spawning
(defvar ambrevar/prefer-eshell nil
"If non-nil, default to Eshell instead of M-x shell.")
(require 'init-shell); For `helm-ff-preferred-shell-mode'.
(when (require 'patch-helm nil 'noerror)
(helm-defswitcher
"Eshell"
@ -226,12 +225,12 @@ This should be faster then `seq-uniq'."
(derived-mode-p 'eshell-mode)
(derived-mode-p 'shell-mode))))
(lambda (&optional name)
(if ambrevar/prefer-eshell
(if (eq helm-ff-preferred-shell-mode 'eshell-mode)
(eshell 'new)
(shell (generate-new-buffer (generate-new-buffer-name "*shell*"))))
(when name
(rename-buffer (format "*%sshell<%s>*"
(if ambrevar/prefer-eshell "e" "")
(if (eq helm-ff-preferred-shell-mode 'eshell-mode) "e" "")
name)
'unique)))
nil

View File

@ -190,7 +190,7 @@ If MANIFEST is nil, it is queried from the manifests found in `ambrevar/guix-man
(defun %ambrevar/guix-install-manifest (&optional manifests channel)
"Install list of (NAME MANIFEST-FILE) using CHANNEL."
(require 'init-eshell) ; For `ambrevar/prefer-eshell'.
(require 'init-shell) ; For `helm-ff-preferred-shell-mode'.
(let* ((guix (if channel
(let ((dest (expand-file-name
;; TODO: What name should we use with multiple manifests?
@ -207,7 +207,7 @@ If MANIFEST is nil, it is queried from the manifests found in `ambrevar/guix-man
(make-directory (expand-file-name manifest-name
ambrevar/guix-extra-profiles)
'parents)))
(funcall (if ambrevar/prefer-eshell
(funcall (if (eq helm-ff-preferred-shell-mode 'eshell-mode)
'ambrevar/run-in-eshell
'ambrevar/run-in-shell)
(mapconcat #'identity
@ -282,10 +282,11 @@ With a prefix argument, query for a channel specification file."
System is queried from those found in `ambrevar/guix-system-directory'. "
(interactive)
(require 'init-shell) ; For `helm-ff-preferred-shell-mode'.
(let* ((system-pair (ambrevar/guix-query-system system))
(system-name (first system-pair))
(system (second system-pair)))
(funcall (if ambrevar/prefer-eshell
(funcall (if (eq helm-ff-preferred-shell-mode 'eshell-mode)
'ambrevar/run-in-eshell
'ambrevar/run-in-shell)
(string-join