Quick Access to

.dotfiles in Emacs

For those moments when you want fast access to “~/.something” – what nicer than M-x .thatsomething

(defmacro dotfile (filename)
  "Define the function `filename' to edit the dotfile in question"
  (let ((filestr (symbol-name filename)))
    `(progn
       (defun ,(intern filestr) ()
         ,(format "Open %s for editing" filestr)
         (interactive)
         (find-file ,(concat "~/" filestr))))))

With which we can define a M-x .emacs function with:

(dotfile .emacs)

Love regards etc

Tags: , , ,

Leave a Reply