From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#23142: 25.1.50; Kind of duplicated lines in info TOC Date: Mon, 29 Jul 2019 00:52:02 +0200 Message-ID: <87wog193hp.fsf@mouse.gnus.org> References: <8760w55wpg.fsf@bredband.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="46202"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 23142@debbugs.gnu.org To: Johan Claesson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 29 00:53:11 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hrs2R-000BsK-Kk for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 Jul 2019 00:53:11 +0200 Original-Received: from localhost ([::1]:47176 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hrs2Q-0000in-5D for geb-bug-gnu-emacs@m.gmane.org; Sun, 28 Jul 2019 18:53:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53554) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hrs2J-0000gv-SJ for bug-gnu-emacs@gnu.org; Sun, 28 Jul 2019 18:53:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hrs2I-0001JB-Ki for bug-gnu-emacs@gnu.org; Sun, 28 Jul 2019 18:53:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38518) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hrs2I-0001Ip-Gi for bug-gnu-emacs@gnu.org; Sun, 28 Jul 2019 18:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hrs2I-0005Ni-EQ for bug-gnu-emacs@gnu.org; Sun, 28 Jul 2019 18:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Jul 2019 22:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23142 X-GNU-PR-Package: emacs Original-Received: via spool by 23142-submit@debbugs.gnu.org id=B23142.156435433120599 (code B ref 23142); Sun, 28 Jul 2019 22:53:02 +0000 Original-Received: (at 23142) by debbugs.gnu.org; 28 Jul 2019 22:52:11 +0000 Original-Received: from localhost ([127.0.0.1]:47336 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hrs1T-0005MB-7J for submit@debbugs.gnu.org; Sun, 28 Jul 2019 18:52:11 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:34316) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hrs1R-0005Lz-8o for 23142@debbugs.gnu.org; Sun, 28 Jul 2019 18:52:09 -0400 Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hrs1K-0001jw-DD; Mon, 29 Jul 2019 00:52:06 +0200 In-Reply-To: <8760w55wpg.fsf@bredband.net> (Johan Claesson's message of "Tue, 29 Mar 2016 13:51:07 +0200") 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: 209.51.188.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:163997 Archived-At: Johan Claesson writes: > Regarding the table-of-contents that is generated by typing T in > info. Whenever there is a new level of sections the section name > is printed twice. For example in the start of the elisp > manual "Introduction" and "Conventions" are duplicated (and the > second "Conventions" is not indented which disturbs the > readability): > > Top:: > Introduction:: > Introduction > Caveats:: > Lisp History:: > Conventions:: > Conventions > Some Terms:: > nil and t:: > [...] Yes, that's kinda ugly. > (defun Info-toc-insert (nodes node-list level curr-file) > "Insert table of contents with references to nodes." > ;; (let ((section "Top")) > (while nodes > (let ((node (assoc (car nodes) node-list))) > ;; (unless (member (nth 2 node) (list nil section)) > ;; (insert (setq section (nth 2 node)) "\n")) > (insert (make-string level ?\t)) > (insert "*Note " (car nodes) ":: \n") > (Info-toc-insert (nth 3 node) node-list (1+ level) curr-file) > (setq nodes (cdr nodes))))) Yup, the following: diff --git a/lisp/info.el b/lisp/info.el index 3203c5f171..abef57f79f 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -2453,8 +2453,6 @@ Info-toc-insert (let ((section "Top")) (while nodes (let ((node (assoc (car nodes) node-list))) - (unless (member (nth 2 node) (list nil section)) - (insert (setq section (nth 2 node)) "\n")) (insert (make-string level ?\t)) (insert "*Note " (car nodes) ":: \n") (Info-toc-insert (nth 3 node) node-list (1+ level) curr-file) makes the TOC much nicer. As a test case, open the ert info file and hit `T'. Does anybody know what the reasoning behind adding these seemingly doubled lines is? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no