Emacs: Fix Eshell loading hooks to use cache folder

master
Pierre Neidhardt 2016-06-09 18:23:04 +02:00
parent c3e6db4b6f
commit 133b9f821f
2 changed files with 29 additions and 22 deletions

View File

@ -60,7 +60,7 @@ To view where the bindings are set in your config files, lookup
;; Minor modes
(add-hook 'dired-mode-hook (lambda () (require 'mode-dired)))
(add-hook 'ediff-mode-hook (lambda () (require 'mode-ediff)))
(add-hook 'eshell-mode-hook (lambda () (require 'mode-eshell)))
(add-hook 'eshell-load-hook (lambda () (require 'mode-eshell)))
(add-hook 'gud-mode-hook (lambda () (require 'mode-gud)))
(add-hook 'octave-mode-hook (lambda () (require 'mode-octave)))
(add-hook 'org-mode-hook (lambda () (require 'mode-org)))

View File

@ -1,4 +1,7 @@
;; Eshell
;; This mode has a lot of hooks.
;; `emacs-load-hook' is run at the very beginning; not all variables/functions will be set.
;; `emacs-mode-hook' is run once everything is loaded.
(setq eshell-directory-name (concat emacs-cache-folder "eshell"))
;; (setq eshell-aliases-file (concat user-emacs-directory "eshell-alias"))
@ -11,26 +14,30 @@
;; "\n`--"
;; (if (= (user-uid) 0) "# " "> ")))))
(nconc eshell-visual-commands
'("abook" "cmus" "htop" "mutt" "ncdu" "newsbeuter" "ranger" "task"))
(when (file-executable-p "/usr/bin/pacman")
(map-on-pair 'eshell/alias
'(("pc" "sudo pacman -Sc")
("pi" "sudo pacman -S --needed")
("pqi" "pacman -Qi")
("pqo" "pacman -Qo")
("pqs" "pacman -Qs")
("pr" "sudo pacman -Rs")
("psi" "pacman -Si")
("pss" "pacman -Ss")
("pu" "sudo pacman -Syu"))))
(map-on-pair 'eshell/alias
'(("mkdir" "mkdir -p")
("lx" "ls -lXh")
("lx" "ls -lXh")
("lk" "ls -lSrh")
("lc" "ls -lrc")
("ll" "ls -hl")
("la" "ls -ahl")))
(eval-after-load 'em-term
'(nconc eshell-visual-commands
'("abook" "cmus" "htop" "mutt" "ncdu" "newsbeuter" "ranger" "task")))
(eval-after-load 'em-alias
'(progn
(when (file-executable-p "/usr/bin/pacman")
(map-on-pair 'eshell/alias
'(("pc" "sudo pacman -Sc")
("pi" "sudo pacman -S --needed")
("pqi" "pacman -Qi")
("pqo" "pacman -Qo")
("pqs" "pacman -Qs")
("pr" "sudo pacman -Rs")
("psi" "pacman -Si")
("pss" "pacman -Ss")
("pu" "sudo pacman -Syu"))))
(map-on-pair 'eshell/alias
'(("mkdir" "mkdir -p")
("lx" "ls -lXh")
("lx" "ls -lXh")
("lk" "ls -lSrh")
("lc" "ls -lrc")
("ll" "ls -hl")
("la" "ls -ahl")))))
(provide 'mode-eshell)