From xemacs-m  Mon Jun 23 17:25:55 1997
Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1])
	by xemacs.org (8.8.5/8.8.5) with SMTP id RAA06354
	for <xemacs-beta@xemacs.org>; Mon, 23 Jun 1997 17:25:54 -0500 (CDT)
Received: from Corp.Sun.COM ([129.145.35.78]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id PAA29267 for <xemacs-beta@xemacs.org>; Mon, 23 Jun 1997 15:48:22 -0700
Received: from legba.Corp.Sun.COM by Corp.Sun.COM (SMI-8.6/SMI-5.3)
	id PAA05952; Mon, 23 Jun 1997 15:25:23 -0700
Received: by legba.Corp.Sun.COM (SMI-8.6/SMI-SVR4)
	id PAA06275; Mon, 23 Jun 1997 15:25:21 -0700
To: xemacs-beta@xemacs.org
Subject: x-menubar oops fix [PATCH]
X-Attribution: GDF
Mime-Version: 1.0 (generated by tm-edit 7.108)
Content-Type: multipart/mixed;
 boundary="Multipart_Mon_Jun_23_15:25:21_1997-1"
Content-Transfer-Encoding: 7bit
From: Gary.Foster@Corp.Sun.COM (Gary D. Foster)
Date: 23 Jun 1997 15:25:21 -0700
Message-ID: <bciwwnl0xf2.fsf@corp.Sun.COM>
Lines: 68
X-Mailer: Gnus v5.4.59/XEmacs 20.3(beta8) - "Copenhagen"

--Multipart_Mon_Jun_23_15:25:21_1997-1
Content-Type: text/plain; charset=US-ASCII

Well, I decided I liked the cascading submenu for bookmarks (thanks
for the idea, Hrvoje) so I changed the delete bookmark submenu to
follow the same format.  I also fixed an oops in the original patch I
submitted, so back out the original Steve, and please use this
one... the original *is* broken.

-- Gary F.


--Multipart_Mon_Jun_23_15:25:21_1997-1
Content-Type: text/plain; charset=US-ASCII

--- lisp/x11/x-menubar.el.orig	Mon Jun 23 15:21:25 1997
+++ lisp/x11/x-menubar.el	Mon Jun 23 15:16:17 1997
@@ -1,3 +1,4 @@
+
 ;;; x-menubar.el --- Menubar and popup-menu support for X.
 
 ;; Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
@@ -82,14 +83,16 @@
       ["Replace (Regexp)..."	query-replace-regexp	t]
       "----"
       ("Bookmarks"
-       ["Jump to bookmark"  	bookmark-menu-jump	t]
+       ("Jump to bookmark"
+	:filter bookmark-menu-filter)
        ["Set bookmark"  	bookmark-set		t]
        "---"
        ["Insert contents"  	bookmark-menu-insert	t]
        ["Insert location"  	bookmark-menu-locate	t]
        "---"
        ["Rename bookmark"  	bookmark-menu-rename	t]
-       ["Delete bookmark"  	bookmark-menu-delete	t]
+       ("Delete bookmark"
+  	:filter bookmark-delete-filter)
        ["Edit Bookmark List"    bookmark-bmenu-list	t]
        "---"
        ["Save bookmarks"        bookmark-save		t]
@@ -836,6 +839,24 @@
     result))
 
 
+;;; The Bookmarks menu
+
+(defun bookmark-menu-filter (menu-items)
+  "*Build the bookmark jump submenu dynamically from all defined bookmarks."
+  (if (bookmark-all-names)
+      (mapcar
+       #'(lambda (bmk)
+	   (vector bmk `(bookmark-jump ',bmk) t)) (bookmark-all-names))
+    (list "No Bookmarks Set")))
+
+(defun bookmark-delete-filter (menu-items)
+  "*Build the bookmark delete submenu dynamically from all defined bookmarks."
+  (if (bookmark-all-names)
+      (mapcar
+       #'(lambda (bmk)
+	   (vector bmk `(bookmark-delete ',bmk) t)) (bookmark-all-names))
+    (list "No Bookmarks Set")))
+
 ;;; The Buffers menu
 
 (defvar buffers-menu-max-size 25

--Multipart_Mon_Jun_23_15:25:21_1997-1--

