texinfo-commits
[Top][All Lists]
Advanced

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

[5764] check if menu in node for m command


From: Gavin D. Smith
Subject: [5764] check if menu in node for m command
Date: Wed, 20 Aug 2014 17:18:41 +0000

Revision: 5764
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5764
Author:   gavin
Date:     2014-08-20 17:18:39 +0000 (Wed, 20 Aug 2014)
Log Message:
-----------
check if menu in node for m command

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/session.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2014-08-20 16:11:08 UTC (rev 5763)
+++ trunk/ChangeLog     2014-08-20 17:18:39 UTC (rev 5764)
@@ -1,5 +1,10 @@
 2014-08-20  Gavin Smith  <address@hidden>
 
+       * info/session.c (info_menu_item): Check for case when there are no
+       menu entries in the node.
+
+2014-08-20  Gavin Smith  <address@hidden>
+
        * doc/info-stnd.texi (Searching Commands): Consistent formatting
        for commands without key bindings.  Mention alternative for searching
        backwards.  Remove reference to Emacs regular expressions, as those

Modified: trunk/info/session.c
===================================================================
--- trunk/info/session.c        2014-08-20 16:11:08 UTC (rev 5763)
+++ trunk/info/session.c        2014-08-20 17:18:39 UTC (rev 5764)
@@ -2506,13 +2506,24 @@
    and select that item. */
 DECLARE_INFO_COMMAND (info_menu_item, _("Read a menu item and select its 
node"))
 {
-  if (!window->node->references)
+  if (window->node->references)
     {
-      info_error ("%s", msg_no_menu_node);
-      return;
+      REFERENCE **r;
+      
+      /* Check if there is a menu in this node. */
+      for (r = window->node->references; *r; r++)
+        if ((*r)->type == REFERENCE_MENU_ITEM)
+          break;
+
+      if (*r)
+        {
+          info_menu_or_ref_item (window, key, 1, 0, 1);
+          return;
+        }
     }
 
-  info_menu_or_ref_item (window, key, 1, 0, 1);
+  info_error ("%s", msg_no_menu_node);
+  return;
 }
 
 /* Read a line (with completion) which is the name of a reference to




reply via email to

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