Commit f80efb86 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

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.
parent 31ca4639
2012-06-10 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/timer.el, emacs-lisp/syntax.el, emacs-lisp/smie.el:
* emacs-lisp/ewoc.el, emacs-lisp/cconv.el, emacs-lisp/bytecomp.el:
* emacs-lisp/byte-opt.el, emacs-lisp/autoload.el: Convert to cl-lib.
* emacs-lisp/easymenu.el, emacs-lisp/easy-mmode.el:
* emacs-lisp/derived.el: Use pcase instead of `cl'.
* emacs-lisp/cl-lib.el: Get rid of special cl-macs auto load.
2012-06-10 Glenn Morris <rgm@gnu.org>
 
* mail/rmail.el (rmail-yank-current-message): Leave point at
......@@ -9,8 +18,8 @@
 
2012-06-10 Chong Yidong <cyd@gnu.org>
 
* cus-edit.el (customize-changed-options-previous-release): Bump
to 24.1.
* cus-edit.el (customize-changed-options-previous-release):
Bump to 24.1.
 
2012-06-09 Andreas Schwab <schwab@linux-m68k.org>
 
......@@ -142,8 +151,8 @@
 
* textmodes/flyspell.el (flyspell-incorrect, flyspell-duplicate):
Likewise.
(flyspell-incorrect-face, flyspell-duplicate-face): Remove
obsolete aliases.
(flyspell-incorrect-face, flyspell-duplicate-face):
Remove obsolete aliases.
 
2012-06-08 Michael Albinus <michael.albinus@gmx.de>
 
......
......@@ -32,7 +32,7 @@
(require 'lisp-mode) ;for `doc-string-elt' properties.
(require 'help-fns) ;for help-add-fundoc-usage.
(eval-when-compile (require 'cl))
(eval-when-compile (require 'cl-lib))
(defvar generated-autoload-file nil
"File into which to write autoload definitions.
......@@ -154,7 +154,7 @@ expression, in which case we want to handle forms differently."
defun* defmacro* define-overloadable-function))
(let* ((macrop (memq car '(defmacro defmacro*)))
(name (nth 1 form))
(args (case car
(args (cl-case car
((defun defmacro defun* defmacro*
define-overloadable-function) (nth 2 form))
((define-skeleton) '(&optional str arg))
......@@ -546,7 +546,7 @@ Return non-nil if and only if FILE adds no autoloads to OUTFILE
(save-excursion
;; Insert the section-header line which lists the file name
;; and which functions are in it, etc.
(assert (= ostart output-start))
(cl-assert (= ostart output-start))
(goto-char output-start)
(let ((relfile (file-relative-name absfile)))
(autoload-insert-section-header
......
......@@ -183,7 +183,7 @@
;;; Code:
(require 'bytecomp)
(eval-when-compile (require 'cl))
(eval-when-compile (require 'cl-lib))
(require 'macroexp)
(defun byte-compile-log-lap-1 (format &rest args)
......@@ -642,7 +642,7 @@
(while (eq (car-safe form) 'progn)
(setq form (car (last (cdr form)))))
(cond ((consp form)
(case (car form)
(cl-case (car form)
(quote (cadr form))
;; Can't use recursion in a defsubst.
;; (progn (byte-compile-trueconstp (car (last (cdr form)))))
......@@ -656,7 +656,7 @@
(while (eq (car-safe form) 'progn)
(setq form (car (last (cdr form)))))
(cond ((consp form)
(case (car form)
(cl-case (car form)
(quote (null (cadr form)))
;; Can't use recursion in a defsubst.
;; (progn (byte-compile-nilconstp (car (last (cdr form)))))
......@@ -1376,7 +1376,7 @@
;; This uses dynamic-scope magic.
offset (disassemble-offset bytes))
(let ((opcode (aref byte-code-vector bytedecomp-op)))
(assert opcode)
(cl-assert opcode)
(setq bytedecomp-op opcode))
(cond ((memq bytedecomp-op byte-goto-ops)
;; It's a pc.
......@@ -1619,7 +1619,7 @@ If FOR-EFFECT is non-nil, the return value is assumed to be of no importance."
(byte-compile-log-lap " dup %s discard\t-->\t%s" lap1 lap1)
(setq keep-going t
rest (cdr rest))
(if (eq 'byte-stack-set (car lap1)) (decf (cdr lap1)))
(if (eq 'byte-stack-set (car lap1)) (cl-decf (cdr lap1)))
(setq lap (delq lap0 (delq lap2 lap))))
;;
;; not goto-X-if-nil --> goto-X-if-non-nil
......
......@@ -120,7 +120,7 @@
(require 'backquote)
(require 'macroexp)
(require 'cconv)
(eval-when-compile (require 'cl))
(eval-when-compile (require 'cl-lib))
(or (fboundp 'defsubst)
;; This really ought to be loaded already!
......@@ -738,7 +738,7 @@ BYTES and PC are updated after evaluating all the arguments."
(bytes-var (car (last args 2)))
(pc-var (car (last args))))
`(setq ,bytes-var ,(if (null (cdr byte-exprs))
`(progn (assert (<= 0 ,(car byte-exprs)))
`(progn (cl-assert (<= 0 ,(car byte-exprs)))
(cons ,@byte-exprs ,bytes-var))
`(nconc (list ,@(reverse byte-exprs)) ,bytes-var))
,pc-var (+ ,(length byte-exprs) ,pc-var))))
......@@ -1591,7 +1591,7 @@ that already has a `.elc' file."
(not (auto-save-file-name-p source))
(not (string-equal dir-locals-file
(file-name-nondirectory source))))
(progn (case (byte-recompile-file source force arg)
(progn (cl-case (byte-recompile-file source force arg)
(no-byte-compile (setq skip-count (1+ skip-count)))
((t) (setq file-count (1+ file-count)))
((nil) (setq fail-count (1+ fail-count))))
......@@ -1725,12 +1725,12 @@ The value is non-nil if there were no errors, nil if errors."
(set-buffer-multibyte nil))
;; Run hooks including the uncompression hook.
;; If they change the file name, then change it for the output also.
(letf ((buffer-file-name filename)
((default-value 'major-mode) 'emacs-lisp-mode)
;; Ignore unsafe local variables.
;; We only care about a few of them for our purposes.
(enable-local-variables :safe)
(enable-local-eval nil))
(cl-letf ((buffer-file-name filename)
((default-value 'major-mode) 'emacs-lisp-mode)
;; Ignore unsafe local variables.
;; We only care about a few of them for our purposes.
(enable-local-variables :safe)
(enable-local-eval nil))
;; Arg of t means don't alter enable-local-variables.
(normal-mode t)
;; There may be a file local variable setting (bug#10419).
......@@ -2611,7 +2611,7 @@ for symbols generated by the byte compiler itself."
(byte-compile-make-lambda-lexenv fun))
reserved-csts)))
;; Build the actual byte-coded function.
(assert (eq 'byte-code (car-safe compiled)))
(cl-assert (eq 'byte-code (car-safe compiled)))
(apply #'make-byte-code
(if lexical-binding
(byte-compile-make-args-desc arglist)
......@@ -2654,7 +2654,7 @@ for symbols generated by the byte compiler itself."
(while (and rest (< i limit))
(cond
((numberp (car rest))
(assert (< (car rest) byte-compile-reserved-constants)))
(cl-assert (< (car rest) byte-compile-reserved-constants)))
((setq tmp (assq (car (car rest)) ret))
(setcdr (car rest) (cdr tmp)))
(t
......@@ -2933,9 +2933,9 @@ That command is designed for interactive use only" fn))
(mapc 'byte-compile-form (cdr form))
(unless fmax2
;; Old-style byte-code.
(assert (listp fargs))
(cl-assert (listp fargs))
(while fargs
(case (car fargs)
(cl-case (car fargs)
(&optional (setq fargs (cdr fargs)))
(&rest (setq fmax2 (+ (* 2 (length dynbinds)) 1))
(push (cadr fargs) dynbinds)
......@@ -2954,7 +2954,7 @@ That command is designed for interactive use only" fn))
(t
;; Turn &rest args into a list.
(let ((n (- alen (/ (1- fmax2) 2))))
(assert (> n 0) nil "problem: fmax2=%S alen=%S n=%S" fmax2 alen n)
(cl-assert (> n 0) nil "problem: fmax2=%S alen=%S n=%S" fmax2 alen n)
(if (< n 5)
(byte-compile-out
(aref [byte-list1 byte-list2 byte-list3 byte-list4] (1- n))
......@@ -2967,7 +2967,7 @@ That command is designed for interactive use only" fn))
;; Unbind dynamic variables.
(when dynbinds
(byte-compile-out 'byte-unbind (length dynbinds)))
(assert (eq byte-compile-depth (1+ start-depth))
(cl-assert (eq byte-compile-depth (1+ start-depth))
nil "Wrong depth start=%s end=%s" start-depth byte-compile-depth)))
(defun byte-compile-check-variable (var access-type)
......@@ -2985,7 +2985,7 @@ That command is designed for interactive use only" fn))
(and od
(not (memq var byte-compile-not-obsolete-vars))
(not (memq var byte-compile-global-not-obsolete-vars))
(or (case (nth 1 od)
(or (cl-case (nth 1 od)
(set (not (eq access-type 'reference)))
(get (eq access-type 'reference))
(t t)))))
......@@ -3312,8 +3312,8 @@ discarding."
(body (nthcdr 3 form))
(fun
(byte-compile-lambda `(lambda ,vars . ,body) nil (length env))))
(assert (> (length env) 0)) ;Otherwise, we don't need a closure.
(assert (byte-code-function-p fun))
(cl-assert (> (length env) 0)) ;Otherwise, we don't need a closure.
(cl-assert (byte-code-function-p fun))
(byte-compile-form `(make-byte-code
',(aref fun 0) ',(aref fun 1)
(vconcat (vector . ,env) ',(aref fun 2))
......@@ -3891,8 +3891,8 @@ binding slots have been popped."
(if lexical-binding
;; Unbind both lexical and dynamic variables.
(progn
(assert (or (eq byte-compile-depth init-stack-depth)
(eq byte-compile-depth (1+ init-stack-depth))))
(cl-assert (or (eq byte-compile-depth init-stack-depth)
(eq byte-compile-depth (1+ init-stack-depth))))
(byte-compile-unbind clauses init-lexenv (> byte-compile-depth
init-stack-depth)))
;; Unbind dynamic variables.
......@@ -4312,7 +4312,7 @@ invoked interactively."
(if byte-compile-call-tree-sort
(setq byte-compile-call-tree
(sort byte-compile-call-tree
(case byte-compile-call-tree-sort
(cl-case byte-compile-call-tree-sort
(callers
(lambda (x y) (< (length (nth 1 x))
(length (nth 1 y)))))
......
......@@ -110,7 +110,7 @@
;; ,@(mapcar (lambda (binder) (if (consp binder) (cadr binder)))
;; binders)))
(eval-when-compile (require 'cl))
(eval-when-compile (require 'cl-lib))
(defconst cconv-liftwhen 6
"Try to do lambda lifting if the number of arguments + free variables
......@@ -173,7 +173,7 @@ Returns a form where all lambdas don't have any free variables."
;; Here we assume that X appears at most once in M.
(let* ((b (assq x m))
(res (if b (remq b m) m)))
(assert (null (assq x res))) ;; Check the assumption was warranted.
(cl-assert (null (assq x res))) ;; Check the assumption was warranted.
res))
(defun cconv--map-diff-set (m s)
......@@ -185,7 +185,7 @@ Returns a form where all lambdas don't have any free variables."
(nreverse res)))
(defun cconv--convert-function (args body env parentform)
(assert (equal body (caar cconv-freevars-alist)))
(cl-assert (equal body (caar cconv-freevars-alist)))
(let* ((fvs (cdr (pop cconv-freevars-alist)))
(body-new '())
(letbind '())
......@@ -251,11 +251,11 @@ ENV is a list where each entry takes the shape either:
EXTEND is a list of variables which might need to be accessed even from places
where they are shadowed, because some part of ENV causes them to be used at
places where they originally did not directly appear."
(assert (not (delq nil (mapcar (lambda (mapping)
(if (eq (cadr mapping) 'apply-partially)
(cconv--set-diff (cdr (cddr mapping))
extend)))
env))))
(cl-assert (not (delq nil (mapcar (lambda (mapping)
(if (eq (cadr mapping) 'apply-partially)
(cconv--set-diff (cdr (cddr mapping))
extend)))
env))))
;; What's the difference between fvrs and envs?
;; Suppose that we have the code
......@@ -287,10 +287,10 @@ places where they originally did not directly appear."
;; Check if var is a candidate for lambda lifting.
((and (member (cons binder form) cconv-lambda-candidates)
(progn
(assert (and (eq (car value) 'function)
(eq (car (cadr value)) 'lambda)))
(assert (equal (cddr (cadr value))
(caar cconv-freevars-alist)))
(cl-assert (and (eq (car value) 'function)
(eq (car (cadr value)) 'lambda)))
(cl-assert (equal (cddr (cadr value))
(caar cconv-freevars-alist)))
;; Peek at the freevars to decide whether to λ-lift.
(let* ((fvs (cdr (car cconv-freevars-alist)))
(fun (cadr value))
......@@ -307,7 +307,7 @@ places where they originally did not directly appear."
(funcbody-env ()))
(push `(,var . (apply-partially ,var . ,fvs)) new-env)
(dolist (fv fvs)
(pushnew fv new-extend)
(cl-pushnew fv new-extend)
(if (and (eq 'car (car-safe (cdr (assq fv env))))
(not (memq fv funargs)))
(push `(,fv . (car ,fv)) funcbody-env)))
......@@ -345,14 +345,14 @@ places where they originally did not directly appear."
(mapcar (lambda (mapping)
(if (not (eq (cadr mapping) 'apply-partially))
mapping
(assert (eq (car mapping) (nth 2 mapping)))
(list* (car mapping)
'apply-partially
(car mapping)
(mapcar (lambda (arg)
(if (eq var arg)
closedsym arg))
(nthcdr 3 mapping)))))
(cl-assert (eq (car mapping) (nth 2 mapping)))
(cl-list* (car mapping)
'apply-partially
(car mapping)
(mapcar (lambda (arg)
(if (eq var arg)
closedsym arg))
(nthcdr 3 mapping)))))
new-env))
(setq new-extend (remq var new-extend))
(push closedsym new-extend)
......@@ -455,7 +455,7 @@ places where they originally did not directly appear."
(let ((mapping (cdr (assq fun env))))
(pcase mapping
(`(apply-partially ,_ . ,(and fvs `(,_ . ,_)))
(assert (eq (cadr mapping) fun))
(cl-assert (eq (cadr mapping) fun))
`(,callsym ,fun
,@(mapcar (lambda (fv)
(let ((exp (or (cdr (assq fv env)) fv)))
......@@ -551,7 +551,7 @@ FORM is the parent form that binds this var."
;; Transfer uses collected in `envcopy' (via `newenv') back to `env';
;; and compute free variables.
(while env
(assert (and envcopy (eq (caar env) (caar envcopy))))
(cl-assert (and envcopy (eq (caar env) (caar envcopy))))
(let ((free nil)
(x (cdr (car env)))
(y (cdr (car envcopy))))
......@@ -559,8 +559,8 @@ FORM is the parent form that binds this var."
(when (car y) (setcar x t) (setq free t))
(setq x (cdr x) y (cdr y)))
(when free
(push (caar env) (cdr freevars))
(setf (nth 3 (car env)) t))
(cl-push (caar env) (cdr freevars))
(cl-setf (nth 3 (car env)) t))
(setq env (cdr env) envcopy (cdr envcopy))))))
(defun cconv-analyse-form (form env)
......@@ -610,7 +610,7 @@ and updates the data stored in ENV."
;; it is a mutated variable.
(while forms
(let ((v (assq (car forms) env))) ; v = non nil if visible
(when v (setf (nth 2 v) t)))
(when v (cl-setf (nth 2 v) t)))
(cconv-analyse-form (cadr forms) env)
(setq forms (cddr forms))))
......@@ -656,7 +656,7 @@ and updates the data stored in ENV."
;; lambda candidate list.
(let ((fdata (and (symbolp fun) (assq fun env))))
(if fdata
(setf (nth 4 fdata) t)
(cl-setf (nth 4 fdata) t)
(cconv-analyse-form fun env)))
(dolist (form args) (cconv-analyse-form form env)))
......@@ -676,7 +676,7 @@ and updates the data stored in ENV."
((pred symbolp)
(let ((dv (assq form env))) ; dv = declared and visible
(when dv
(setf (nth 1 dv) t))))))
(cl-setf (nth 1 dv) t))))))
(provide 'cconv)
;;; cconv.el ends here
......@@ -644,29 +644,6 @@ If ALIST is non-nil, the new pairs are prepended to it."
(load "cl-loaddefs" nil 'quiet)
;; This goes here so that cl-macs can find it if it loads right now.
(provide 'cl-lib)
;; Things to do after byte-compiler is loaded.
(defvar cl-hacked-flag nil)
(defun cl-hack-byte-compiler ()
(and (not cl-hacked-flag) (fboundp 'byte-compile-file-form)
(progn
(setq cl-hacked-flag t) ; Do it first, to prevent recursion.
(load "cl-macs" nil t)
(run-hooks 'cl-hack-bytecomp-hook))))
;; Try it now in case the compiler has already been loaded.
(cl-hack-byte-compiler)
;; Also make a hook in case compiler is loaded after this file.
(add-hook 'bytecomp-load-hook 'cl-hack-byte-compiler)
;; The following ensures that packages which expect the old-style cl.el
;; will be happy with this one.
(provide 'cl-lib)
(run-hooks 'cl-load-hook)
......
......@@ -90,8 +90,6 @@
;;; Code:
(eval-when-compile (require 'cl))
;;; PRIVATE: defsubst must be defined before they are first used
(defsubst derived-mode-hook-name (mode)
......@@ -183,11 +181,11 @@ See Info node `(elisp)Derived Modes' for more details."
;; Process the keyword args.
(while (keywordp (car body))
(case (pop body)
(:group (setq group (pop body)))
(:abbrev-table (setq abbrev (pop body)) (setq declare-abbrev nil))
(:syntax-table (setq syntax (pop body)) (setq declare-syntax nil))
(t (pop body))))
(pcase (pop body)
(`:group (setq group (pop body)))
(`:abbrev-table (setq abbrev (pop body)) (setq declare-abbrev nil))
(`:syntax-table (setq syntax (pop body)) (setq declare-syntax nil))
(_ (pop body))))
(setq docstring (derived-mode-make-docstring
parent child docstring syntax abbrev))
......
......@@ -51,8 +51,6 @@
;;; Code:
(eval-when-compile (require 'cl))
(defun easy-mmode-pretty-mode-name (mode &optional lighter)
"Turn the symbol MODE into a string intended for the user.
If provided, LIGHTER will be used to help choose capitalization by,
......@@ -153,10 +151,10 @@ For example, you could write
;; Allow skipping the first three args.
(cond
((keywordp init-value)
(setq body (list* init-value lighter keymap body)
(setq body `(,init-value ,lighter ,keymap ,@body)
init-value nil lighter nil keymap nil))
((keywordp lighter)
(setq body (list* lighter keymap body) lighter nil keymap nil))
(setq body `(,lighter ,keymap ,@body) lighter nil keymap nil))
((keywordp keymap) (push keymap body) (setq keymap nil)))
(let* ((last-message (make-symbol "last-message"))
......@@ -182,18 +180,18 @@ For example, you could write
;; Check keys.
(while (keywordp (setq keyw (car body)))
(setq body (cdr body))
(case keyw
(:init-value (setq init-value (pop body)))
(:lighter (setq lighter (purecopy (pop body))))
(:global (setq globalp (pop body)))
(:extra-args (setq extra-args (pop body)))
(:set (setq set (list :set (pop body))))
(:initialize (setq initialize (list :initialize (pop body))))
(:group (setq group (nconc group (list :group (pop body)))))
(:type (setq type (list :type (pop body))))
(:require (setq require (pop body)))
(:keymap (setq keymap (pop body)))
(:variable (setq variable (pop body))
(pcase keyw
(`:init-value (setq init-value (pop body)))
(`:lighter (setq lighter (purecopy (pop body))))
(`:global (setq globalp (pop body)))
(`:extra-args (setq extra-args (pop body)))
(`:set (setq set (list :set (pop body))))
(`:initialize (setq initialize (list :initialize (pop body))))
(`:group (setq group (nconc group (list :group (pop body)))))
(`:type (setq type (list :type (pop body))))
(`:require (setq require (pop body)))
(`:keymap (setq keymap (pop body)))
(`:variable (setq variable (pop body))
(if (not (and (setq tmp (cdr-safe variable))
(or (symbolp tmp)
(functionp tmp))))
......@@ -201,8 +199,8 @@ For example, you could write
(setq mode variable)
(setq mode (car variable))
(setq setter (cdr variable))))
(:after-hook (setq after-hook (pop body)))
(t (push keyw extra-keywords) (push (pop body) extra-keywords))))
(`:after-hook (setq after-hook (pop body)))
(_ (push keyw extra-keywords) (push (pop body) extra-keywords))))
(setq keymap-sym (if (and keymap (symbolp keymap)) keymap
(intern (concat mode-name "-map"))))
......@@ -355,10 +353,10 @@ call another major mode in their body."
;; Check keys.
(while (keywordp (setq keyw (car keys)))
(setq keys (cdr keys))
(case keyw
(:group (setq group (nconc group (list :group (pop keys)))))
(:global (setq keys (cdr keys)))
(t (push keyw extra-keywords) (push (pop keys) extra-keywords))))
(pcase keyw
(`:group (setq group (nconc group (list :group (pop keys)))))
(`:global (setq keys (cdr keys)))
(_ (push keyw extra-keywords) (push (pop keys) extra-keywords))))
(unless group
;; We might as well provide a best-guess default group.
......@@ -479,13 +477,13 @@ Valid keywords and arguments are:
(while args
(let ((key (pop args))
(val (pop args)))
(case key
(:name (setq name val))
(:dense (setq dense val))
(:inherit (setq inherit val))
(:suppress (setq suppress val))
(:group)
(t (message "Unknown argument %s in defmap" key)))))
(pcase key
(`:name (setq name val))
(`:dense (setq dense val))
(`:inherit (setq inherit val))
(`:suppress (setq suppress val))
(`:group)
(_ (message "Unknown argument %s in defmap" key)))))
(unless (keymapp m)
(setq bs (append m bs))
(setq m (if dense (make-keymap name) (make-sparse-keymap name))))
......
......@@ -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)
......
......@@ -96,11 +96,11 @@
;;; Code:
(eval-when-compile (require 'cl))
(eval-when-compile (require 'cl-lib))
;; The doubly linked list is implemented as a circular list with a dummy
;; node first and last. The dummy node is used as "the dll".
(defstruct (ewoc--node
(cl-defstruct (ewoc--node
(:type vector) ;ewoc--node-nth needs this
(:constructor nil)
(:constructor ewoc--node-create (start-marker data)))
......@@ -140,7 +140,7 @@ and (ewoc--node-nth dll -1) returns the last node."