all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nikodemus Siivola <nikodemus@random-state.net>
To: emacs-devel@gnu.org
Subject: lisp-mode and buffer local variables
Date: Thu, 9 Jun 2011 00:47:43 +0300	[thread overview]
Message-ID: <BANLkTiniMvTM57+fQDDv5j+KYboVNab6vQ@mail.gmail.com> (raw)

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	other threads:[~2011-06-08 21:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-08 21:47 Nikodemus Siivola [this message]
2011-06-08 22:36 ` lisp-mode and buffer local variables Leo
2011-06-09  4:20   ` Stefan Monnier
2011-06-09 11:18     ` Nikodemus Siivola
2011-06-09 15:17       ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BANLkTiniMvTM57+fQDDv5j+KYboVNab6vQ@mail.gmail.com \
    --to=nikodemus@random-state.net \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.