unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lekktu@gmail.com>
To: Leo <sdl.web@gmail.com>
Cc: 11606@debbugs.gnu.org
Subject: bug#11606: 24.1; Get rid of buffer local hook variables in find-file.el
Date: Tue, 5 Jun 2012 18:14:13 +0200	[thread overview]
Message-ID: <CAAeL0SSt6s2t7mDHvf8+Qqe-SW=a6VgFQ=P_fDTTFpob6La69g@mail.gmail.com> (raw)
In-Reply-To: <m17gvpxcnv.fsf@gmail.com>

On Sun, Jun 3, 2012 at 6:05 AM, Leo <sdl.web@gmail.com> wrote:

> I was thinking that add-hook supports adding local hooks which might be
> better than making those hooks buffer-local.

Most hooks and hook-like variables can be useful as either global or
buffer-local, and for these (add-hook X Y Z t) or (set
(make-local-variable X) Y) is the way to go.

But there are some hooks that make no sense as global variables, or
are never used that way. For these, being automatically buffer-local
is, in fact, less error prone.

A notable example is revert-buffer-function, which strangely we have
not made automatically-buffer local even when the 31 packages in
lisp/** that assign it do convert it to buffer-local first...

    Juanma





      parent reply	other threads:[~2012-06-05 16:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-02  4:44 bug#11606: 24.1; Get rid of buffer local hook variables in find-file.el Leo
2012-06-02 17:57 ` Stefan Monnier
2012-06-03  2:07   ` Leo
2012-06-03  3:18     ` Stefan Monnier
2012-06-03  4:05       ` Leo
2012-06-03 15:18         ` Stefan Monnier
2012-06-05 16:14         ` Juanma Barranquero [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='CAAeL0SSt6s2t7mDHvf8+Qqe-SW=a6VgFQ=P_fDTTFpob6La69g@mail.gmail.com' \
    --to=lekktu@gmail.com \
    --cc=11606@debbugs.gnu.org \
    --cc=sdl.web@gmail.com \
    /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 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).