unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alex <agrambot@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: [PATCH] Extra information in autoload error
Date: Sat, 22 Oct 2016 14:23:34 -0600	[thread overview]
Message-ID: <87wph06sl5.fsf@gmail.com> (raw)
In-Reply-To: <jwvd1is18c9.fsf-monnier+gmane.emacs.devel@gnu.org> (Stefan Monnier's message of "Sat, 22 Oct 2016 15:40:44 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> 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?



  reply	other threads:[~2016-10-22 20:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-21 20:53 [PATCH] Extra information in autoload error Alex
2016-09-21 21:13 ` Davis Herring
2016-09-21 22:16   ` Alex
2016-10-22 16:23     ` Alex
2016-10-22 16:30       ` Eli Zaretskii
2016-10-22 19:40       ` Stefan Monnier
2016-10-22 20:23         ` Alex [this message]
2016-10-23  5:53           ` Eli Zaretskii
2016-10-23 21:24             ` Alex
2016-10-24  6:30               ` Eli Zaretskii
2016-10-24 19:21                 ` Alex
2016-10-24 19:56                   ` Eli Zaretskii
2016-10-25  5:47                     ` Alex
2016-11-04  8:43                       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wph06sl5.fsf@gmail.com \
    --to=agrambot@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).