From f54d8a59305b6c628456c8ba8eb2459213c517d5 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Wed, 8 Jul 2015 12:38:23 +0200 Subject: Move my eshell prompt to separate module To help with autoloading, also update the Makefile to create a `site-lisp/site-autoloads.el' file which is loaded by emacs. --- emacs/.emacs.d/init.el | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'emacs/.emacs.d/init.el') diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index b61bbf4..3a22c60 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -251,12 +251,6 @@ But only if it is a maildir inbox." 'action (lambda (button) (browse-url (button-label button))))))) -(defun oni:eshell-prompt () - "Show a pretty shell prompt." - (concat (if (not (looking-back "\n" nil)) "\n") - (oni:shorten-dir (abbreviate-file-name (eshell/pwd))) - " > ")) - (defun oni:go-mode-func () "Function for `go-mode-hook'." (setq indent-tabs-mode nil)) @@ -710,12 +704,6 @@ For `python-mode' I prefer `python-imenu-create-flat-index'." (insert "`" command "':\n")) (shell-command command output-buffer)) -(defun oni:shorten-dir (dir) - "Shorten a directory, (almost) like fish does it." - (while (string-match "\\(\\.?[^./]\\)[^/]+/" dir) - (setq dir (replace-match "\\1/" nil nil dir))) - dir) - (defun oni:show-buffer-position () "Show the position in the current buffer." (interactive) @@ -1011,9 +999,7 @@ from myaethon2.core.decorators import ( (setq eltuki-blog-dir "~/documents/blog")) (stante-after em-prompt - (setq eshell-highlight-prompt nil) - (setq eshell-prompt-function 'oni:eshell-prompt) - (setq eshell-prompt-regexp "^[~/].* > ")) + (setq eshell-highlight-prompt nil)) (stante-after em-term (add-to-list 'eshell-visual-commands "unison")) @@ -1287,6 +1273,7 @@ from myaethon2.core.decorators import ( ;;;; Hooks +(add-hook 'eshell-first-time-mode-hook 'oni-eshell-set-prompt) (add-hook 'after-save-hook 'oni:after-save-func t) (add-hook 'before-save-hook 'oni:before-save-func) (add-hook 'css-mode-hook #'rainbow-mode) @@ -1504,6 +1491,7 @@ from myaethon2.core.decorators import ( (windmove-default-keybindings) (load (system-name) :noerror) +(load "site-autoloads") ;;; Test -- cgit v1.2.3-54-g00ecf