Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

bug#5026: 23.1; add-hook buffer local vs single func

0 views
Skip to first unread message

Stefan Monnier

unread,
Nov 23, 2009, 8:43:01 PM11/23/09
to Kevin Ryde, bug-gn...@gnu.org, 50...@emacsbugs.donarmstrong.com
> I suspect it's run-hooks which should be blamed rather than add-hook.
> Should run-hooks allow a single-function global value when it follows a
> `t' from a local value?

Actually, I think that run-hooks, add-hook and friends should throw at
least warnings when faced with this kind of obsolete "single
function" use.


Stefan

Stefan Monnier

unread,
Nov 23, 2009, 8:43:01 PM11/23/09
to Kevin Ryde, bug-gn...@gnu.org, 50...@emacsbugs.donarmstrong.com

Kevin Ryde

unread,
Nov 26, 2009, 7:34:52 PM11/26/09
to Stefan Monnier, 50...@emacsbugs.donarmstrong.com
Stefan Monnier <mon...@iro.umontreal.ca> writes:
>
> Actually, I think that run-hooks, add-hook and friends should throw at
> least warnings when faced with this kind of obsolete "single
> function" use.

No need to actively take it away is there? Warnings could only blast
users who had old but otherwise perfectly good setq's in their .emacs,
couldn't it?

Stefan Monnier

unread,
Nov 26, 2009, 11:16:37 PM11/26/09
to Kevin Ryde, 50...@emacsbugs.donarmstrong.com
>> Actually, I think that run-hooks, add-hook and friends should throw at
>> least warnings when faced with this kind of obsolete "single
>> function" use.
> No need to actively take it away is there?

It would be good to get rid of it, yes. It has various misfeatures.


Stefan

Richard Stallman

unread,
Nov 27, 2009, 10:10:12 PM11/27/09
to Stefan Monnier, 50...@emacsbugs.donarmstrong.com, use...@zip.com.au, 50...@emacsbugs.donarmstrong.com
It would be interesting for some users to install code to warn very
visibly when the old usage occurs. Then we will see if there are
really any widely used packages which have the problem. Maybe we will
see that it is painless to eliminate that usage now.

Kevin Ryde

unread,
Dec 27, 2009, 5:48:46 PM12/27/09
to Stefan Monnier, 50...@emacsbugs.donarmstrong.com
Stefan Monnier <mon...@iro.umontreal.ca> writes:
>
> It has various misfeatures.

Such as? Surely a single function is unambiguous, and needs only a
little care from run-hooks and friends to remain compatible.

(A little care of course always being better than sending thousands of
people for a ride on the rolling-incompatibility treadmill!)


Kevin Ryde

unread,
Dec 29, 2009, 6:54:15 PM12/29/09
to r...@gnu.org, 50...@emacsbugs.donarmstrong.com
Richard Stallman <r...@gnu.org> writes:
>
> It would be interesting for some users to install code to warn very
> visibly when the old usage occurs. Then we will see if there are
> really any widely used packages which have the problem.

One in particular I think is fill-nobreak-predicate. It was a single
function in Emacs 21, later became a hook. Anyone who followed the
advice of the time to set it to a predicate has had it working fine with
the hook, but taking away the single-function feature of hooks would I
believe break that. :-(


Stefan Monnier

unread,
Dec 29, 2009, 10:50:48 AM12/29/09
to Kevin Ryde, 50...@emacsbugs.donarmstrong.com
> (A little care of course always being better than sending thousands of
> people for a ride on the rolling-incompatibility treadmill!)

For the long term maintainability of the code, adding more quirks into
the code for the sake of a few users who can fix their problems easily
is not such a hot idea either.
The key here is "fix ... easily", which can be done by adding code that
detects the problem and warns the user about it.


Stefan


Stefan Monnier

unread,
Dec 29, 2009, 10:50:48 AM12/29/09
to Kevin Ryde, 50...@emacsbugs.donarmstrong.com

Stefan Monnier

unread,
Dec 29, 2009, 10:50:48 AM12/29/09
to Kevin Ryde, 50...@emacsbugs.donarmstrong.com

Emacs bug Tracking System

unread,
Jan 1, 2010, 12:17:01 PM1/1/10
to Chong Yidong, emacs-bu...@debbugs.gnu.org
Your message dated Fri, 01 Jan 2010 12:16:30 -0500
with message-id <87ljghg...@stupidchicken.com>
and subject line Re: bug#5026: 23.1; add-hook buffer local vs single func
has caused the Emacs bug report #5026,
regarding 23.1; add-hook buffer local vs single func
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact bug-gn...@gnu.org
immediately.)


--
5026: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=5026
Emacs Bug Tracking System
Contact bug-gn...@gnu.org with problems

Kevin Ryde

unread,
Jan 2, 2010, 4:17:39 PM1/2/10
to Chong Yidong, 50...@emacsbugs.donarmstrong.com
Chong Yidong <c...@stupidchicken.com> writes:
>
> Still, as long as we're still supporting the obsolete format, it's easy
> enough to fix run-hooks to recognize it; I've checked in such a fix.

Good stuff.

As an idea, maybe the bit of add-hook that upgrades a single func to a
list could be split out and forcibly applied in places that care, like
customize or whatever. I wouldn't mind if even run-hooks upgraded the
value. This could preserve compatibility for now, and be a half step
towards breaking compatibility later.


0 new messages