diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2012-06-10 09:28:26 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2012-06-10 09:28:26 -0400 |
commit | f80efb8695cd8b4480c5f041c484beb5486afb37 (patch) | |
tree | 11cdf753a8e8a270fa79eb1dc794aa8426d3893e /lisp/emacs-lisp/easymenu.el | |
parent | 31ca4639ad1bfaa355a3f30ef92eb977bd2c6b78 (diff) | |
download | emacs-f80efb8695cd8b4480c5f041c484beb5486afb37.tar.gz |
Reduce use of cl in lisp/emacs-lisp/.
* lisp/emacs-lisp/timer.el, lisp/emacs-lisp/syntax.el, lisp/emacs-lisp/smie.el:
* lisp/emacs-lisp/ewoc.el, lisp/emacs-lisp/cconv.el,lisp/emacs-lisp/derived.el:
* lisp/emacs-lisp/byte-opt.el, lisp/emacs-lisp/autoload.el: Convert to cl-lib.
* lisp/emacs-lisp/easymenu.el, lisp/emacs-lisp/easy-mmode.el:
* lisp/emacs-lisp/bytecomp.el: Use pcase instead of `cl'.
* lisp/emacs-lisp/cl-lib.el: Get rid of special cl-macs auto load.
Diffstat (limited to 'lisp/emacs-lisp/easymenu.el')
-rw-r--r-- | lisp/emacs-lisp/easymenu.el | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el index b3e54b415d8..7f9f8a33634 100644 --- a/lisp/emacs-lisp/easymenu.el +++ b/lisp/emacs-lisp/easymenu.el @@ -29,8 +29,6 @@ ;;; Code: -(eval-when-compile (require 'cl)) - (defvar easy-menu-precalculate-equivalent-keybindings nil "Determine when equivalent key bindings are computed for easy-menu menus. It can take some time to calculate the equivalent key bindings that are shown @@ -236,14 +234,14 @@ possibly preceded by keyword pairs as described in `easy-menu-define'." (keywordp (setq keyword (car menu-items)))) (setq arg (cadr menu-items)) (setq menu-items (cddr menu-items)) - (case keyword - (:filter + (pcase keyword + (`:filter (setq filter `(lambda (menu) (easy-menu-filter-return (,arg menu) ,menu-name)))) - ((:enable :active) (setq enable (or arg ''nil))) - (:label (setq label arg)) - (:help (setq help arg)) - ((:included :visible) (setq visible (or arg ''nil))))) + ((or `:enable `:active) (setq enable (or arg ''nil))) + (`:label (setq label arg)) + (`:help (setq help arg)) + ((or `:included `:visible) (setq visible (or arg ''nil))))) (if (equal visible ''nil) nil ; Invisible menu entry, return nil. (if (and visible (not (easy-menu-always-true-p visible))) @@ -334,16 +332,16 @@ ITEM defines an item as in `easy-menu-define'." (setq keyword (aref item count)) (setq arg (aref item (1+ count))) (setq count (+ 2 count)) - (case keyword - ((:included :visible) (setq visible (or arg ''nil))) - (:key-sequence (setq cache arg cache-specified t)) - (:keys (setq keys arg no-name nil)) - (:label (setq label arg)) - ((:active :enable) (setq active (or arg ''nil))) - (:help (setq prop (cons :help (cons arg prop)))) - (:suffix (setq suffix arg)) - (:style (setq style arg)) - (:selected (setq selected (or arg ''nil))))) + (pcase keyword + ((or `:included `:visible) (setq visible (or arg ''nil))) + (`:key-sequence (setq cache arg cache-specified t)) + (`:keys (setq keys arg no-name nil)) + (`:label (setq label arg)) + ((or `:active `:enable) (setq active (or arg ''nil))) + (`:help (setq prop (cons :help (cons arg prop)))) + (`:suffix (setq suffix arg)) + (`:style (setq style arg)) + (`:selected (setq selected (or arg ''nil))))) (if suffix (setq label (if (stringp suffix) |