Subject: RE: bug#13316: 24.2.50; defmacro might not return the last form, if it is nil

From: "Drew Adams" <[email-masked]>
Date: Mon, 31 Dec 2012 09:35:14 -0800

> If I write:
> (defmacro test-macro () ''a nil)
> (test-macro)
>
> I get "a" as a result. 
>
> Tested with emacs -Q. 
> Emacs version: 24.2.50.1 (got it from development repository ~2 months ago)

This is a regression, BTW - it works correctly in Emacs 24.2.
Confirmed in this more recent version:

In GNU Emacs 24.3.50.1 (i386-mingw-nt5.1.2600)
 of 2012-12-18 on MS-W7-DANI
Bzr revision: 111265 [email-masked]
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
 `configure --with-gcc (4.7) --no-opt --enable-checking --cflags
 -Ic:/emacs/libs/libXpm-3.5.10/include -Ic:/emacs/libs/libXpm-3.5.10/src
 -Ic:/emacs/libs/libpng-dev_1.4.3-1_win32/include
 -Ic:/emacs/libs/zlib-dev_1.2.5-2_win32/include
 -Ic:/emacs/libs/giflib-4.1.4-1-lib/include
 -Ic:/emacs/libs/jpeg-6b-4-lib/include
 -Ic:/emacs/libs/tiff-3.8.2-1-lib/include
 -Ic:/emacs/libs/libxml2-2.7.8-w32-bin/include/libxml2
 -Ic:/emacs/libs/gnutls-3.0.9-w32-bin/include
 -Ic:/emacs/libs/libiconv-1.9.2-1-lib/include'

(macroexpand '(test-macro)) returns (quote a).

However, with something non-nil in place of nil it DTRT:

(defmacro test-macro () ''a 45)
(test-macro)                ; 45
(macroexpand '(test-macro)) ; 45