From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#48181: incremental autoloads update can put output in wrong file Date: Mon, 03 May 2021 14:37:44 +0300 Message-ID: <83eeeo6oaf.fsf@gnu.org> References: <9fpmy8fwt2.fsf@fencepost.gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29851"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 48181@debbugs.gnu.org, monnier@iro.umontreal.ca To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 03 13:41:43 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ldWxK-0007fY-6o for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 03 May 2021 13:41:42 +0200 Original-Received: from localhost ([::1]:47026 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldWxJ-00075j-9r for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 03 May 2021 07:41:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44330) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldWuk-00059L-RC for bug-gnu-emacs@gnu.org; Mon, 03 May 2021 07:39:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34806) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ldWuk-0002fd-IM for bug-gnu-emacs@gnu.org; Mon, 03 May 2021 07:39:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ldWuk-0003ST-Es for bug-gnu-emacs@gnu.org; Mon, 03 May 2021 07:39:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 03 May 2021 11:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48181 X-GNU-PR-Package: emacs Original-Received: via spool by 48181-submit@debbugs.gnu.org id=B48181.162004189313285 (code B ref 48181); Mon, 03 May 2021 11:39:02 +0000 Original-Received: (at 48181) by debbugs.gnu.org; 3 May 2021 11:38:13 +0000 Original-Received: from localhost ([127.0.0.1]:46352 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldWtx-0003SD-9r for submit@debbugs.gnu.org; Mon, 03 May 2021 07:38:13 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:35930) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldWtw-0003S7-8p for 48181@debbugs.gnu.org; Mon, 03 May 2021 07:38:12 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:50979) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldWtq-0002D5-KI; Mon, 03 May 2021 07:38:06 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3381 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ldWtk-0004Kl-Du; Mon, 03 May 2021 07:38:00 -0400 In-Reply-To: <9fpmy8fwt2.fsf@fencepost.gnu.org> (message from Glenn Morris on Sun, 02 May 2021 21:08:57 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:205501 Archived-At: > From: Glenn Morris > Date: Sun, 02 May 2021 21:08:57 -0400 > Cc: Stefan Monnier > > 1) before 68bf917896, lisp/loaddefs.el contains sections like this: > > ;;;### (autoloads nil "texnfo-upd" "textmodes/texnfo-upd.el" (0 0 > ;;;;;; 0 0)) > ;;; Generated autoloads from textmodes/texnfo-upd.el > > (register-definition-prefixes "texnfo-upd" '("texinfo-")) (The other 2 files, makeinfo.el and texinfo.el, are also related, right?) > So even though there aren't any real autoloads in texnfo-upd.el, it's > not in the "no autoloads" section. > > 2) 68bf917896 added real autoload cookies to texnfo-upd.el, and set > generated-autoload-file to texinfo-loaddefs.el. > > 3) make-directory-autoloads correctly finds that texnfo-upd.el is newer > than loaddefs.el, so we execute this branch: > > (t > (setq changed t) > (autoload-remove-section (match-beginning 0)) > (if (autoload-generate-file-autoloads > ;; Passing `current-buffer' makes it insert at point. > file (current-buffer) buffer-file-name) > (push file no-autoloads))) > > Because a non-nil OUTBUF is passed to autoload-generate-file-autoloads, > it ignores the buffer-local setting for generated-autoload-file, > and so puts the autoloads in the main loaddefs.el file, which is wrong. > > > In contrast, if the input loaddefs.el file in step 1 had texnfo-upd.el > in the "no loaddefs" section, then we would execute this branch: > > ;; Passing nil as second argument forces > ;; autoload-generate-file-autoloads to look for the right > ;; spot where to insert each autoloads section. > ((setq file-time > (autoload-generate-file-autoloads file nil buffer-file-name)) > > As the comment says, this version has OUTBUF nil, so the loaddefs end up > the right file. Yes, I've also figured out that by suitable editing of the nascent loaddefs.el I could fix the original problem. But such manual editing sounded gross to me. Or are you saying something else?