From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Newsgroups: gmane.emacs.devel Subject: Re: easymenu.el Date: Sat, 06 Nov 2004 05:07:56 -0500 Message-ID: References: <41891091.7010304@freemail.hu> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1099924169 13696 80.91.229.6 (8 Nov 2004 14:29:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 8 Nov 2004 14:29:29 +0000 (UTC) Cc: Peter Heslin , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 08 15:29:18 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CRAWE-0000pX-00 for ; Mon, 08 Nov 2004 15:29:18 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CRAeZ-0005av-Su for ged-emacs-devel@m.gmane.org; Mon, 08 Nov 2004 09:37:55 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CRAdg-0005AQ-1j for emacs-devel@gnu.org; Mon, 08 Nov 2004 09:37:00 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CRAdd-00059J-IQ for emacs-devel@gnu.org; Mon, 08 Nov 2004 09:36:57 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CRAdd-00058Y-DH for emacs-devel@gnu.org; Mon, 08 Nov 2004 09:36:57 -0500 Original-Received: from [206.47.199.163] (helo=simmts5-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CRAUv-0007Se-De; Mon, 08 Nov 2004 09:27:57 -0500 Original-Received: from empanada.home ([67.68.218.250]) by simmts5-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20041108142756.FQTZ1799.simmts5-srv.bellnexxia.net@empanada.home>; Mon, 8 Nov 2004 09:27:56 -0500 Original-Received: by empanada.local (Postfix, from userid 502) id 22061354D09; Sat, 6 Nov 2004 05:07:56 -0500 (EST) Original-To: rms@gnu.org In-Reply-To: (Richard Stallman's message of "Sat, 06 Nov 2004 00:22:51 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (darwin) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:29574 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:29574 > The reason I changed easy-menu-intern to alter the name is so that > easy-menu would work with the standard menu items. For instance, the > Options menu uses `options' as the symbol. I changed easy-menu-intern > so it would convert "Options" into `options'. > If we take out this change, then either (1) we have to change the > symbols used in menu-bar.el, so that the Options menu uses `Options' as the > symbol, or (2) easy-menu will not work with those menus any more. Option (2) cannot really be true, because those things have never worked with easy-menu (at least not in any released version of Emacs). > If we do (1), then programs that call define-key to set up menu items > in these menus will break. However, I don't know how many of those > programs there are. Since this downcase-change is recent, only recently changed programs can be affected and since we'd be getting back to Emacs-21.3 behavior, those program would fail under Emacs-21.3 as well. BTW, I've just installed a patch to easymenu that makes it look for menu-item *names* when looking up keymaps, so you should now be able to say (easy-menu-add-item nil '("File") ["foo" bar]) to add an entry "foo" in the "File" menu even though that menu's key name is `files'. As can be guessed by the different spelling, this now works regardless of the actual definition of easy-menu-intern, so I (re-)propose the additional patch below, Stefan --- easymenu.el 06 Nov 2004 04:58:18 -0500 1.67 +++ easymenu.el 06 Nov 2004 05:06:15 -0500 @@ -42,25 +42,7 @@ :version "20.3") (defsubst easy-menu-intern (s) - (if (stringp s) - (let ((copy (copy-sequence s)) - (pos 0) - found) - ;; For each letter that starts a word, flip its case. - ;; This way, the usual convention for menu strings (capitalized) - ;; corresponds to the usual convention for menu item event types - ;; (all lower case). It's a 1-1 mapping so causes no conflicts. - (while (setq found (string-match "\\<\\sw" copy pos)) - (setq pos (match-end 0)) - (unless (= (upcase (aref copy found)) - (downcase (aref copy found))) - (aset copy found - (if (= (upcase (aref copy found)) - (aref copy found)) - (downcase (aref copy found)) - (upcase (aref copy found)))))) - (intern copy)) - s)) + (if (stringp s) (intern s) s)) ;;;###autoload (put 'easy-menu-define 'lisp-indent-function 'defun) @@ -437,8 +419,7 @@ (error nil)) ;`item' might not be a proper list. ;; Also check the string version of the symbol name, ;; for backwards compatibility. - (eq (car-safe item) (intern name)) - (eq (car-safe item) (easy-menu-intern name))))))) + (eq (car-safe item) (intern name))))))) (defun easy-menu-always-true-p (x) "Return true if form X never evaluates to nil."