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/winner.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/winner.el')
-rw-r--r-- | lisp/winner.el | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/winner.el b/lisp/winner.el index ef7b0c2a3ce..10595ed4b5a 100644 --- a/lisp/winner.el +++ b/lisp/winner.el @@ -138,7 +138,7 @@ You may want to include buffer names such as *Help*, *Apropos*, ;; Consult `winner-currents'. (defun winner-configuration (&optional frame) (or (cdr (assq (or frame (selected-frame)) winner-currents)) - (letf (((selected-frame) frame)) + (with-selected-frame frame (winner-conf)))) @@ -248,7 +248,7 @@ You may want to include buffer names such as *Help*, *Apropos*, ((window-minibuffer-p (selected-window)) (other-window 1))) (when (/= minisize (window-height miniwin)) - (letf (((selected-window) miniwin) ) + (with-selected-window miniwin (setf (window-height) minisize))))) @@ -261,7 +261,7 @@ You may want to include buffer names such as *Help*, *Apropos*, ;; Format of entries: (buffer (mark . mark-active) (window . point) ..) (defun winner-make-point-alist () - (letf (((current-buffer))) + (save-current-buffer (loop with alist for win in (winner-window-list) for entry = @@ -282,10 +282,10 @@ You may want to include buffer names such as *Help*, *Apropos*, (entry (or (cdr (assq win (cddr entry))) (cdr (assq nil (cddr entry))) - (letf (((current-buffer) buf)) + (with-current-buffer buf (push (cons nil (point)) (cddr entry)) (point)))) - (t (letf (((current-buffer) buf)) + (t (with-current-buffer buf (push (list buf (cons (mark t) (winner-active-region)) (cons nil (point))) @@ -320,7 +320,7 @@ You may want to include buffer names such as *Help*, *Apropos*, (push win xwins))) ; delete this window ;; Restore marks - (letf (((current-buffer))) + (save-current-buffer (loop for buf in buffers for entry = (cadr (assq buf winner-point-alist)) do (progn (set-buffer buf) |