From 5514cc4c84969122668c89a387b858157e0c2e74 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 12 Aug 2013 22:30:52 -0400 Subject: * lisp/emacs-lisp/timer.el (timer--time-setter): New function. (timer--time): Use it as gv-setter. * lisp/emacs-lisp/gv.el (gv-define-simple-setter): Output warning when setter is not a symbol. --- lisp/emacs-lisp/cl-macs.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/emacs-lisp/cl-macs.el') diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index c47c9b61030..d9d6658811f 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -616,7 +616,7 @@ The result of the body appears to the compiler as a quoted constant." (declare (debug (form &optional sexp))) (if (cl--compiling-file) (let* ((temp (cl-gentemp "--cl-load-time--")) - (set `(set ',temp ,form))) + (set `(setq ,temp ,form))) (if (and (fboundp 'byte-compile-file-form-defmumble) (boundp 'this-kind) (boundp 'that-one)) (fset 'byte-compile-file-form -- cgit v1.2.3 From e8dfd19797fa7224ae726a8be78726fefd260c0e Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 28 Aug 2013 23:49:10 -0400 Subject: * lisp/emacs-lisp/cl-macs.el (cl-defsubst): Make it clear that args are immutable. Don't use `unsafe' any more. (cl--defsubst-expand): Don't substitute at the same time as keeping a residual unused let-binding. Don't use `unsafe' any more. --- lisp/ChangeLog | 7 +++++++ lisp/emacs-lisp/cl-macs.el | 13 +++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'lisp/emacs-lisp/cl-macs.el') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b5a4857f9f8..2554bd6d83a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2013-08-29 Stefan Monnier + + * emacs-lisp/cl-macs.el (cl-defsubst): Make it clear that args + are immutable. Don't use `unsafe' any more. + (cl--defsubst-expand): Don't substitute at the same time as keeping + a residual unused let-binding. Don't use `unsafe' any more. + 2013-08-29 Glenn Morris * calendar/cal-china.el (calendar-chinese-year-cache): diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index d9d6658811f..af7c41d5c4c 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2693,15 +2693,16 @@ macro that returns its `&whole' argument." ;;;###autoload (defmacro cl-defsubst (name args &rest body) "Define NAME as a function. -Like `defun', except the function is automatically declared `inline', +Like `defun', except the function is automatically declared `inline' and +the arguments are immutable. ARGLIST allows full Common Lisp conventions, and BODY is implicitly surrounded by (cl-block NAME ...). +The function's arguments should be treated as immutable. \(fn NAME ARGLIST [DOCSTRING] BODY...)" (declare (debug cl-defun) (indent 2)) (let* ((argns (cl--arglist-args args)) (p argns) - (pbody (cons 'progn body)) - (unsafe (not (cl--safe-expr-p pbody)))) + (pbody (cons 'progn body))) (while (and p (eq (cl--expr-contains args (car p)) 1)) (pop p)) `(progn ,(if p nil ; give up if defaults refer to earlier args @@ -2717,10 +2718,10 @@ surrounded by (cl-block NAME ...). ;; does not pay attention to the argvs (and ;; cl-expr-access-order itself is also too naive). nil - ,(and (memq '&key args) 'cl-whole) ,unsafe ,@argns))) + ,(and (memq '&key args) 'cl-whole) nil ,@argns))) (cl-defun ,name ,args ,@body)))) -(defun cl--defsubst-expand (argns body simple whole unsafe &rest argvs) +(defun cl--defsubst-expand (argns body simple whole _unsafe &rest argvs) (if (and whole (not (cl--safe-expr-p (cons 'progn argvs)))) whole (if (cl--simple-exprs-p argvs) (setq simple t)) (let* ((substs ()) @@ -2728,7 +2729,7 @@ surrounded by (cl-block NAME ...). (cl-mapcar (lambda (argn argv) (if (or simple (macroexp-const-p argv)) (progn (push (cons argn argv) substs) - (and unsafe (list argn argv))) + nil) (list argn argv))) argns argvs)))) ;; FIXME: `sublis/subst' will happily substitute the symbol -- cgit v1.2.3