unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 53632@debbugs.gnu.org
Subject: bug#53632: Function definition history
Date: Sun, 30 Jan 2022 09:43:12 +0200	[thread overview]
Message-ID: <831r0pbre7.fsf@gnu.org> (raw)
In-Reply-To: <jwvy22xbyky.fsf@iro.umontreal.ca> (bug-gnu-emacs@gnu.org)

> Date: Sun, 30 Jan 2022 00:07:57 -0500
> From:  Stefan Monnier via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> I suggest to replace that info with something slightly more complete.
> In the patch below I store the history of the function definition of
> a symbol in its `function-history` symbol property.  This history is
> stored as a list of the form (... VAL(n+1) FILE(n+1) VALn FILEn ...)
> where VALn is the value set by FILEn.  To make this list cheap in the
> default case, the latest value is not stored in the list (since it's in
> the `symbol-function`) and neither is the first file.  So if there's
> only been a single definition (the most common case), the list is empty
> and the property is just not present at all.  If a function was first
> defined as an autoload and then overriden by the actual function
> definition, then the list will hold (FILE2 AUTOLOAD), i.e. the name of
> the file that provided the actual function definition and the autoload
> that was used before that.
> [ Note: the name of the file that provided the first definition can be
>   recovered if really needed by checking all entries in `load-history`.
>   In the patch below I have not needed it.  ]
> 
> This makes it possible to handle correctly things like unloading
> `cl-loaddefs.el` which should remove the autoloads that are still
> autoloads and leave untouched the functions whose autoload have been
> replaced by the actual function definition.
> 
> In my tests it increased the size of the .pdmp by about 2KB (on a 32bit
> build).
> 
> The patch also gets rid of the `autoload` vs `defun` distinction in
> `load-history` which seems unnecessary (a significant part of the
> motivation for this patch was to get rid of the special handling of
> autoloads in this part of the code).  At least I couldn't find any place
> in the code which took advantage of that distinction.
> 
> Comments?  Objections?

Please make sure to document this in the ELisp manual.





  reply	other threads:[~2022-01-30  7:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-30  5:07 bug#53632: Function definition history Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-30  7:43 ` Eli Zaretskii [this message]
2022-01-31 16:07   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-30 16:16 ` Lars Ingebrigtsen
     [not found] ` <handler.53632.D53632.164364529324455.notifdone@debbugs.gnu.org>
2022-02-02 16:21   ` Glenn Morris
2022-02-03  8:11     ` Michael Albinus
2022-02-04 16:30       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-04 17:00         ` Michael Albinus
2022-02-04 17:14           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-04 17:43             ` Michael Albinus
2022-02-04 19:43               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-05 10:42                 ` Michael Albinus
2022-02-05 17:40                   ` Glenn Morris
2022-02-05 18:21                     ` Michael Albinus

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=831r0pbre7.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=53632@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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).