unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* lisp-mode and buffer local variables
@ 2011-06-08 21:47 Nikodemus Siivola
  2011-06-08 22:36 ` Leo
  0 siblings, 1 reply; 5+ messages in thread
From: Nikodemus Siivola @ 2011-06-08 21:47 UTC (permalink / raw)
  To: emacs-devel

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-06-09 15:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-08 21:47 lisp-mode and buffer local variables Nikodemus Siivola
2011-06-08 22:36 ` Leo
2011-06-09  4:20   ` Stefan Monnier
2011-06-09 11:18     ` Nikodemus Siivola
2011-06-09 15:17       ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).