unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#10049: 24.0.91; Setting generated-autoload-file as local variable not working correctly
@ 2011-11-14 22:12 David Engster
  2011-11-17  7:39 ` Glenn Morris
  0 siblings, 1 reply; 10+ messages in thread
From: David Engster @ 2011-11-14 22:12 UTC (permalink / raw)
  To: 10049

Recipe:

* Create file 'testautoload.el' in /home/whatever/test containing

--------------------
;;;###autoload
(defun testautoload-testfunc ())

;; Local variables:
;; generated-autoload-file: "foo.el"
;; End:
--------------------

* Now create autoload file using (all in one line)

emacs --batch -l autoload -f toggle-debug-on-error
   --eval '(setq generated-autoload-file "/home/whatever/test/foo.el")' 
   -f batch-update-autoloads /home/whatever/test

You'll see:
...
Wrote /home/whatever/test/foo.el
Making generated-autoload-file local to  *autoload-file* while let-bound!
Generating autoloads for testautoload.el...
Generating autoloads for testautoload.el...done
Saving file /home/void/test/foo.el...
Wrote /home/void/test/foo.el
(No changes need to be saved)

and the file foo.el will be generated (BTW, shouldn't the above
*autoload-file* better denote the actual file name?)

* Now simply call the above command again. You'll get:

Debugger entered--Lisp error: (wrong-type-argument listp "77d69bf537d61f438126776e130fef3d")
  time-less-p("77d69bf537d61f438126776e130fef3d" (20161 36303))
  update-directory-autoloads("/home/whatever/test")
  apply(update-directory-autoloads "/home/whatever/test")
  batch-update-autoloads()
[...]

This is due to the following autoload header in foo.el:

;;;### (autoloads (testautoload-testfunc) "testautoload" "testautoload.el"
;;;;;;  "77d69bf537d61f438126776e130fef3d")
;;; Generated autoloads from testautoload.el

where the md5-looking hex-string is obviously not a time.






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

* bug#10049: 24.0.91; Setting generated-autoload-file as local variable not working correctly
  2011-11-14 22:12 bug#10049: 24.0.91; Setting generated-autoload-file as local variable not working correctly David Engster
@ 2011-11-17  7:39 ` Glenn Morris
  2011-11-17  8:36   ` David Engster
                     ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Glenn Morris @ 2011-11-17  7:39 UTC (permalink / raw)
  To: David Engster; +Cc: 10049


The problem only occurs when the buffer-local value of
generated-autoload-file points to the same file as the global value.
This should be fixed, but in the meantime you can work around it by
simply not setting the buffer-local value (because setting it to the
global value is at best a no-op).





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

* bug#10049: 24.0.91; Setting generated-autoload-file as local variable not working correctly
  2011-11-17  7:39 ` Glenn Morris
@ 2011-11-17  8:36   ` David Engster
  2011-11-17  9:40   ` David Engster
  2011-11-17 21:34   ` Glenn Morris
  2 siblings, 0 replies; 10+ messages in thread
From: David Engster @ 2011-11-17  8:36 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 10049-close

Glenn Morris writes:
> The problem only occurs when the buffer-local value of
> generated-autoload-file points to the same file as the global value.
> This should be fixed, but in the meantime you can work around it by
> simply not setting the buffer-local value (because setting it to the
> global value is at best a no-op).

I can confirm it is fixed; thank you!

You're right of course that those variables are a no-op, but they come
from the CEDET Emacs-merge and I'd like to keep them to make merging
easier.

-David





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

* bug#10049: 24.0.91; Setting generated-autoload-file as local variable not working correctly
  2011-11-17  7:39 ` Glenn Morris
  2011-11-17  8:36   ` David Engster
@ 2011-11-17  9:40   ` David Engster
  2011-11-17 17:27     ` Glenn Morris
  2011-11-17 21:34   ` Glenn Morris
  2 siblings, 1 reply; 10+ messages in thread
From: David Engster @ 2011-11-17  9:40 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 10049

reopen 10049
thanks

> Glenn Morris writes:
> > The problem only occurs when the buffer-local value of
> > generated-autoload-file points to the same file as the global value.
> > This should be fixed, but in the meantime you can work around it by
> > simply not setting the buffer-local value (because setting it to the
> > global value is at best a no-op).

David Engster writes:
> I can confirm it is fixed; thank you!

I'm sorry, I first misread your statement in the sense that you fixed
the bug, and then performed the check on the wrong file... the bug is of
course still there.

-David





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

* bug#10049: 24.0.91; Setting generated-autoload-file as local variable not working correctly
  2011-11-17  9:40   ` David Engster
@ 2011-11-17 17:27     ` Glenn Morris
  0 siblings, 0 replies; 10+ messages in thread
From: Glenn Morris @ 2011-11-17 17:27 UTC (permalink / raw)
  To: David Engster; +Cc: 10049

David Engster wrote:

> I'm sorry, I first misread your statement in the sense that you fixed
> the bug, and then performed the check on the wrong file... the bug is of
> course still there.

Yes, I was going to say that. :)





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

* bug#10049: 24.0.91; Setting generated-autoload-file as local variable not working correctly
  2011-11-17  7:39 ` Glenn Morris
  2011-11-17  8:36   ` David Engster
  2011-11-17  9:40   ` David Engster
@ 2011-11-17 21:34   ` Glenn Morris
  2011-11-18 20:58     ` David Engster
  2 siblings, 1 reply; 10+ messages in thread
From: Glenn Morris @ 2011-11-17 21:34 UTC (permalink / raw)
  To: David Engster; +Cc: 10049


I think it is fixed now.





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

* bug#10049: 24.0.91; Setting generated-autoload-file as local variable not working correctly
  2011-11-17 21:34   ` Glenn Morris
@ 2011-11-18 20:58     ` David Engster
  2011-11-20  2:18       ` Stefan Monnier
  0 siblings, 1 reply; 10+ messages in thread
From: David Engster @ 2011-11-18 20:58 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 10049-close

Glenn Morris writes:
> I think it is fixed now.

...and confirmed (again!) ;-)

Thanks!
David





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

* bug#10049: 24.0.91; Setting generated-autoload-file as local variable not working correctly
  2011-11-18 20:58     ` David Engster
@ 2011-11-20  2:18       ` Stefan Monnier
  2011-11-20 19:00         ` David Engster
  0 siblings, 1 reply; 10+ messages in thread
From: Stefan Monnier @ 2011-11-20  2:18 UTC (permalink / raw)
  To: 10049; +Cc: deng

>> I think it is fixed now.
> ...and confirmed (again!) ;-)

Could you check if the (additional) patch below works as well?


        Stefan


=== modified file 'lisp/emacs-lisp/autoload.el'
--- lisp/emacs-lisp/autoload.el	2011-11-17 21:34:16 +0000
+++ lisp/emacs-lisp/autoload.el	2011-11-20 02:17:11 +0000
@@ -512,15 +512,7 @@
 
           (when output-start
             (let ((secondary-autoloads-file-buf
-                   (if (local-variable-p 'generated-autoload-file)
-                       (current-buffer))))
-	      ;; Ignore a buffer-local setting if it points to the
-	      ;; global value.  Otherwise we end up writing a mix of md5s
-	      ;; and time-stamps to the global file.  (Bug#10049)
-	      (and secondary-autoloads-file-buf
-		   outfile
-		   (not otherbuf)
-		   (setq secondary-autoloads-file-buf nil))
+                   (if otherbuf (current-buffer))))
               (with-current-buffer (marker-buffer output-start)
                 (save-excursion
                   ;; Insert the section-header line which lists the file name






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

* bug#10049: 24.0.91; Setting generated-autoload-file as local variable not working correctly
  2011-11-20  2:18       ` Stefan Monnier
@ 2011-11-20 19:00         ` David Engster
  2011-11-21 14:30           ` Stefan Monnier
  0 siblings, 1 reply; 10+ messages in thread
From: David Engster @ 2011-11-20 19:00 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 10049

Stefan Monnier writes:
>>> I think it is fixed now.
>> ...and confirmed (again!) ;-)
>
> Could you check if the (additional) patch below works as well?

Yes, it works as well.

I have related question, though: I also tried to work around this thing
by setting `enable-local-variables' to nil:

emacs --batch -l autoload -f toggle-debug-on-error 
 --eval '(setq generated-autoload-file "/home/whatever/test/foo.el")'
 --eval '(setq enable-local-variables nil)'
 -f batch-update-autoloads /home/whatever/test

However, this does not seem to work; the file-local variable is still
the one to which the autoloads are written to. Is this to be expected?

-David





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

* bug#10049: 24.0.91; Setting generated-autoload-file as local variable not working correctly
  2011-11-20 19:00         ` David Engster
@ 2011-11-21 14:30           ` Stefan Monnier
  0 siblings, 0 replies; 10+ messages in thread
From: Stefan Monnier @ 2011-11-21 14:30 UTC (permalink / raw)
  To: David Engster; +Cc: 10049

>>>> I think it is fixed now.
>>> ...and confirmed (again!) ;-)
>> Could you check if the (additional) patch below works as well?
> Yes, it works as well.

Thanks, installed.

> I have related question, though: I also tried to work around this thing
> by setting `enable-local-variables' to nil:

> emacs --batch -l autoload -f toggle-debug-on-error 
>  --eval '(setq generated-autoload-file "/home/whatever/test/foo.el")'
>  --eval '(setq enable-local-variables nil)'
>  -f batch-update-autoloads /home/whatever/test

> However, this does not seem to work; the file-local variable is still
> the one to which the autoloads are written to. Is this to be expected?

Yes: autoload.el let-binds enable-local-variables to :safe.
Maybe it should keep it at nil if the default is nil?  If you think it
would be better, please make a new bug-report for it.


        Stefan





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

end of thread, other threads:[~2011-11-21 14:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-14 22:12 bug#10049: 24.0.91; Setting generated-autoload-file as local variable not working correctly David Engster
2011-11-17  7:39 ` Glenn Morris
2011-11-17  8:36   ` David Engster
2011-11-17  9:40   ` David Engster
2011-11-17 17:27     ` Glenn Morris
2011-11-17 21:34   ` Glenn Morris
2011-11-18 20:58     ` David Engster
2011-11-20  2:18       ` Stefan Monnier
2011-11-20 19:00         ` David Engster
2011-11-21 14:30           ` Stefan Monnier

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