mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
* lisp/emacs-lisp/cl.el (flet): Mark obsolete.
* lisp/emacs-lisp/cl-macs.el (cl-flet*): New macro. * lisp/vc/vc-rcs.el (vc-rcs-annotate-command, vc-rcs-parse): * lisp/progmodes/js.el (js-c-fill-paragraph): * lisp/progmodes/ebrowse.el (ebrowse-switch-member-buffer-to-sibling-class) (ebrowse-switch-member-buffer-to-derived-class): * test/automated/ert-x-tests.el (ert-test-run-tests-interactively-2): * lisp/play/5x5.el (5x5-solver): Use cl-flet. Fixes: debbugs:11780
This commit is contained in:
parent
7b953864ba
commit
d5c6faf921
11 changed files with 231 additions and 191 deletions
|
|
@ -1570,7 +1570,6 @@ a `let' form, except that the list of symbols can be computed at run-time."
|
|||
(setq cl--labels-convert-cache (cons f res))
|
||||
res))))))
|
||||
|
||||
;;; This should really have some way to shadow 'byte-compile properties, etc.
|
||||
;;;###autoload
|
||||
(defmacro cl-flet (bindings &rest body)
|
||||
"Make temporary function definitions.
|
||||
|
|
@ -1595,6 +1594,18 @@ Like `cl-labels' but the definitions are not recursive.
|
|||
(if (assq 'function newenv) newenv
|
||||
(cons (cons 'function #'cl--labels-convert) newenv)))))))
|
||||
|
||||
;;;###autoload
|
||||
(defmacro cl-flet* (bindings &rest body)
|
||||
"Make temporary function definitions.
|
||||
Like `cl-flet' but the definitions can refer to previous ones.
|
||||
|
||||
\(fn ((FUNC ARGLIST BODY...) ...) FORM...)"
|
||||
(declare (indent 1) (debug ((&rest (cl-defun)) cl-declarations body)))
|
||||
(cond
|
||||
((null bindings) (macroexp-progn body))
|
||||
((null (cdr bindings)) `(cl-flet ,bindings ,@body))
|
||||
(t `(cl-flet (,(pop bindings)) (cl-flet* ,bindings ,@body)))))
|
||||
|
||||
;;;###autoload
|
||||
(defmacro cl-labels (bindings &rest body)
|
||||
"Make temporary function bindings.
|
||||
|
|
@ -2257,6 +2268,7 @@ STRING is an optional description of the desired type."
|
|||
|
||||
;;;###autoload
|
||||
(defmacro cl-assert (form &optional show-args string &rest args)
|
||||
;; FIXME: This is actually not compatible with Common-Lisp's `assert'.
|
||||
"Verify that FORM returns non-nil; signal an error if not.
|
||||
Second arg SHOW-ARGS means to include arguments of FORM in message.
|
||||
Other args STRING and ARGS... are arguments to be passed to `error'.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue