What the .emacs.d!?

I already covered the awesomely commented diminish.el. Here's another trick to reduce the cruft in your modeline:

(defmacro rename-modeline (package-name mode new-name)
  `(eval-after-load ,package-name
     '(defadvice ,mode (after rename-modeline activate)
        (setq mode-name ,new-name))))

(rename-modeline "js2-mode" js2-mode "JS2")
(rename-modeline "clojure-mode" clojure-mode "Clj")

With this, I reduce the js2-mode modeline lighter from "JavaScript IDE" to just "JS2".

I stole it from Bodil's .emacs.d and macroified it a little. The first argument is the package name, the second is the mode in question, and the third is the new lighter for the mode.

blog comments powered by Disqus