From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#26837: Wrong file in "autoloading failed to define" error Date: Sat, 20 May 2017 19:17:30 -0400 Message-ID: References: <63h90vp3dn.fsf@fencepost.gnu.org> <87bmr24hj0.fsf@gmail.com> <8760gyudrf.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1495322290 13369 195.159.176.226 (20 May 2017 23:18:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 20 May 2017 23:18:10 +0000 (UTC) User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) Cc: 26837@debbugs.gnu.org To: Alex Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 21 01:18:05 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1dCDdL-0003IL-EQ for geb-bug-gnu-emacs@m.gmane.org; Sun, 21 May 2017 01:18:03 +0200 Original-Received: from localhost ([::1]:35691 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCDdR-0004ki-3n for geb-bug-gnu-emacs@m.gmane.org; Sat, 20 May 2017 19:18:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51659) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCDdL-0004kS-5P for bug-gnu-emacs@gnu.org; Sat, 20 May 2017 19:18:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dCDdK-0003fl-8N for bug-gnu-emacs@gnu.org; Sat, 20 May 2017 19:18:03 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54813) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dCDdK-0003fh-4N for bug-gnu-emacs@gnu.org; Sat, 20 May 2017 19:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dCDdK-00069b-07 for bug-gnu-emacs@gnu.org; Sat, 20 May 2017 19:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 May 2017 23:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26837 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 26837-submit@debbugs.gnu.org id=B26837.149532226023623 (code B ref 26837); Sat, 20 May 2017 23:18:01 +0000 Original-Received: (at 26837) by debbugs.gnu.org; 20 May 2017 23:17:40 +0000 Original-Received: from localhost ([127.0.0.1]:57490 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dCDcx-00068x-R7 for submit@debbugs.gnu.org; Sat, 20 May 2017 19:17:39 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60605) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dCDcw-00068k-EI for 26837@debbugs.gnu.org; Sat, 20 May 2017 19:17:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dCDcq-0003P3-GJ for 26837@debbugs.gnu.org; Sat, 20 May 2017 19:17:33 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55200) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCDco-0003Nj-Rk; Sat, 20 May 2017 19:17:30 -0400 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1dCDco-0003bM-6b; Sat, 20 May 2017 19:17:30 -0400 X-Spook: Fusion Center Evacuation Lightning blackjack kilo class X-Ran: WL]fpF0/jD`WWA-SM;P><4YWY`bi?c)z6o]p~c"SF*W.xW_'T (Alex's message of "Thu, 18 May 2017 14:11:00 -0600") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:132687 Archived-At: Alex wrote: > That seems to work for me as well. Should it be documented that > reevaluations of a file update the position of the file in load-history? I think it's mentioned in the doc of load: Loading a file records its definitions, and its `provide' and `require' calls, in an element of `load-history' whose car is the file name loaded. See `load-history'. ^^^^^^^^^^^^^^^^^^^^^^^^^^^ but that did seem to be the only mention I found in a quick search. > PS: I realized that I was a bit careless in using SDATA without checking > that the argument is necessarily a string. I don't think it matters much > if your above patch is applied, but it's probably not a good idea to > leave it in, just in case there's a bug somewhere else in the future. In 58326f0 I check if the car is nil (though I don't see how it could be). Could add the same thing to eval.c. > What do you think about the following diff? This removes the dependency > on load-history altogether: > > --- a/src/eval.c > +++ b/src/eval.c > @@ -2021,7 +2021,10 @@ it defines a macro. */) > > if (!NILP (Fequal (fun, fundef))) > error ("Autoloading file %s failed to define function %s", > - SDATA (Fcar (Fcar (Vload_history))), > + SDATA (Flocate_file_internal (Fcar (Fcdr (fundef)), > + Vload_path, > + Vload_suffixes, > + Qnil)), > SDATA (SYMBOL_NAME (funname))); > else > return fun; I don't have an informed opinion right now.