Eshell: Put history-related parts together

master
Pierre Neidhardt 2019-02-05 22:47:37 +01:00
parent 368d2e3d8e
commit 50b97ff67c
1 changed files with 13 additions and 13 deletions

View File

@ -239,6 +239,19 @@ This should be faster then `seq-uniq'."
(setq index (1+ index))))))
(add-hook 'eshell-pre-command-hook 'ambrevar/eshell-history-remove-duplicates)
;; Always save history
(add-hook 'eshell-pre-command-hook 'eshell-save-some-history)
;;; Version and encrypt history.
;; TODO: The following makes EPA always prompt for recipients for some reason. Bug?
;; (make-directory "~/personal/history/" :parents)
;; (setq eshell-history-file-name (expand-file-name "eshell.gpg" "~/personal/history"))
;; (defun ambrevar/fix-local-epa-file-encrypt-to ()
;; (unless (local-variable-p 'epa-file-encrypt-to (current-buffer))
;; (make-local-variable 'epa-file-encrypt-to))
;; (setq epa-file-encrypt-to "mail@ambrevar.xyz"))
;; (add-hook 'eshell-mode-hook 'ambrevar/fix-local-epa-file-encrypt-to)
;;; Spawning
(defun ambrevar/eshell-or-new-session (&optional arg)
"Create an interactive Eshell buffer.
@ -287,19 +300,6 @@ See `eshell' for the numeric prefix ARG."
(add-hook 'eshell-pre-command-hook 'ambrevar/eshell-status-record)
;;; Version and encrypt history.
;; TODO: The following makes EPA always prompt for recipients for some reason. Bug?
;; (make-directory "~/personal/history/" :parents)
;; (setq eshell-history-file-name (expand-file-name "eshell.gpg" "~/personal/history"))
;; (defun ambrevar/fix-local-epa-file-encrypt-to ()
;; (unless (local-variable-p 'epa-file-encrypt-to (current-buffer))
;; (make-local-variable 'epa-file-encrypt-to))
;; (setq epa-file-encrypt-to "mail@ambrevar.xyz"))
;; (add-hook 'eshell-mode-hook 'ambrevar/fix-local-epa-file-encrypt-to)
;; Always save history
(add-hook 'eshell-pre-command-hook 'eshell-save-some-history)
;;; Detach
(when (require 'package-eshell-detach nil t)
(defun ambrevar/eshell-detach-set-keys ()