Emacs Lisp Programming

If you ever happen to write code using emacs, and also happen to write Emacs Lisp code to enhance the way you write code with emacs, here is a good place to start with.

I strongly advise people to get the corresponding info document and open it using, of course, emacs. It however may not seem so straight forward, either if your emacs version is quite old, or if like me, you have a huge prolusion in your ~/.emac.d folder.

First of all, the document may be opened in Fundamental mode instead of the great Info mode.

Here is how to remedy this.

;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Auto Info mode
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun info-mode ()
  (let ((file-name (buffer-file-name)))
    (kill-buffer (current-buffer))
    (info file-name)))

(add-to-list 'auto-mode-alist '("\\.info\\'" . info-mode))

Second, if you ever happen to use YaSnippets, disable it for this info mode like so:

(add-hook 'info-mode-hook (lambda()
  (setq yas-dont-activate t)))

Finally, M-x describe-mode tells you all about the info mode and how to extremely fast navigate within this excellent document.

Leave a Reply

Your email address will not be published. Required fields are marked *