Subject: bug#12977: closed (Re: bug#12977: defmacro* does not process declare options)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 24 Nov 2012 21:39:04 +0000

Your bug report

#12977: defmacro* does not process declare options

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
12977: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12977
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#12977: defmacro* does not process declare options
From: Stefan Monnier <[email-masked]>
To: Juanma Barranquero <[email-masked]>
Cc: [email-masked]
Date: Sat, 24 Nov 2012 16:36:41 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

>   (defmacro* whereas ((var test) &rest body)
>     (declare (indent 1))
[...]
> 24.2.50 => (nil (lisp-indent-function 1))

Indeed, thanks, should be fixed now on the emacs-24 branch (see patch
below).

        Stefan

=== modified file 'lisp/emacs-lisp/cl-macs.el'
--- lisp/emacs-lisp/cl-macs.el	2012-11-15 21:01:25 +0000
+++ lisp/emacs-lisp/cl-macs.el	2012-11-24 21:30:26 +0000
@@ -216,12 +216,17 @@
 (defvar cl--bind-inits) (defvar cl--bind-lets) (defvar cl--bind-forms)
 
 (defun cl--transform-lambda (form bind-block)
+  "Transform a function form FORM of name BIND-BLOCK.
+BIND-BLOCK is the name of the symbol to which the function will be bound,
+and which will be used for the name of the `cl-block' surrounding the
+function's body.
+FORM is of the form (ARGS . BODY)."
   (let* ((args (car form)) (body (cdr form)) (orig-args args)
 	 (cl--bind-block bind-block) (cl--bind-defs nil) (cl--bind-enquote nil)
 	 (cl--bind-inits nil) (cl--bind-lets nil) (cl--bind-forms nil)
 	 (header nil) (simple-args nil))
     (while (or (stringp (car body))
-	       (memq (car-safe (car body)) '(interactive cl-declare)))
+	       (memq (car-safe (car body)) '(interactive declare cl-declare)))
       (push (pop body) header))
     (setq args (if (listp args) (cl-copy-list args) (list '&rest args)))
     (let ((p (last args))) (if (cdr p) (setcdr p (list '&rest (cdr p)))))

Subject: defmacro* does not process declare options
From: Juanma Barranquero <[email-masked]>
To: Bug-Gnu-Emacs <[email-masked]>
Date: Sat, 24 Nov 2012 04:39:44 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Package: emacs
Version: 24.2.50

This is a regression in 24.3

  emacs -Q

and evaluate

(let (sp1 sp2)
  (require 'cl)
  (setf (symbol-plist 'whereas) nil)
  (makunbound 'whereas)
  (defmacro* whereas ((var test) &rest body)
    (declare (indent 1))
    `(let ((,var ,test)) (when ,var ,@body)))
  (setq sp1 (symbol-plist 'whereas))
  (defmacro whereas (var test &rest body)
    (declare (indent 1))
    `(let ((var ,test)) (when ,var ,@body)))
  (setq sp2 (symbol-plist 'whereas))
  (list sp1 sp2))

24.2 => ((lisp-indent-function 1) (lisp-indent-function 1))
24.2.50 => (nil (lisp-indent-function 1))

    Juanma