diff options
| author | Stefan Monnier | 2001-11-30 08:23:25 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2001-11-30 08:23:25 +0000 |
| commit | 2fa5eef4caa14950d4e08e93922288c6d7af4d16 (patch) | |
| tree | 06e7e62edbc33b3d73c27edfecff1b904e73355a | |
| parent | d006d95766d167759962b916cacbc2fd7c94d05c (diff) | |
| download | emacs-2fa5eef4caa14950d4e08e93922288c6d7af4d16.tar.gz emacs-2fa5eef4caa14950d4e08e93922288c6d7af4d16.zip | |
(shiftf): Fix more. Simplify.
| -rw-r--r-- | lisp/ChangeLog | 12 | ||||
| -rw-r--r-- | lisp/emacs-lisp/cl-macs.el | 25 |
2 files changed, 20 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 55f9f49edf0..a6c59ea220c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,17 @@ | |||
| 1 | 2001-11-30 Stefan Monnier <monnier@cs.yale.edu> | ||
| 2 | |||
| 3 | * emacs-lisp/cl-macs.el (shiftf): Fix more. Simplify. | ||
| 4 | |||
| 1 | 2001-11-29 Stefan Monnier <monnier@cs.yale.edu> | 5 | 2001-11-29 Stefan Monnier <monnier@cs.yale.edu> |
| 2 | 6 | ||
| 7 | * emacs-lisp/crm.el (completing-read-multiple): Better preserve | ||
| 8 | the value of require-match in minibuffer-completion-confirm. | ||
| 9 | Use crm-local-completion-map. | ||
| 10 | |||
| 11 | * emacs-lisp/cl-macs.el (shiftf): Fix the fast case so | ||
| 12 | (let ((a 1) (b 2)) (shiftf a b (cons a b)) b) returns (1 . 2). | ||
| 13 | (cl-make-type-test): Use char-valid-p for `character'. | ||
| 14 | |||
| 3 | * info.el (Info-complete-next-re, Info-complete-cache): New vars. | 15 | * info.el (Info-complete-next-re, Info-complete-cache): New vars. |
| 4 | (Info-complete-menu-item): Rewrite. Add the ability to search | 16 | (Info-complete-menu-item): Rewrite. Add the ability to search |
| 5 | several sequential nodes. Add a simple caching mechanism. | 17 | several sequential nodes. Add a simple caching mechanism. |
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index feb1a2f956b..c4761e93bc6 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el | |||
| @@ -1844,23 +1844,14 @@ The form returns true if TAG was found and removed, nil otherwise." | |||
| 1844 | "(shiftf PLACE PLACE... VAL): shift left among PLACEs. | 1844 | "(shiftf PLACE PLACE... VAL): shift left among PLACEs. |
| 1845 | Example: (shiftf A B C) sets A to B, B to C, and returns the old A. | 1845 | Example: (shiftf A B C) sets A to B, B to C, and returns the old A. |
| 1846 | Each PLACE may be a symbol, or any generalized variable allowed by `setf'." | 1846 | Each PLACE may be a symbol, or any generalized variable allowed by `setf'." |
| 1847 | (if (not (memq nil (mapcar 'symbolp (butlast (cons place args))))) | 1847 | (cond |
| 1848 | (list 'prog1 place | 1848 | ((null args) place) |
| 1849 | (let ((sets nil)) | 1849 | ((symbolp place) `(prog1 ,place (setq ,place (shiftf ,@args)))) |
| 1850 | (while args | 1850 | (t |
| 1851 | (cl-push (list 'setq place (car args)) sets) | 1851 | (let ((method (cl-setf-do-modify place 'unsafe))) |
| 1852 | (setq place (cl-pop args))) | 1852 | `(let* ,(car method) |
| 1853 | `(setq ,(cadar sets) | 1853 | (prog1 ,(nth 2 method) |
| 1854 | (prog1 ,(caddar sets) | 1854 | ,(cl-setf-do-store (nth 1 method) `(shiftf ,@args)))))))) |
| 1855 | ,@(nreverse (cdr sets)))))) | ||
| 1856 | (let* ((places (reverse (cons place args))) | ||
| 1857 | (form (cl-pop places))) | ||
| 1858 | (while places | ||
| 1859 | (let ((method (cl-setf-do-modify (cl-pop places) 'unsafe))) | ||
| 1860 | (setq form (list 'let* (car method) | ||
| 1861 | (list 'prog1 (nth 2 method) | ||
| 1862 | (cl-setf-do-store (nth 1 method) form)))))) | ||
| 1863 | form))) | ||
| 1864 | 1855 | ||
| 1865 | (defmacro rotatef (&rest args) | 1856 | (defmacro rotatef (&rest args) |
| 1866 | "(rotatef PLACE...): rotate left among PLACEs. | 1857 | "(rotatef PLACE...): rotate left among PLACEs. |