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#74844: m-buffer: Broken Top Directory node in Info manual due to malformed Texinfo direntry Date: Sun, 15 Dec 2024 08:19:18 +0200 Message-ID: <86wmg1sc2h.fsf@gnu.org> References: <87zfl0bc7o.fsf@gmail.com> <86frmqwusr.fsf@gnu.org> <86pllutj7a.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18564"; mail-complaints-to="usenet@ciao.gmane.io" Cc: yantar92@posteo.net, 74844@debbugs.gnu.org, suhailsingh247@gmail.com To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 15 07:20:31 2024 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 1tMhzT-0004h9-F1 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 15 Dec 2024 07:20:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMhz3-0008F0-3i; Sun, 15 Dec 2024 01:20:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMhz2-0008Eq-Dm for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2024 01:20:04 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tMhz0-0002xk-Bb for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2024 01:20:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=6Lm7mZZtC8u4ri1K3vwkmSXU2iXe5bat6HquHN2r3cA=; b=p05moOOkVbD4/V6T4M2PsT2oNKw51Jq9SzbBdEdc74DXgR5wZ5F7hrgT4ULMIr7+qQW+/wFxKq5seHKV9bloQddmDK1Xw+hqZRmSEup09ys0aVsC9Z05oXkPMRSMhOv+LmbI4BaMoR7zD+mGbsNj+HQgjICf8ahbveeZobTBkh+nwbZbFbqgabKSvN6y8FsuaDGS4T60Ty6CS4CgqFR4yhk4yWcN80KNt35UBwx3zhi6bRj0UjdOUigl8d91pEO+1ZmkkF78bGLK6gWhUt0N6obWUZ7f3y6pFpUHOCIKHjWdzso8tEhAhP9emjzdGRWz6eSL2Ch3ddl4qjZALucP1A==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tMhyz-0001xh-UD for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2024 01:20:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Dec 2024 06:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74844 X-GNU-PR-Package: emacs Original-Received: via spool by 74844-submit@debbugs.gnu.org id=B74844.17342435787497 (code B ref 74844); Sun, 15 Dec 2024 06:20:01 +0000 Original-Received: (at 74844) by debbugs.gnu.org; 15 Dec 2024 06:19:38 +0000 Original-Received: from localhost ([127.0.0.1]:49317 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMhyY-0001wk-DZ for submit@debbugs.gnu.org; Sun, 15 Dec 2024 01:19:37 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43754) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMhyV-0001wR-MZ for 74844@debbugs.gnu.org; Sun, 15 Dec 2024 01:19:33 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMhyN-0002uQ-Km; Sun, 15 Dec 2024 01:19:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=6Lm7mZZtC8u4ri1K3vwkmSXU2iXe5bat6HquHN2r3cA=; b=TtKeUKu0+euF +rXR4RAaaKwYROeCNXXfmLUyJjejNkpL0pFMqq8zXLokWQcIxRcZyYAdxni9LHpgjLOYvhJ+BVNxo 3bw4HdLa6EocXuFC7PHgms9lSdAWcPkMLHOzlLs5gW4/jVvnW6DlRBHklqIhHeHHuewH+DZQKCrS6 WBsSjjvwBq5g3S9IrDtAtHHXOy3KhTusSYrL82f+qiLUMdYOCxr0qEVMeubL0NGqn2CehkS9T0bs4 8mAvxat+1XE+ORj02LDpQtWxbipdrePcuF0qanwJ2JHYk4RfTFFDdH1nfz/kksFqQJBKUNauO/IL0 zQGn0OGpMh/2QXU+qoQgwg==; In-Reply-To: (message from Stefan Monnier on Sat, 14 Dec 2024 16:05:34 -0500) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:297085 Archived-At: > From: Stefan Monnier > Cc: suhailsingh247@gmail.com, 74844@debbugs.gnu.org, yantar92@posteo.net > Date: Sat, 14 Dec 2024 16:05:34 -0500 > > >> > An entry in DIR can be either > >> > > >> > * TITLE: (FILE). DESCRIPTION > >> > or > >> > * TITLE: (FILE)NODE. DESCRIPTION > >> > >> [ Side question: Where is this documented? ] > > > > In the Texinfo manual, in the node "Menu Parts" (since the DIR file is > > just a giant menu). > > That says: > > A menu entry has three parts, only the second of which is required: > > The menu entry name (optional). > The name of the node (required). > A description of the item (optional). > > It's not clear what "optional" means for the menu entry name: how do we > write without it? Like this: * (FILE)NODE. > Does it refer to the > > * NAME:: > > syntax described in the next node? That stands for * NAME: NAME. So you could also write * (FILE)NODE:: > BTW, that next node says that `* NAME::` is equivalent to: > > * NAME: NAME. > > but shouldn't that be > > * NAME: (NAME). > > ? No, because NAME here is the name of a node, and in DIR all the nodes are in other files, so NAME should look like "(FILE)NODE" or "(FILE)" (which stands for "(FILE)Top"). If NAME is a node in the same file as the menu, the (FILE) part can be omitted. > The manual reads like a "user manual" and I think I need something more > like a "reference manual", or a specification, with a precise grammar. That's because arbitrary programs are not supposed to generate Info formats, they are supposed to invoke Texinfo programs to do that. For example, to update DIR, you are supposed to invoke install-info, which knows about all these rules (and more). > > Then I'm not sure this is correct: > > > > + (t (format "* %s: (%s)." (or dn file) (or file dn)))))) > > > > What if FILE is nil? > > My reading of the code says it *may* potentially be nil in some corner > case, but I have no idea how that could happen. A nil value for `dn` is > normal, in contrast. A nil value for 'dn' is okay, it produces a correct entry. > > Can it be nil at this point? The part in the > > parentheses _must_ identify an Info file, with or without a node. It > > cannot be the TITLE, because that one can be arbitrary text. > > If FILE is nil, we're in trouble. IIRC the `(or file dn)` in the code > just tried to preserve the previous behavior in the unlikely case that > FILE is nil, for lack of understanding about when (or even if) that > can happen. In that case, I suggest the following code: (dn (format "* %s: (%s)." dn (or file dn))) (t (format "* (%s)." file)) That is, the bug in the original code is that they failed to put FILE in parentheses (and also wanted a premature optimization of producing the "shortest" entry). This assumes that FILE does not include parentheses and does not specify a node, i.e. it is NOT in the form "(FILE)NODE". My reading of ox-texinfo.el is that if that could happen, the code in org-texinfo-template is already in trouble, because it is obviously not ready for that. WDYT?