unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#4473: after-load-functions: files are not absolute, some are missed
@ 2009-09-17 23:02 ` Glenn Morris
  2009-09-17 23:38   ` Juanma Barranquero
                     ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Glenn Morris @ 2009-09-17 23:02 UTC (permalink / raw)
  To: bug-gnu-emacs


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)






^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#4473: after-load-functions: files are not absolute, some are  missed
  2009-09-17 23:02 ` bug#4473: after-load-functions: files are not absolute, some are missed Glenn Morris
@ 2009-09-17 23:38   ` Juanma Barranquero
  2009-09-18  0:11   ` Juanma Barranquero
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 13+ messages in thread
From: Juanma Barranquero @ 2009-09-17 23:38 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 4473

On Fri, Sep 18, 2009 at 01:02, Glenn Morris <rgm@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





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#4473: after-load-functions: files are not absolute, some are  missed
  2009-09-17 23:02 ` bug#4473: after-load-functions: files are not absolute, some are missed Glenn Morris
  2009-09-17 23:38   ` Juanma Barranquero
@ 2009-09-18  0:11   ` Juanma Barranquero
  2009-09-18  0:19     ` Glenn Morris
  2009-09-18  3:18   ` Juanma Barranquero
  2009-09-18  6:30   ` bug#4473: marked as done (after-load-functions: files are not absolute, some are missed) Emacs bug Tracking System
  3 siblings, 1 reply; 13+ messages in thread
From: Juanma Barranquero @ 2009-09-18  0:11 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 4473

On Fri, Sep 18, 2009 at 01:02, Glenn Morris <rgm@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)))





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#4473: after-load-functions: files are not absolute, some are  missed
  2009-09-18  0:11   ` Juanma Barranquero
@ 2009-09-18  0:19     ` Glenn Morris
  2009-09-18  0:28       ` Juanma Barranquero
  2009-09-18  3:13       ` Stefan Monnier
  0 siblings, 2 replies; 13+ messages in thread
From: Glenn Morris @ 2009-09-18  0:19 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: 4473

Juanma Barranquero wrote:

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

D'oh, yes it does. Worth committing?





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#4473: after-load-functions: files are not absolute, some are  missed
  2009-09-18  0:19     ` Glenn Morris
@ 2009-09-18  0:28       ` Juanma Barranquero
  2009-09-18  3:05         ` Juanma Barranquero
  2009-09-18  3:13       ` Stefan Monnier
  1 sibling, 1 reply; 13+ messages in thread
From: Juanma Barranquero @ 2009-09-18  0:28 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 4473

On Fri, Sep 18, 2009 at 02:19, Glenn Morris <rgm@gnu.org> wrote:

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

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

    Juanma





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#4473: after-load-functions: files are not absolute, some are  missed
  2009-09-18  0:28       ` Juanma Barranquero
@ 2009-09-18  3:05         ` Juanma Barranquero
  2009-09-18  6:22           ` Glenn Morris
  0 siblings, 1 reply; 13+ messages in thread
From: Juanma Barranquero @ 2009-09-18  3:05 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 4473

On Fri, Sep 18, 2009 at 02:28, Juanma Barranquero <lekktu@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





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#4473: after-load-functions: files are not absolute, some are  missed
  2009-09-18  0:19     ` Glenn Morris
  2009-09-18  0:28       ` Juanma Barranquero
@ 2009-09-18  3:13       ` Stefan Monnier
  2009-09-18  3:16         ` Juanma Barranquero
  2009-09-18  6:23         ` Glenn Morris
  1 sibling, 2 replies; 13+ messages in thread
From: Stefan Monnier @ 2009-09-18  3:13 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 4473, Juanma Barranquero

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

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

Why not just use preloaded-file-list?


        Stefan






^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#4473: after-load-functions: files are not absolute, some are  missed
  2009-09-18  3:13       ` Stefan Monnier
@ 2009-09-18  3:16         ` Juanma Barranquero
  2009-09-18  6:23         ` Glenn Morris
  1 sibling, 0 replies; 13+ messages in thread
From: Juanma Barranquero @ 2009-09-18  3:16 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 4473

On Fri, Sep 18, 2009 at 05:13, Stefan Monnier <monnier@iro.umontreal.ca> wrote:

> Why not just use preloaded-file-list?

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

    Juanma





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#4473: after-load-functions: files are not absolute, some are  missed
  2009-09-17 23:02 ` bug#4473: after-load-functions: files are not absolute, some are missed Glenn Morris
  2009-09-17 23:38   ` Juanma Barranquero
  2009-09-18  0:11   ` Juanma Barranquero
@ 2009-09-18  3:18   ` Juanma Barranquero
  2009-09-18  6:30   ` bug#4473: marked as done (after-load-functions: files are not absolute, some are missed) Emacs bug Tracking System
  3 siblings, 0 replies; 13+ messages in thread
From: Juanma Barranquero @ 2009-09-18  3:18 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 4473

On Fri, Sep 18, 2009 at 01:02, Glenn Morris <rgm@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





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#4473: after-load-functions: files are not absolute, some are  missed
  2009-09-18  3:05         ` Juanma Barranquero
@ 2009-09-18  6:22           ` Glenn Morris
  0 siblings, 0 replies; 13+ messages in thread
From: Glenn Morris @ 2009-09-18  6:22 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: 4473

Juanma Barranquero wrote:

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

Double d'oh! Thanks...





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#4473: after-load-functions: files are not absolute, some are  missed
  2009-09-18  3:13       ` Stefan Monnier
  2009-09-18  3:16         ` Juanma Barranquero
@ 2009-09-18  6:23         ` Glenn Morris
  2009-09-18  9:10           ` Eli Zaretskii
  1 sibling, 1 reply; 13+ messages in thread
From: Glenn Morris @ 2009-09-18  6:23 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 4473, Juanma Barranquero

Stefan Monnier wrote:

> Why not just use preloaded-file-list?

The usual reason - stupidity. :(





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#4473: marked as done (after-load-functions: files are not absolute, some are missed)
  2009-09-17 23:02 ` bug#4473: after-load-functions: files are not absolute, some are missed Glenn Morris
                     ` (2 preceding siblings ...)
  2009-09-18  3:18   ` Juanma Barranquero
@ 2009-09-18  6:30   ` Emacs bug Tracking System
  3 siblings, 0 replies; 13+ messages in thread
From: Emacs bug Tracking System @ 2009-09-18  6:30 UTC (permalink / raw)
  To: Glenn Morris

[-- Attachment #1: Type: text/plain, Size: 923 bytes --]

Your message dated Fri, 18 Sep 2009 02:25:23 -0400
with message-id <5hiqfglqgc.fsf@fencepost.gnu.org>
and subject line Re: bug#4473: after-load-functions: files are not absolute, some are  missed
has caused the Emacs bug report #4473,
regarding after-load-functions: files are not absolute, some are missed
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 owner@emacsbugs.donarmstrong.com
immediately.)


-- 
4473: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=4473
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 3817 bytes --]

From: Glenn Morris <rgm@gnu.org>
To: bug-gnu-emacs@gnu.org
Subject: after-load-functions: files are not absolute, some are missed
Date: Thu, 17 Sep 2009 19:02:51 -0400
Message-ID: <rriqfh6up0.fsf@fencepost.gnu.org>


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)



[-- Attachment #3: Type: message/rfc822, Size: 2118 bytes --]

From: Glenn Morris <rgm@gnu.org>
To: Juanma Barranquero <lekktu@gmail.com>
Cc: 4473-done@emacsbugs.donarmstrong.com
Subject: Re: bug#4473: after-load-functions: files are not absolute, some are  missed
Date: Fri, 18 Sep 2009 02:25:23 -0400
Message-ID: <5hiqfglqgc.fsf@fencepost.gnu.org>

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.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#4473: after-load-functions: files are not absolute, some are  missed
  2009-09-18  6:23         ` Glenn Morris
@ 2009-09-18  9:10           ` Eli Zaretskii
  0 siblings, 0 replies; 13+ messages in thread
From: Eli Zaretskii @ 2009-09-18  9:10 UTC (permalink / raw)
  To: Glenn Morris, 4473; +Cc: lekktu

> From: Glenn Morris <rgm@gnu.org>
> Date: Fri, 18 Sep 2009 02:23:38 -0400
> Cc: 4473@emacsbugs.donarmstrong.com, Juanma Barranquero <lekktu@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.





^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2009-09-18  9:10 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <5hiqfglqgc.fsf@fencepost.gnu.org>
2009-09-17 23:02 ` bug#4473: after-load-functions: files are not absolute, some are missed Glenn Morris
2009-09-17 23:38   ` Juanma Barranquero
2009-09-18  0:11   ` Juanma Barranquero
2009-09-18  0:19     ` Glenn Morris
2009-09-18  0:28       ` Juanma Barranquero
2009-09-18  3:05         ` Juanma Barranquero
2009-09-18  6:22           ` Glenn Morris
2009-09-18  3:13       ` Stefan Monnier
2009-09-18  3:16         ` Juanma Barranquero
2009-09-18  6:23         ` Glenn Morris
2009-09-18  9:10           ` Eli Zaretskii
2009-09-18  3:18   ` Juanma Barranquero
2009-09-18  6:30   ` bug#4473: marked as done (after-load-functions: files are not absolute, some are missed) Emacs bug Tracking System

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).