aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/emacs-lisp/easymenu.el
diff options
context:
space:
mode:
authorKaroly Lorentey2004-11-13 18:34:40 +0000
committerKaroly Lorentey2004-11-13 18:34:40 +0000
commite417405015c93c81641f5c4a33ec898b5c353772 (patch)
tree017a980c35c8a71c372304418d151e3826f88636 /lisp/emacs-lisp/easymenu.el
parentf590a2a442d19f3a74d7bbd02bbcb4e3239f2327 (diff)
parent68d1b30d251b4771f739d20f507cd9523ae3919b (diff)
downloademacs-e417405015c93c81641f5c4a33ec898b5c353772.tar.gz
emacs-e417405015c93c81641f5c4a33ec898b5c353772.zip
Merged in changes from CVS trunk.
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-673 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-674 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-675 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-676 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-677 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-678 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-679 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-680 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-681 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-682 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-683 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-684 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-685 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-686 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-687 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-688 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-690 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-691 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-692 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-693 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-69 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-70 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-71 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-267
Diffstat (limited to 'lisp/emacs-lisp/easymenu.el')
-rw-r--r--lisp/emacs-lisp/easymenu.el35
1 files changed, 6 insertions, 29 deletions
diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el
index 7b18756fd7e..b0f3b9b9d3e 100644
--- a/lisp/emacs-lisp/easymenu.el
+++ b/lisp/emacs-lisp/easymenu.el
@@ -42,25 +42,7 @@ menus, turn this variable off, otherwise it is probably better to keep it on."
42 :version "20.3") 42 :version "20.3")
43 43
44(defsubst easy-menu-intern (s) 44(defsubst easy-menu-intern (s)
45 (if (stringp s) 45 (if (stringp s) (intern s) s))
46 (let ((copy (copy-sequence s))
47 (pos 0)
48 found)
49 ;; For each letter that starts a word, flip its case.
50 ;; This way, the usual convention for menu strings (capitalized)
51 ;; corresponds to the usual convention for menu item event types
52 ;; (all lower case). It's a 1-1 mapping so causes no conflicts.
53 (while (setq found (string-match "\\<\\sw" copy pos))
54 (setq pos (match-end 0))
55 (unless (= (upcase (aref copy found))
56 (downcase (aref copy found)))
57 (aset copy found
58 (if (= (upcase (aref copy found))
59 (aref copy found))
60 (downcase (aref copy found))
61 (upcase (aref copy found))))))
62 (intern copy))
63 s))
64 46
65;;;###autoload 47;;;###autoload
66(put 'easy-menu-define 'lisp-indent-function 'defun) 48(put 'easy-menu-define 'lisp-indent-function 'defun)
@@ -396,6 +378,7 @@ otherwise put the new binding last in MENU.
396BEFORE can be either a string (menu item name) or a symbol 378BEFORE can be either a string (menu item name) or a symbol
397\(the fake function key for the menu item). 379\(the fake function key for the menu item).
398KEY does not have to be a symbol, and comparison is done with equal." 380KEY does not have to be a symbol, and comparison is done with equal."
381 (if (symbolp menu) (setq menu (indirect-function menu)))
399 (let ((inserted (null item)) ; Fake already inserted. 382 (let ((inserted (null item)) ; Fake already inserted.
400 tail done) 383 tail done)
401 (while (not done) 384 (while (not done)
@@ -437,8 +420,7 @@ ITEM should be a keymap binding of the form (KEY . MENU-ITEM)."
437 (error nil)) ;`item' might not be a proper list. 420 (error nil)) ;`item' might not be a proper list.
438 ;; Also check the string version of the symbol name, 421 ;; Also check the string version of the symbol name,
439 ;; for backwards compatibility. 422 ;; for backwards compatibility.
440 (eq (car-safe item) (intern name)) 423 (eq (car-safe item) (intern name)))))))
441 (eq (car-safe item) (easy-menu-intern name)))))))
442 424
443(defun easy-menu-always-true-p (x) 425(defun easy-menu-always-true-p (x)
444 "Return true if form X never evaluates to nil." 426 "Return true if form X never evaluates to nil."
@@ -541,15 +523,10 @@ earlier by `easy-menu-define' or `easy-menu-create-menu'."
541 (easy-menu-define-key map (easy-menu-intern (car item)) 523 (easy-menu-define-key map (easy-menu-intern (car item))
542 (cdr item) before) 524 (cdr item) before)
543 (if (or (keymapp item) 525 (if (or (keymapp item)
544 (and (symbolp item) (keymapp (symbol-value item)))) 526 (and (symbolp item) (keymapp (symbol-value item))
527 (setq item (symbol-value item))))
545 ;; Item is a keymap, find the prompt string and use as item name. 528 ;; Item is a keymap, find the prompt string and use as item name.
546 (let ((tail (easy-menu-get-map item nil)) name) 529 (setq item (cons (keymap-prompt item) item)))
547 (if (not (keymapp item)) (setq item tail))
548 (while (and (null name) (consp (setq tail (cdr tail)))
549 (not (keymapp tail)))
550 (if (stringp (car tail)) (setq name (car tail)) ; Got a name.
551 (setq tail (cdr tail))))
552 (setq item (cons name item))))
553 (easy-menu-do-add-item map item before))) 530 (easy-menu-do-add-item map item before)))
554 531
555(defun easy-menu-item-present-p (map path name) 532(defun easy-menu-item-present-p (map path name)