emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lisp-mode and buffer local variables


From: Nikodemus Siivola
Subject: lisp-mode and buffer local variables
Date: Thu, 9 Jun 2011 00:47:43 +0300

I'm working on styles for Common Lisp indentation in my cl-indent.el
fork. The intention is to use a buffer local variable
common-lisp-style to set things up:

;; -*- common-lisp-style: foo -*-

However, lisp-mode kills all buffer local variables, and I'm uncertain
how to best deal with this. As a somewhat terrible workaround I
currently add a lisp-mode-hook:

;;; `lisp-mode' kills all buffer-local variables. Get them back, and magically
;;; use the right indentation function.
;;;
;;; FIXME: there has got to be a better way to do this for Common Lisp files
;;; only, without requiring .emacs customizations.
(add-hook 'lisp-mode-hook
          (lambda ()
            (hack-local-variables)
            (when common-lisp-style
              (set (make-local-variable 'lisp-indent-function)
                   'common-lisp-indent-function)
              (common-lisp-set-style (symbol-name common-lisp-style)))))

This, however seems pretty intrusive. ...what should I be doing instead?

Cheers,

 -- nikodemus



reply via email to

[Prev in Thread] Current Thread [Next in Thread]