Mercurial > emacs
comparison lisp/emacs-lisp/easymenu.el @ 45309:105aeedf106c
(easy-menu-make-symbol): Don't treat (lambda () ...) as an expression.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Wed, 15 May 2002 22:14:16 +0000 |
parents | 1d7fa08f7e4b |
children | 520292a3983b |
comparison
equal
deleted
inserted
replaced
45308:abd8a68f87a7 | 45309:105aeedf106c |
---|---|
408 | 408 |
409 (defun easy-menu-name-match (name item) | 409 (defun easy-menu-name-match (name item) |
410 "Return t if NAME is the name of menu item ITEM. | 410 "Return t if NAME is the name of menu item ITEM. |
411 NAME can be either a string, or a symbol." | 411 NAME can be either a string, or a symbol." |
412 (if (consp item) | 412 (if (consp item) |
413 (if (symbolp name) | 413 (if (symbolp name) |
414 (eq (car-safe item) name) | 414 (eq (car-safe item) name) |
415 (if (stringp name) | 415 (if (stringp name) |
416 ;; Match against the text that is displayed to the user. | 416 ;; Match against the text that is displayed to the user. |
417 (or (member-ignore-case name item) | 417 (or (member-ignore-case name item) |
418 ;; Also check the string version of the symbol name, | 418 ;; Also check the string version of the symbol name, |
432 \(i.e. does not need to be turned into a function)." | 432 \(i.e. does not need to be turned into a function)." |
433 (let ((command | 433 (let ((command |
434 (make-symbol (format "menu-function-%d" easy-menu-item-count)))) | 434 (make-symbol (format "menu-function-%d" easy-menu-item-count)))) |
435 (setq easy-menu-item-count (1+ easy-menu-item-count)) | 435 (setq easy-menu-item-count (1+ easy-menu-item-count)) |
436 (fset command | 436 (fset command |
437 (if (or (keymapp callback) noexp) callback | 437 (if (or (keymapp callback) (functionp callback) noexp) callback |
438 `(lambda () (interactive) ,callback))) | 438 `(lambda () (interactive) ,callback))) |
439 command)) | 439 command)) |
440 | 440 |
441 ;;;###autoload | 441 ;;;###autoload |
442 (defun easy-menu-change (path name items &optional before) | 442 (defun easy-menu-change (path name items &optional before) |