From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alex Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Extra information in autoload error Date: Sat, 22 Oct 2016 14:23:34 -0600 Message-ID: <87wph06sl5.fsf@gmail.com> References: <87k2e5nfdr.fsf@gmail.com> <87fuosoq4k.fsf@gmail.com> <87a8dw8iad.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1477167854 14915 195.159.176.226 (22 Oct 2016 20:24:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 22 Oct 2016 20:24:14 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 22 22:24:08 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1by2pW-0000oC-9U for ged-emacs-devel@m.gmane.org; Sat, 22 Oct 2016 22:23:46 +0200 Original-Received: from localhost ([::1]:38582 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1by2pY-00004x-CW for ged-emacs-devel@m.gmane.org; Sat, 22 Oct 2016 16:23:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33174) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1by2pS-00004s-OK for emacs-devel@gnu.org; Sat, 22 Oct 2016 16:23:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1by2pR-0004LO-JC for emacs-devel@gnu.org; Sat, 22 Oct 2016 16:23:42 -0400 Original-Received: from mail-it0-x243.google.com ([2607:f8b0:4001:c0b::243]:35606) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1by2pN-0004Jb-Um; Sat, 22 Oct 2016 16:23:38 -0400 Original-Received: by mail-it0-x243.google.com with SMTP id 139so4431366itm.2; Sat, 22 Oct 2016 13:23:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=rON/JG88cfcucJBjuBigmKvZuB2wge0npeF/OBnIHI8=; b=KPzD2N60Pjo7Gbb2wmsCfy3H/dVUvdisxwhCOTp0hhsibFnDz7RsH85JLW4BFHDEja 5Gyh1jBNp1LZV580qhsuwUfQoF3d8aUF5wOshkSXmW9jDNim46Fk9NoZKTAkWuLMCF1x r8iiYeYWBEBAPNg9AzeN7bKrPbgbaFVTCvlp4hTDb8MCEcMtygNKBvSOMhpb8yNL0d8q EmloIh+RGHS1Ucxhy13RHF+x3qp/L9CjzK6vzWBJO7CstI/nwnV4e6VRAv8yKMHXdJ0w k4ClhcqIcVDp9kemarPdLlQNxRnzIFAPm6DCpTf8lQqI1XqwE1q1JMNTMfkUqtlUjdjz XJYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=rON/JG88cfcucJBjuBigmKvZuB2wge0npeF/OBnIHI8=; b=XJ/hgOo44ZmCblHjfBrtYK6iwsyMjwo0Skf3hJ9B6CWbEFBaTAmIBfQ2DVytCmJ7Ey d+b7eXGRQcQVMfEKfI57LO2bZGpof496AJWQrk1+vHGtll8jLp57kvM3Pj/730KfT5eS /nccS94BpKOGRAJ6wezI0ZeL6KviQmp7TxptmplKRFHFA3yNha/sj5JguN6VqXE9YpUI zSpiPR0Or9EbrIyDni0+fslQZwUo0Rzza8Irte50h4i0ZsRjhmJ2k3bs8GTOdxa9IBjT JOw26y4OH7ejEh4SggwMMqw9qhz0xw7mKXAlbxYrhim81C+kXWeI/yBiVAxsR4i2zIAs Py4Q== X-Gm-Message-State: ABUngvdqIyMpyf1MuXJJTwfCxlHMchPi4AT/HtUapOF6jn7uqaoMuixAvyqzD1fP+vpKbQ== X-Received: by 10.36.7.205 with SMTP id f196mr4680515itf.44.1477167817131; Sat, 22 Oct 2016 13:23:37 -0700 (PDT) Original-Received: from lylat (S01061859339e9903.ss.shawcable.net. [174.2.107.88]) by smtp.gmail.com with ESMTPSA id p11sm4323256iop.30.2016.10.22.13.23.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 22 Oct 2016 13:23:36 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Sat, 22 Oct 2016 15:40:44 -0400") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4001:c0b::243 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:208604 Archived-At: Stefan Monnier 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?