GNU bug report logs - #4473
after-load-functions: files are not absolute, some are missed

Previous Next

Package: emacs;

Reported by: Glenn Morris <rgm <at> gnu.org>

Date: Thu, 17 Sep 2009 23:10:15 UTC

Severity: normal

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 4473 in the body.
You can then email your comments to 4473 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4473; Package emacs. (Thu, 17 Sep 2009 23:10:16 GMT) Full text and rfc822 format available.

Message #3 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: bug-gnu-emacs <at> gnu.org
Subject: after-load-functions: files are not absolute, some are missed
Date: Thu, 17 Sep 2009 19:02:51 -0400
In the current CVS trunk, I found myself having a (slight) need for a
list of the dumped lisp files. I thought a simple patch like the
following would work, but it has some problems:

i) the file names stored are not absolute, though the doc of
after-load-functions says they should be. (It's actually better in
this case that they are non-absolute, but it conflicts with the doc.)

ii) some files are missing. It turns out it is the non-compiled ones
loaded after the setting of load-source-file-function. If this is
non-nil, looks like Fload returns before running `after-load-functions'?


*** loadup.el	15 Sep 2009 03:46:08 -0000	1.184
--- loadup.el	17 Sep 2009 22:57:00 -0000
***************
*** 64,69 ****
--- 64,79 ----
  ;; implemented in subr.el.
  (add-hook 'after-load-functions '(lambda (f) (garbage-collect)))
  
+ (defvar dumped-lisp-files nil
+   "List of Lisp files dumped with (i.e., compiled into) this Emacs.")
+ 
+ (or dumped-lisp-files
+     (progn
+       (setq dumped-lisp-files '("subr" "emacs-lisp/backquote"
+                                 "emacs-lisp/byte-run"))
+       (add-hook 'after-load-functions
+                 '(lambda (f) (add-to-list 'dumped-lisp-files f)))))
+ 
  ;; We specify .el in case someone compiled version.el by mistake.
  (load "version.el")
  
***************
*** 318,323 ****
--- 328,335 ----
  	(equal (nth 4 command-line-args) "bootstrap"))
      (setcdr load-path nil))
  
+ (remove-hook 'after-load-functions
+              '(lambda (f) (add-to-list 'dumped-lisp-files f)))
  (remove-hook 'after-load-functions '(lambda (f) (garbage-collect)))
  
  (setq inhibit-load-charset-map nil)




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4473; Package emacs. (Thu, 17 Sep 2009 23:45:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juanma Barranquero <lekktu <at> gmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Thu, 17 Sep 2009 23:45:04 GMT) Full text and rfc822 format available.

Message #8 received at 4473 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 4473 <at> debbugs.gnu.org
Subject: Re: bug#4473: after-load-functions: files are not absolute, some are 
	missed
Date: Fri, 18 Sep 2009 01:38:42 +0200
On Fri, Sep 18, 2009 at 01:02, Glenn Morris <rgm <at> gnu.org> wrote:

> ii) some files are missing. It turns out it is the non-compiled ones
> loaded after the setting of load-source-file-function. If this is
> non-nil, looks like Fload returns before running `after-load-functions'?

Stefan changed Fload so it now always calls do-after-load-evaluation,
even while dumping Emacs.

However, load-with-code-conversion (used for source files) still skips it:

      (unless purify-flag
 	(do-after-load-evaluation fullname))

    Juanma



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4473; Package emacs. (Fri, 18 Sep 2009 00:20:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juanma Barranquero <lekktu <at> gmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Fri, 18 Sep 2009 00:20:03 GMT) Full text and rfc822 format available.

Message #13 received at 4473 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 4473 <at> debbugs.gnu.org
Subject: Re: bug#4473: after-load-functions: files are not absolute, some are 
	missed
Date: Fri, 18 Sep 2009 02:11:50 +0200
On Fri, Sep 18, 2009 at 01:02, Glenn Morris <rgm <at> gnu.org> wrote:
>
> In the current CVS trunk, I found myself having a (slight) need for a
> list of the dumped lisp files. I thought a simple patch like the
> following would work, but it has some problems:

BTW, doesn't the patch below work for you? On my Emacs, this results in

("tooltip.elc" "ediff-hook.elc" "vc-hooks.elc"
"emacs-lisp/float-sup.elc" "mwheel.elc" "w32-fns.elc" "dos-w32.elc"
"disp-table.elc" "ls-lisp.elc" "term/w32-win.elc"
"term/common-win.elc" "w32-vars.elc" "tool-bar.elc" "dnd.elc"
"international/fontset.elc" "image.elc" "fringe.elc" "buff-menu.elc"
"replace.elc" "textmodes/fill.elc" "textmodes/text-mode.elc"
"emacs-lisp/lisp-mode.elc" "textmodes/paragraphs.elc" "register.elc"
"textmodes/page.elc" "emacs-lisp/lisp.elc" "paths.el" "menu-bar.elc"
"rfn-eshadow.elc" "isearch.elc" "emacs-lisp/timer.elc" "select.elc"
"scroll-bar.elc" "mouse.elc" "jit-lock.elc" "font-lock.elc"
"emacs-lisp/syntax.elc" "facemenu.elc" "font-core.elc"
"term/tty-colors.elc" "frame.elc" "window.elc" "indent.elc"
"language/cham.el" "language/burmese.el" "language/khmer.el"
"language/georgian.el" "language/utf-8-lang.el"
"language/misc-lang.el" "language/vietnamese.elc"
"language/tibetan.elc" "language/thai.el" "language/tai-viet.el"
"language/lao.el" "language/korean.el" "language/japanese.el"
"international/eucjp-ms.el" "international/cp51932.el"
"language/hebrew.el" "language/greek.el" "language/romanian.el"
"language/slovak.el" "language/czech.el" "language/european.elc"
"language/ethiopic.elc" "language/english.el" "language/sinhala.el"
"language/indian.elc" "language/cyrillic.elc" "language/chinese.elc"
"international/charprop.el" "composite.elc"
"international/characters.elc" "case-table.elc"
"international/mule-cmds.elc" "epa-hook.elc" "jka-cmpr-hook.elc"
"help.elc" "simple.elc" "abbrev.elc" "loaddefs.el" "startup.elc"
"button.elc" "minibuffer.elc" "faces.elc" "cus-face.elc" "files.elc"
"bindings.elc" "format.elc" "env.elc" "international/mule-conf.el"
"international/mule.elc" "cus-start.elc" "emacs-lisp/map-ynp.elc"
"custom.elc" "widget.elc" "version.el" "subr.elc"
"emacs-lisp/backquote.elc" "emacs-lisp/byte-run.elc")

which seems about right.

    Juanma


Index: lisp/loadup.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/loadup.el,v
retrieving revision 1.184
diff -u -2 -r1.184 loadup.el
--- lisp/loadup.el	15 Sep 2009 03:46:08 -0000	1.184
+++ lisp/loadup.el	18 Sep 2009 00:06:20 -0000
@@ -65,4 +65,7 @@
 (add-hook 'after-load-functions '(lambda (f) (garbage-collect)))

+(defvar dumped-lisp-files nil
+  "List of Lisp files dumped with (i.e., compiled into) this Emacs.")
+
 ;; We specify .el in case someone compiled version.el by mistake.
 (load "version.el")
@@ -319,4 +322,7 @@
     (setcdr load-path nil))

+(or dumped-lisp-files
+    (setq dumped-lisp-files (mapcar 'car load-history)))
+
 (remove-hook 'after-load-functions '(lambda (f) (garbage-collect)))



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4473; Package emacs. (Fri, 18 Sep 2009 00:25:08 GMT) Full text and rfc822 format available.

Message #16 received at 4473 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 4473 <at> debbugs.gnu.org
Subject: Re: bug#4473: after-load-functions: files are not absolute, some are  missed
Date: Thu, 17 Sep 2009 20:19:41 -0400
Juanma Barranquero wrote:

> BTW, doesn't the patch below work for you?

D'oh, yes it does. Worth committing?



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4473; Package emacs. (Fri, 18 Sep 2009 00:35:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juanma Barranquero <lekktu <at> gmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Fri, 18 Sep 2009 00:35:07 GMT) Full text and rfc822 format available.

Message #21 received at 4473 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 4473 <at> debbugs.gnu.org
Subject: Re: bug#4473: after-load-functions: files are not absolute, some are 
	missed
Date: Fri, 18 Sep 2009 02:28:53 +0200
On Fri, Sep 18, 2009 at 02:19, Glenn Morris <rgm <at> gnu.org> wrote:

> D'oh, yes it does. Worth committing?

If you have a use for it, I suppose so.

    Juanma



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4473; Package emacs. (Fri, 18 Sep 2009 03:15:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juanma Barranquero <lekktu <at> gmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Fri, 18 Sep 2009 03:15:05 GMT) Full text and rfc822 format available.

Message #26 received at 4473 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 4473 <at> debbugs.gnu.org
Subject: Re: bug#4473: after-load-functions: files are not absolute, some are 
	missed
Date: Fri, 18 Sep 2009 05:05:16 +0200
On Fri, Sep 18, 2009 at 02:28, Juanma Barranquero <lekktu <at> gmail.com> wrote:

>> D'oh, yes it does. Worth committing?

Easier still :-)

preloaded-file-list is a variable defined in `lread.c'.
Its value is
("tooltip"  ... "loadup.el")

Documentation:
List of files that were preloaded (when dumping Emacs).

    Juanma



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4473; Package emacs. (Fri, 18 Sep 2009 03:20:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Fri, 18 Sep 2009 03:20:05 GMT) Full text and rfc822 format available.

Message #31 received at 4473 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 4473 <at> debbugs.gnu.org, Juanma Barranquero <lekktu <at> gmail.com>
Subject: Re: bug#4473: after-load-functions: files are not absolute, some are  missed
Date: Thu, 17 Sep 2009 23:13:33 -0400
>> BTW, doesn't the patch below work for you?

> D'oh, yes it does. Worth committing?

Why not just use preloaded-file-list?


        Stefan




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4473; Package emacs. (Fri, 18 Sep 2009 03:25:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juanma Barranquero <lekktu <at> gmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Fri, 18 Sep 2009 03:25:06 GMT) Full text and rfc822 format available.

Message #36 received at 4473 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Glenn Morris <rgm <at> gnu.org>, 4473 <at> debbugs.gnu.org
Subject: Re: bug#4473: after-load-functions: files are not absolute, some are 
	missed
Date: Fri, 18 Sep 2009 05:16:36 +0200
On Fri, Sep 18, 2009 at 05:13, Stefan Monnier <monnier <at> iro.umontreal.ca> wrote:

> Why not just use preloaded-file-list?

Because Glenn and I had not discovered it yet :-)

    Juanma



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4473; Package emacs. (Fri, 18 Sep 2009 03:25:09 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juanma Barranquero <lekktu <at> gmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Fri, 18 Sep 2009 03:25:10 GMT) Full text and rfc822 format available.

Message #41 received at 4473 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 4473 <at> debbugs.gnu.org
Subject: Re: bug#4473: after-load-functions: files are not absolute, some are 
	missed
Date: Fri, 18 Sep 2009 05:18:17 +0200
On Fri, Sep 18, 2009 at 01:02, Glenn Morris <rgm <at> gnu.org> wrote:

> i) the file names stored are not absolute, though the doc of
> after-load-functions says they should be. (It's actually better in
> this case that they are non-absolute, but it conflicts with the doc.)

From the docstring of `load-history':

  During preloading, the file name recorded is relative to the main Lisp
  directory.  These file names are converted to absolute at startup.

So perhaps the docstring of `after-load-functions' should be fixed to
note this discrepancy.

    Juanma



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4473; Package emacs. (Fri, 18 Sep 2009 06:30:03 GMT) Full text and rfc822 format available.

Message #44 received at 4473 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 4473 <at> debbugs.gnu.org
Subject: Re: bug#4473: after-load-functions: files are not absolute, some are  missed
Date: Fri, 18 Sep 2009 02:22:24 -0400
Juanma Barranquero wrote:

> preloaded-file-list is a variable defined in `lread.c'.

Double d'oh! Thanks...



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4473; Package emacs. (Fri, 18 Sep 2009 06:30:05 GMT) Full text and rfc822 format available.

Message #47 received at 4473 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 4473 <at> debbugs.gnu.org, Juanma Barranquero <lekktu <at> gmail.com>
Subject: Re: bug#4473: after-load-functions: files are not absolute, some are  missed
Date: Fri, 18 Sep 2009 02:23:38 -0400
Stefan Monnier wrote:

> Why not just use preloaded-file-list?

The usual reason - stupidity. :(



Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Fri, 18 Sep 2009 06:30:07 GMT) Full text and rfc822 format available.

Notification sent to Glenn Morris <rgm <at> gnu.org>:
bug acknowledged by developer. (Fri, 18 Sep 2009 06:30:07 GMT) Full text and rfc822 format available.

Message #52 received at 4473-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 4473-done <at> debbugs.gnu.org
Subject: Re: bug#4473: after-load-functions: files are not absolute, some are  missed
Date: Fri, 18 Sep 2009 02:25:23 -0400
Juanma Barranquero wrote:

>   During preloading, the file name recorded is relative to the main Lisp
>   directory.  These file names are converted to absolute at startup.
>
> So perhaps the docstring of `after-load-functions' should be fixed to
> note this discrepancy.

Bah, it's a fairly obscure use case, that turns out not to even be
necessary in this case. So probably not worth mentioning.

Thanks for setting me straight.



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4473; Package emacs. (Fri, 18 Sep 2009 09:15:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Eli Zaretskii <eliz <at> gnu.org>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Fri, 18 Sep 2009 09:15:08 GMT) Full text and rfc822 format available.

Message #57 received at 4473 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>, 4473 <at> debbugs.gnu.org
Cc: monnier <at> iro.umontreal.ca, lekktu <at> gmail.com
Subject: Re: bug#4473: after-load-functions: files are not absolute,	some are  missed
Date: Fri, 18 Sep 2009 12:10:20 +0300
> From: Glenn Morris <rgm <at> gnu.org>
> Date: Fri, 18 Sep 2009 02:23:38 -0400
> Cc: 4473 <at> emacsbugs.donarmstrong.com, Juanma Barranquero <lekktu <at> gmail.com>
> 
> Stefan Monnier wrote:
> 
> > Why not just use preloaded-file-list?
> 
> The usual reason - stupidity. :(

I'd say there could be another one: that it isn't documented in the
ELisp manual.



bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> emacsbugs.donarmstrong.com. (Fri, 16 Oct 2009 14:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 15 years and 245 days ago.

Previous Next


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