GNU bug report logs - #19324
25.0.50; add-function and nil

Previous Next

Package: emacs;

Reported by: Leo Liu <sdl.web <at> gmail.com>

Date: Tue, 9 Dec 2014 04:56:02 UTC

Severity: normal

Found in version 25.0.50

Done: Leo Liu <sdl.web <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Leo Liu <sdl.web <at> gmail.com>
Subject: bug#19324: closed (Re: bug#19324: 25.0.50; add-function and nil)
Date: Fri, 12 Dec 2014 00:45:03 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#19324: 25.0.50; add-function and nil

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 19324 <at> debbugs.gnu.org.

-- 
19324: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19324
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Leo Liu <sdl.web <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 19324-done <at> debbugs.gnu.org
Subject: Re: bug#19324: 25.0.50; add-function and nil
Date: Fri, 12 Dec 2014 08:44:11 +0800
On 2014-12-11 14:11 -0500, Stefan Monnier wrote:
> No I don't have a fix for this.
> `add-function' is designed to work on places that only hold functions,
> so any other value (such as nil) will create problems.
>
> IOW a variable that can hold "either nil or a function" is not something
> that add-function supports.
>
> I guess we could treat nil as an alias for `ignore' in the "proxy
> function", which would fix this particular issue.  See patch below.
> But I don't intend to handle all the cases in which a "nil function" can
> show up.  Many/most uses of `foo-function' actually give a special
> meaning to nil which is different from `ignore'.
> So I'm not sure we should cater to this particular case.

Thanks, Stefan, for the explanation. In that case maybe the workaround
isn't needed because we still cannot tell if ORIG is missing. I consider
the bug closed.

Leo

[Message part 3 (message/rfc822, inline)]
From: Leo Liu <sdl.web <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.50; add-function and nil
Date: Tue, 09 Dec 2014 12:55:22 +0800
1. Goto a buffer (e.g. text-mode) with eldoc-documentation-function nil
2. (add-function :after-until (local 'eldoc-documentation-function) #'ignore)
3. Move around to trigger eldoc error: (void-function nil)

Looks like the orig function is unconditionally called without checking
it's a function object.

Leo



This bug report was last modified 10 years and 168 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.