aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2012-12-12 20:46:47 -0500
committerStefan Monnier2012-12-12 20:46:47 -0500
commiteb8006c61fee921dedba1cf708b390e12b89836d (patch)
treec19f7508669125bdd52fa291d0a297a35514a814
parentde8cbebe112804e3f7f8e5ebd1e5a3661e311b9c (diff)
downloademacs-eb8006c61fee921dedba1cf708b390e12b89836d.tar.gz
emacs-eb8006c61fee921dedba1cf708b390e12b89836d.zip
* lisp/emacs-lisp/cl.el (letf): Make it an alias of cl-letf.
(cl--symbol-function): Remove (now that funbound is like nil).
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/emacs-lisp/cl.el24
2 files changed, 6 insertions, 23 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3d3892a12be..97b44b22975 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12012-12-13 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * emacs-lisp/cl.el (letf): Make it an alias of cl-letf.
4 (cl--symbol-function): Remove (now that funbound is like nil).
5
12012-12-12 Glenn Morris <rgm@gnu.org> 62012-12-12 Glenn Morris <rgm@gnu.org>
2 7
3 * button.el (button--area-button-p): Fix typo. 8 * button.el (button--area-button-p): Fix typo.
diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el
index 7241b3c5984..37821758fa5 100644
--- a/lisp/emacs-lisp/cl.el
+++ b/lisp/emacs-lisp/cl.el
@@ -220,7 +220,7 @@
220 callf2 220 callf2
221 callf 221 callf
222 letf* 222 letf*
223 ;; letf 223 letf
224 rotatef 224 rotatef
225 shiftf 225 shiftf
226 remf 226 remf
@@ -504,28 +504,6 @@ rather than relying on `lexical-binding'."
504;; not 100% compatible: not worth the trouble to add them to cl-lib.el, but we 504;; not 100% compatible: not worth the trouble to add them to cl-lib.el, but we
505;; still need to support old users of cl.el. 505;; still need to support old users of cl.el.
506 506
507(defmacro cl--symbol-function (symbol)
508 "Like `symbol-function' but return `cl--unbound' if not bound."
509 ;; (declare (gv-setter (lambda (store)
510 ;; `(if (eq ,store 'cl--unbound)
511 ;; (fmakunbound ,symbol) (fset ,symbol ,store)))))
512 `(if (fboundp ,symbol) (symbol-function ,symbol) 'cl--unbound))
513(gv-define-setter cl--symbol-function (store symbol)
514 `(if (eq ,store 'cl--unbound) (fmakunbound ,symbol) (fset ,symbol ,store)))
515
516(defmacro letf (bindings &rest body)
517 "Dynamically scoped let-style bindings for places.
518For more details, see `cl-letf'. This macro behaves like that one
519in almost every respect (apart from details that relate to some
520deprecated usage of `symbol-function' in place forms)." ; bug#12760
521 (declare (indent 1) (debug cl-letf))
522 ;; Like cl-letf, but with special handling of symbol-function.
523 `(cl-letf ,(mapcar (lambda (x) (if (eq (car-safe (car x)) 'symbol-function)
524 `((cl--symbol-function ,@(cdar x)) ,@(cdr x))
525 x))
526 bindings)
527 ,@body))
528
529(defun cl--gv-adapt (cl-gv do) 507(defun cl--gv-adapt (cl-gv do)
530 ;; This function is used by all .elc files that use define-setf-expander and 508 ;; This function is used by all .elc files that use define-setf-expander and
531 ;; were compiled with Emacs>=24.3. 509 ;; were compiled with Emacs>=24.3.