unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lekktu@gmail.com>
To: Kevin Ryde <user42@zip.com.au>
Cc: 5293@debbugs.gnu.org
Subject: bug#5293: 23.1; unload-feature on buffer-local hooks
Date: Fri, 15 Jul 2011 02:34:29 +0200	[thread overview]
Message-ID: <CAAeL0SRwni8KP0CAfw2-bM5Kpa7teSQ44opxWKTKhmxS-wrD-Q@mail.gmail.com> (raw)
In-Reply-To: <871uxsl778.fsf@blah.blah>

On Fri, Jul 15, 2011 at 02:26, Kevin Ryde <user42@zip.com.au> wrote:

> Or conversely, it's undesirable to leave behind an unbound func in a
> hook, and the same undesirability as to a buffer-local value as a global
> value.

But the usual case is that these buffer-local values are set via major
modes also defined in the same package, and so they are automatically
removed when the major modes are disabled (i.e., when the buffers are
switched to other major modes). The only case where a buffer-local
value is left behind is when the package's code sets it in
non-standard ways, and in this case, it's the package responsability
to define a FEATURE-unload-function to undo the changes.

The philosophy behind unload-feature is: we try to automatically undo
the easy/standard things, and give the package the opportunity to undo
the hard/unstandard things itself. And I think it's the right
approach.

    Juanma





  reply	other threads:[~2011-07-15  0:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-02 21:06 bug#5293: 23.1; unload-feature on buffer-local hooks Kevin Ryde
2010-01-02 23:14 ` Juanma Barranquero
2011-07-13 20:28 ` Juanma Barranquero
2011-07-15  0:26   ` Kevin Ryde
2011-07-15  0:34     ` Juanma Barranquero [this message]
2011-07-15  8:52       ` Štěpán Němec
2011-07-15 11:24         ` Juanma Barranquero
2011-07-15 16:08           ` Štěpán Němec
2011-07-15 16:20             ` Juanma Barranquero
2011-07-16 18:50     ` Stefan Monnier
2011-08-06  1:20       ` Kevin Ryde
2020-04-06 17:24         ` Štěpán Němec
2020-04-06 18:06           ` Stefan Monnier
2020-04-06 19:17             ` Štěpán Němec
2020-09-30 18:44               ` Lars Ingebrigtsen
2020-10-20 10:20                 ` Štěpán Němec
2020-10-20 11:13                   ` Lars Ingebrigtsen
2020-10-21 17:00                     ` Štěpán Němec
2020-04-06 20:39           ` Juanma Barranquero
2020-04-06 21:27             ` Štěpán Němec
2020-04-06 23:01               ` Juanma Barranquero

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=CAAeL0SRwni8KP0CAfw2-bM5Kpa7teSQ44opxWKTKhmxS-wrD-Q@mail.gmail.com \
    --to=lekktu@gmail.com \
    --cc=5293@debbugs.gnu.org \
    --cc=user42@zip.com.au \
    /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).