GNU bug report logs - #18203
24.4.50; `ffap-url-p' should NOT be a defsubst

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Tue, 5 Aug 2014 20:23:01 UTC

Severity: wishlist

Tags: fixed

Found in version 24.4.50

Fixed in version 26.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #15 received at 18203 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 18203 <at> debbugs.gnu.org
Subject: RE: bug#18203: 24.4.50; `ffap-url-p' should NOT be a defsubst
Date: Fri, 25 Dec 2015 14:44:16 -0800 (PST)
> > There is NO reason for this to be a defsubst.  There is no reason for
> > users not to take advantage of this function generally.
> 
> I changed it to a defun,

Thank you.

> but I don't know what you mean by "There is no
> reason for users not to take advantage of this function generally.".
> You can use a defsubst just as you would a defun.

No, you cannot.

If existing code invokes a defsubst and you have only the compiled
version of that code, then you have no access to the function
defined by that defsubst.  The function _does not exist_ at runtime.
You cannot advise it or debug it, and redefining it has no effect.

Taking advantage of the function _"generally"_ includes having it
available at runtime - it requires its existence _as a function_.

`defsubst's are almost a misfeature nowadays.  In any case, they
be used should rarely, and only with good justification.




This bug report was last modified 8 years and 232 days ago.

Previous Next


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