emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 199a1b5: * lisp/info.el (Info-toc-insert): Suppress


From: Juri Linkov
Subject: [Emacs-diffs] master 199a1b5: * lisp/info.el (Info-toc-insert): Suppress same section names as node names.
Date: Mon, 29 Jul 2019 14:18:42 -0400 (EDT)

branch: master
commit 199a1b5cd4845f432ee7231e0f7cdd2b6ebddf37
Author: Juri Linkov <address@hidden>
Commit: Juri Linkov <address@hidden>

    * lisp/info.el (Info-toc-insert): Suppress same section names as node names.
    
    Add indentation to section lines.  (Bug#23142)
---
 lisp/info.el | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/lisp/info.el b/lisp/info.el
index 3203c5f..cc18ea1 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -2452,11 +2452,12 @@ Table of contents is created from the tree structure of 
menus."
   "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")
+      (let ((node (assoc (car nodes) node-list))
+            (indentation (make-string level ?\t)))
+        (when (and (not (member (nth 2 node) (list nil section)))
+                   (not (equal (nth 1 node) (nth 2 node))))
+          (insert indentation (setq section (nth 2 node)) "\n"))
+        (insert indentation "*Note " (car nodes) ":: \n")
         (Info-toc-insert (nth 3 node) node-list (1+ level) curr-file)
         (setq nodes (cdr nodes))))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]