Subject: bug#2061: closed (Re: bug#2061: 23.0.60; Add preference to force load of Elisp files)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 18 Dec 2013 03:25:03 +0000

Your bug report

#2061: 23.0.60; Add preference to force load of Elisp files when they are newer than corresponding byte-compiled file

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 [email-masked].

-- 
2061: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=2061
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#2061: 23.0.60; Add preference to force load of Elisp files
From: Glenn Morris <[email-masked]>
To: [email-masked]
Date: Tue, 17 Dec 2013 22:24:10 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

Version: 24.4

Added option `load-prefer-newer'.

Subject: 23.0.60; Add preference to force load of Elisp files when they are newer than corresponding byte-compiled file
From: Brent Goodrick <[email-masked]>
To: [email-masked]
Date: Sun, 25 Jan 2009 18:19:27 -0800

Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the [email-masked] mailing list.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

The load function will load a .elc file even if the .el file is newer
than the .elc file.  There are warnings issued, but it is likely that
the message is lost in the ton of messages that usually are emitted,
especially during Emacs invocation.

When would the user ever prefer to load the .elc file after having
modified the .el file?

My suggestion is to add a customizable preference variable called,
say, load-prefer-newer-lisp-files (that needs a better name), that is
recognized by the load function (defined in C code). When
load-prefer-newer-lisp-files is non-nil, and when there is a .el and
.elc file, and when the .el file is newer than the .elc file, it loads
the .el file and not the .elc file (and possibly emits a warning of
this action).

Having it be a customizable preference variable avoids surprising
other users who are used to the existing behavior.

I could hack around this by fset'ing `load' to be my own function that
removes the .elc file when the .el file is found to be newer, but that
is an expensive operation involving calling such functions such as
locate-file-internal to find both .el and .elc files, testing their
modification date-time stamps, etc., operations that the `load' C
function performs already.  Hence, why I think it is best to change
the load function to allow for both approaches via a preference
variable.

Thanks!
Brent

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
If you would like to further debug the crash, please read the file
/home/brentg/emacs_from_source/install/share/emacs/23.0.60/etc/DEBUG for instructions.

In GNU Emacs 23.0.60.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.12.11)
 of 2009-01-25 on hungover
Windowing system distributor `The X.Org Foundation', version 11.0.10402000
configured using `configure  '--with-x-toolkit' '--prefix=/home/brentg/emacs_from_source/install''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  erc-list-mode: t
  erc-menu-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-match-mode: t
  erc-button-mode: t
  erc-netsplit-mode: t
  desktop-save-mode: t
  iswitchb-mode: t
  erc-ring-mode: t
  erc-services-mode: t
  erc-networks-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  display-time-mode: t
  shell-dirtrack-mode: t
  delete-selection-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: 1
  transient-mark-mode: t
  abbrev-mode: t

Recent input:
C-p C-p C-p C-p M-f M-f SPC f o r m C-e M-b M-f SPC 
t h e SPC . e l SPC f i l e SPC i n t o SPC a SPC . 
e l c SPC f i l e C-d C-a M-q C-n C-n C-n C-n C-n C-n 
C-n C-n C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-n 
C-n C-n C-e C-b SPC f o r SPC d e m o n s t r a t i 
o n SPC p u r o <backspace> p o <backspace> o s e s 
C-a C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-n M-f M-f M-f M-f M-f M-f 
M-f M-f M-f M-f M-f M-f M-b M-b M-b M-b f o r SPC M-f 
M-f M-q M-f M-f C-b , SPC w h i c h SPC i s SPC SPC 
<backspace> a SPC l i C-SPC M-b M-b M-b w r o n g SPC 
b e c a u s e SPC t h e SPC . e l c SPC f i l e SPC 
d o e s SPC i n e <backspace> d e e d SPC e x i s t 
M-q C-a C-n C-n C-n C-n C-n C-n M-f M-f M-f M-f M-f 
M-f M-f M-f M-f M-f C-n C-p C-p C-p C-p C-p C-p C-p 
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p 
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p 
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-c 
C-c y e s <return> <down-mouse-1> <mouse-1> M-SPC <return> 
<return> M-x r e p p o r t M-P <return>

Recent messages:
/home/brentg/.authin: 100% (398/398)
334 VXNlcm5hbWU6
334 UGFzc3dvcmQ6
235 2.7.0 Accepted
250 2.1.0 OK k41sm12274699rvb.3
250 2.1.5 OK k41sm12274699rvb.3
354  Go ahead k41sm12274699rvb.3
250 2.0.0 OK 1232907223 k41sm12274699rvb.3
221 2.0.0 closing connection k41sm12274699rvb.3
Sending...done