From f0c6aeab00ce11a85835abcff058e899b2bdb47f Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Tue, 24 Jul 2018 09:45:01 +0200 Subject: [PATCH] Eshell: Move fish-completion setup to init-eshell --- .emacs.d/init.el | 9 --------- .emacs.d/lisp/init-eshell.el | 11 ++++++++++- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 3961f399..5491cdd2 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -148,15 +148,6 @@ (nconc package-selected-packages '(fish-completion bash-completion pcomplete-extension pcmpl-args pcmpl-git)) (nconc package-selected-packages '(esh-autosuggest)) -(with-eval-after-load 'bash-completion - ;; REVIEW: Upstream should set path dynamically. - ;; https://github.com/szermatt/emacs-bash-completion/issues/33 - ;; Done. Need to update Guix package. - (setq bash-completion-prog (executable-find "bash"))) -(when (and (executable-find "fish") - (require 'fish-completion nil t)) - (setq fish-completion-fallback-on-bash-p t) - (global-fish-completion-mode)) (with-eval-after-load 'eshell (require 'init-eshell)) (autoload 'ambrevar/eshell-or-new-session "eshell") diff --git a/.emacs.d/lisp/init-eshell.el b/.emacs.d/lisp/init-eshell.el index fb63021a..595d817e 100644 --- a/.emacs.d/lisp/init-eshell.el +++ b/.emacs.d/lisp/init-eshell.el @@ -274,7 +274,7 @@ See `eshell' for the numeric prefix ARG." (define-key eshell-mode-map (kbd "C-") 'eshell-detach-attach)) (add-hook 'eshell-mode-hook 'ambrevar/eshell-detach-set-keys)) - +;; Man (when (string= (file-symlink-p (executable-find "man")) "mandoc") ;; Some systems like Void Linux use mandoc instead of man and do not know the ;; --nj, --nh flags. @@ -287,4 +287,13 @@ See `eshell' for the numeric prefix ARG." (pcmpl-args-process-file "man" "--" name))) (setq pcmpl-args-man-function 'ambrevar/pcmpl-args-mandoc-man-function)) +;; Completion +(when (require 'bash-completion nil t) + (when (and (or (executable-find "fish") + ;; "fish" needs not be in PATH with guix. + (executable-find "guix")) + (require 'fish-completion nil t)) + (setq fish-completion-fallback-on-bash-p t) + (global-fish-completion-mode))) + (provide 'init-eshell)