diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2012-06-22 09:42:38 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2012-06-22 09:42:38 -0400 |
commit | 2ee3d7f0aa6c29fec22e663b016a05762eb1e0d0 (patch) | |
tree | 19ac74456e7bc4456da06dc7bdf401877133372c /lisp/emacs-lisp/cconv.el | |
parent | 575db3f1a8c6978df9d69f49dedd1bff15c73a9d (diff) | |
download | emacs-2ee3d7f0aa6c29fec22e663b016a05762eb1e0d0.tar.gz |
Provide generalized variables in core Elisp.
* lisp/emacs-lisp/gv.el: New file.
* lisp/subr.el (push, pop): Extend to generalized variables.
* lisp/loadup.el (macroexp): Unload if preloaded and uncompiled.
* lisp/emacs-lisp/cl-lib.el (cl-pop, cl-push, cl--set-nthcdr): Remove.
* lisp/emacs-lisp/cl-macs.el: Require gv. Use gv-define-setter,
gv-define-simple-setter, and gv-define-expander.
Remove setf-methods defined in gv. Rename cl-setf -> setf.
(cl-setf, cl-do-pop, cl-get-setf-method): Remove.
(cl-letf, cl-letf*, cl-define-modify-macro, cl-defsetf)
(cl-define-setf-expander, cl-struct-setf-expander): Move to cl.el.
(cl-remf, cl-shiftf, cl-rotatef, cl-callf, cl-callf2): Rewrite with
gv-letplace.
(cl-defstruct): Don't define setf-method any more.
* lisp/emacs-lisp/cl.el (flet): Don't autoload.
(cl--letf, letf, cl--letf*, letf*, cl--gv-adapt)
(define-setf-expander, defsetf, define-modify-macro)
(cl-struct-setf-expander): Move from cl-lib.el.
* lisp/emacs-lisp/syntax.el:
* lisp/emacs-lisp/ewoc.el:
* lisp/emacs-lisp/smie.el:
* lisp/emacs-lisp/cconv.el:
* lisp/emacs-lisp/timer.el: Rename cl-setf -> setf, cl-push -> push.
(timer--time): Use gv-define-simple-setter.
* lisp/emacs-lisp/macroexp.el (macroexp-let2): Rename from macroexp-let²
to avoid coding-system problems in subr.el. Adjust all users.
(macroexp--maxsize, macroexp-small-p): New functions.
* lisp/emacs-lisp/bytecomp.el (byte-compile-file): Don't use cl-letf.
* lisp/scroll-bar.el (scroll-bar-mode):
* lisp/simple.el (auto-fill-mode, overwrite-mode, binary-overwrite-mode)
(normal-erase-is-backspace-mode): Don't use the `eq' place.
* lisp/winner.el (winner-configuration, winner-make-point-alist)
(winner-set-conf, winner-get-point, winner-set): Don't abuse letf.
* lisp/files.el (locate-file-completion-table): Avoid list*.
Fixes: debbugs:11657
Diffstat (limited to 'lisp/emacs-lisp/cconv.el')
-rw-r--r-- | lisp/emacs-lisp/cconv.el | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lisp/emacs-lisp/cconv.el b/lisp/emacs-lisp/cconv.el index 6f411bdeb30..5a1d6265848 100644 --- a/lisp/emacs-lisp/cconv.el +++ b/lisp/emacs-lisp/cconv.el @@ -346,13 +346,13 @@ places where they originally did not directly appear." (if (not (eq (cadr mapping) 'apply-partially)) 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))))) + `(,(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) @@ -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 - (cl-push (caar env) (cdr freevars)) - (cl-setf (nth 3 (car env)) t)) + (push (caar env) (cdr freevars)) + (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 (cl-setf (nth 2 v) t))) + (when v (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 - (cl-setf (nth 4 fdata) t) + (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 - (cl-setf (nth 1 dv) t)))))) + (setf (nth 1 dv) t)))))) (provide 'cconv) ;;; cconv.el ends here |