texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: Find menu with hide-note-references=On


From: Gavin D. Smith
Subject: branch master updated: Find menu with hide-note-references=On
Date: Wed, 17 Jan 2024 15:31:09 -0500

This is an automated email from the git hooks/post-receive script.

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new d5c0f6a951 Find menu with hide-note-references=On
d5c0f6a951 is described below

commit d5c0f6a951321769ddeb86253c19515923c66556
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Wed Jan 17 20:31:01 2024 +0000

    Find menu with hide-note-references=On
    
    * info/session.c (info_find_menu): If "*Menu:" marker not
    found, try to move cursor to the first menu entry in the node.
    
    Report from Bugsy Abatantuono <bugsyabatantuono@proton.me>.
---
 ChangeLog      |  9 +++++++++
 info/session.c | 18 +++++++++++++++++-
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index a677baa948..73364b1306 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-01-17  Gavin Smith <gavinsmith0123@gmail.com>
+
+       Find menu with hide-note-references=On
+
+       * info/session.c (info_find_menu): If "*Menu:" marker not
+       found, try to move cursor to the first menu entry in the node.
+
+       Report from Bugsy Abatantuono <bugsyabatantuono@proton.me>.
+
 2024-01-17  Gavin Smith <gavinsmith0123@gmail.com>
 
        * doc/texinfo.texi (Reporting Bugs): Change reference to "Change Log"
diff --git a/info/session.c b/info/session.c
index 7c385aca51..06ac77459c 100644
--- a/info/session.c
+++ b/info/session.c
@@ -2504,7 +2504,23 @@ DECLARE_INFO_COMMAND (info_find_menu, _("Move to the 
start of this node's menu")
       window->flags |= W_UpdateWindow;
     }
   else
-    info_error ("%s", msg_no_menu_node);
+    {
+      /* If not found, it could be because the menu label was removed from
+         the node with hide-note-references.  Move to the first menu entry
+         in the node if there is one. */
+      REFERENCE **ref;
+      for (ref = window->node->references; *ref != 0; ref++)
+        {
+          if ((*ref)->type == REFERENCE_MENU_ITEM)
+            {
+              window->point = (*ref)->start;
+              window_adjust_pagetop (window);
+              window->flags |= W_UpdateWindow;
+              return;
+            }
+        }
+    }
+  info_error ("%s", msg_no_menu_node);
 }
 
 /* Visit as many menu items as is possible, each in a separate window. */



reply via email to

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