summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2014-04-26 13:00:58 +0100
committerAlan Pearce2014-04-26 13:00:58 +0100
commita5126cbcea58fd3d424605a8256490a1ea263e50 (patch)
tree7cd425810029edff1e2562a266e36a0a0405039f
parentd7a6317804a6445846ea15d886161b593d7da94a (diff)
downloaddotfiles-a5126cbcea58fd3d424605a8256490a1ea263e50.tar.lz
dotfiles-a5126cbcea58fd3d424605a8256490a1ea263e50.tar.zst
dotfiles-a5126cbcea58fd3d424605a8256490a1ea263e50.zip
Emacs: add helper macro for renaming major modes
-rw-r--r--tag-emacs/emacs.d/init.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/tag-emacs/emacs.d/init.el b/tag-emacs/emacs.d/init.el
index c693a47..c0134ee 100644
--- a/tag-emacs/emacs.d/init.el
+++ b/tag-emacs/emacs.d/init.el
@@ -11,6 +11,12 @@
 
 (load custom-file :noerror)
 
+;;;; Helper Macros
+(defmacro rename-modeline (package-name mode new-name)
+  `(eval-after-load ,package-name
+     '(defadvice ,mode (after rename-modeline activate)
+        (setq mode-name ,new-name))))
+
 ;;; Allow lisps to use a common setup. I don't know why they don't have some lispy mode as their parent, but this is close enough
 (defcustom lisp-common-mode-hook nil
   "Hook run when entering any Lisp mode."