Use Cyphejor to rename major mode lighters
Alan Pearce alan.pearce@spotcap.com
Mon, 05 Oct 2015 09:25:12 +0200
2 files changed, 23 insertions(+), 11 deletions(-)
M tag-emacs/emacs.d/Cask → tag-emacs/emacs.d/Cask
@@ -22,6 +22,7 @@ (depends-on "company-go") (depends-on "company-tern") (depends-on "counsel") (depends-on "csv-mode") +(depends-on "cyphejor") (depends-on "dash") (depends-on "dash-functional") (depends-on "deferred")
M tag-emacs/emacs.d/init.org → tag-emacs/emacs.d/init.org
@@ -111,14 +111,6 @@ (setq custom-file "~/.emacs.d/custom.el") (load custom-file :noerror :nomessage) #+END_SRC -* Helpers - I like to rename modeline lighters. This macro works for major modes. -#+BEGIN_SRC emacs-lisp -(defmacro rename-modeline (mode new-name) - `(defadvice ,mode (after rename-modeline activate) - (setq mode-name ,new-name))) -#+END_SRC - * Projects #+BEGIN_SRC emacs-lisp @@ -241,8 +233,7 @@ #+BEGIN_SRC emacs-lisp (req-package magit :defer 5 :commands (magit-status) - :config (progn (rename-modeline magit-status-mode (char-to-string (-find #'char-displayable-p '(11942 5848 177)))) - (setq magit-last-seen-setup-instructions "1.4.0" + :config (progn (setq magit-last-seen-setup-instructions "1.4.0" magit-completing-read-function #'magit-builtin-completing-read magit-wip-after-save-mode t magit-wip-after-apply-mode t @@ -1384,6 +1375,27 @@ (buffer-name) "%b")))) #+END_SRC +** Renaming major modes + +Diminishing major modes does not happen in the same manner as minor +modes. + +#+BEGIN_SRC emacs-lisp + (req-package cyphejor + :init (progn + (setq cyphejor-rules `(("emacs" "ε") + ("diff" "Δ") + ("js2" "js") + ("magit-status" ,(char-to-string (-find #'char-displayable-p '(11942 5848 177)))) + ("inferior" "i" :prefix) + ("interaction" "i" :prefix) + ("interactive" "i" :prefix) + ("menu" "▤" :postfix) + ("mode" "") + ("shell" "sh" :postfix))) + (cyphejor-mode 1))) +#+END_SRC + * Modes Setup some modes for systemd files @@ -1739,7 +1751,6 @@ Customise the modeline-display of =emacs-lisp-mode=. Then make sure it runs the common lisp hooks. #+BEGIN_SRC emacs-lisp -(rename-modeline emacs-lisp-mode "ξ") (add-to-list 'auto-mode-alist '("/Cask\\'" . emacs-lisp-mode)) (add-hook 'emacs-lisp-mode-hook #'ap/lisp-setup) (add-hook 'emacs-lisp-mode-hook #'eldoc-mode)