From: Mark Wooding Date: Thu, 21 Oct 2010 13:52:06 +0000 (+0100) Subject: el/dot-emacs.el: Twiddle `eshell' settings. X-Git-Url: https://git.distorted.org.uk/~mdw/profile/commitdiff_plain/2d8b292475b392c2d8ff347bc6867427bbad156f el/dot-emacs.el: Twiddle `eshell' settings. * Abbreviate the prompt, if possible. * Turn the aliases into real functions. Seems slightly prettier. --- diff --git a/el/dot-emacs.el b/el/dot-emacs.el index 525d2d4..c51803b 100644 --- a/el/dot-emacs.el +++ b/el/dot-emacs.el @@ -2135,13 +2135,21 @@ strip numbers instead." (save-match-data (replace-regexp-in-string "\\..*$" "" (system-name))) " " - (eshell/pwd) + (let* ((pwd (eshell/pwd)) (npwd (length pwd)) + (home (expand-file-name "~")) (nhome (length home))) + (if (and (>= npwd nhome) + (or (= nhome npwd) + (= (elt pwd nhome) ?/) + (string= (substring pwd 0 nhome) home))) + (concat "~" (substring pwd (length home))) + pwd)) right))) (setq eshell-prompt-function 'mdw-eshell-prompt) (setq eshell-prompt-regexp "^\\[[^]>]+\\(\\]\\|>>?\\)") -(defalias 'eshell/e 'find-file) -(defalias 'eshell/w3m 'w3m-goto-url) +(defun eshell/e (file) (find-file file) nil) +(defun eshell/ee (file) (find-file-other-window file) nil) +(defun eshell/w3m (url) (w3m-goto-url url) nil) (mdw-define-face eshell-prompt (t :weight bold)) (mdw-define-face eshell-ls-archive (t :weight bold :foreground "red"))