XEmacs 21.2.47 (Zephir).
[chise/xemacs-chise.git.1] / src / menubar.c
index f397934..d48425d 100644 (file)
@@ -232,7 +232,7 @@ See also 'find-menu-item'.
 }
 
 DEFUN ("popup-menu", Fpopup_menu, 1, 2, 0, /*
-Pop up the given menu.
+Pop up the menu described by MENU-DESCRIPTION.
 A menu description is a list of menu items, strings, and submenus.
 
 The first element of a menu must be a string, which is the name of the menu.
@@ -312,10 +312,10 @@ For example:
 
 See menubar.el for many more examples.
 */
-       (menu_desc, event))
+       (menu_description, event))
 {
-  struct frame *f = decode_frame(Qnil);
-  MAYBE_FRAMEMETH (f, popup_menu, (menu_desc,event));
+  struct frame *f = decode_frame (Qnil);
+  MAYBE_FRAMEMETH (f, popup_menu, (menu_description, event));
   return Qnil;
 }
 
@@ -371,6 +371,10 @@ This removes %_'s (accelerator indications) and converts %% to %.
       INC_CHARPTR (name_data);
     }
 
+  if (string_result_ptr - string_result == XSTRING_LENGTH (name)
+      && !memcmp (string_result, XSTRING_DATA (name), XSTRING_LENGTH (name)))
+    return name;
+
   return make_string (string_result, string_result_ptr - string_result);
 }
 
@@ -559,13 +563,15 @@ The possible keywords are:
                         :included (memq symbol menubar-configuration)
                     See the variable `menubar-configuration'.
 
- :filter <function>  A menu filter can only be used in a menu item list.
-                    (i.e. not in a menu item itself).  It is used to
+ :filter <function>  A menu filter can only be used at the beginning of a
+                     submenu description (i.e. not in a menu item itself).
+                    (Remember that most of the keywords can take evaluated
+                    expressions as well as constants.)  The filter is used to
                     incrementally create a submenu only when it is selected
                      by the user and not every time the menubar is activated.
                      The filter function is passed the list of menu items in
-                     the submenu and must return a list of menu items to be
-                     used for the menu.  It must not destructively modify
+                     the submenu and must return the modified list to be
+                    actually used.  The filter MUST NOT destructively modify
                      the list of menu items passed to it.  It is called only
                     when the menu is about to be displayed, so other menus
                     may already be displayed.  Vile and terrible things will
@@ -576,6 +582,7 @@ The possible keywords are:
 
  :key-sequence keys  Used in FSF Emacs as an hint to an equivalent keybinding.
                      Ignored by XEmacs for easymenu.el compatibility.
+                    (XEmacs computes this information automatically.)
 
 For example:
 
@@ -716,6 +723,7 @@ the actions of menu traversal keys in a commonly used PC operating system.
 */ );
 
   Fprovide (intern ("menubar"));
+  Fprovide (intern ("menu-accelerator-support"));
 }
 
 void
@@ -732,7 +740,7 @@ This is a specifier; use `set-specifier' to change it.
                         offsetof (struct window, menubar_visible_p),
                         menubar_visible_p_changed,
                         offsetof (struct frame, menubar_visible_p),
-                        menubar_visible_p_changed_in_frame);
+                        menubar_visible_p_changed_in_frame, 0);
 }
 
 void