[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Extra information in autoload error
From: |
Alex |
Subject: |
Re: [PATCH] Extra information in autoload error |
Date: |
Sat, 22 Oct 2016 14:23:34 -0600 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Stefan Monnier <address@hidden> writes:
>>> if (!NILP (Fequal (fun, fundef)))
>>> - error ("Autoloading failed to define function %s",
>>> + error ("Autoloading file %s failed to define function %s",
>>> + SDATA (Fcar (Fcar (Vload_history))),
>
> If the autoloaded file had a `require' or a `load', I suspect that
> Fcar (Fcar (Vload_history)) might return the wrong file name.
>
I tried testing this with nlinum-mode. In emacs -Q evaluate:
(progn
(autoload 'nlinum-mode2 "~/.emacs.d/elpa/nlinum-1.6/nlinum")
(nlinum-mode2))
If nlinum-mode is installed then this will error with:
(error "Autoloading failed to define function nlinum-mode2 in file
/home/alex/.emacs.d/elpa/nlinum-1.6/nlinum.elc")
I also replaced the (require 'linum) with (load "linum") and got the
same result.
So it seems to work. It seems that if there's a `require' or `load',
then those files get added to `load-history' before the initial file.
>> Ping. Does anyone have an opinion on which of the two diffs is better?
>
> I'd go with the second,
>
>
> Stefan
Is it just because it's a "safer" option, or do you (and Eli) figure the
second error message would just be better?
- Re: [PATCH] Extra information in autoload error, Alex, 2016/10/22
- Re: [PATCH] Extra information in autoload error, Eli Zaretskii, 2016/10/22
- Re: [PATCH] Extra information in autoload error, Stefan Monnier, 2016/10/22
- Re: [PATCH] Extra information in autoload error,
Alex <=
- Re: [PATCH] Extra information in autoload error, Eli Zaretskii, 2016/10/23
- Re: [PATCH] Extra information in autoload error, Alex, 2016/10/23
- Re: [PATCH] Extra information in autoload error, Eli Zaretskii, 2016/10/24
- Re: [PATCH] Extra information in autoload error, Alex, 2016/10/24
- Re: [PATCH] Extra information in autoload error, Eli Zaretskii, 2016/10/24
- Re: [PATCH] Extra information in autoload error, Alex, 2016/10/25