GNU bug report logs - #17498
24.4.50; This function has a compiler macro `yes--cmacro'.

Previous Next

Package: emacs;

Reported by: Leo Liu <sdl.web <at> gmail.com>

Date: Thu, 15 May 2014 15:07:02 UTC

Severity: minor

Found in version 24.4.50

Done: Leo Liu <sdl.web <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>
To: Leo Liu <sdl.web <at> gmail.com>
Cc: 17498 <at> debbugs.gnu.org
Subject: bug#17498: 24.4.50; This function has a compiler macro `yes--cmacro'.
Date: Fri, 16 May 2014 10:59:41 +0200
Leo Liu <sdl.web <at> gmail.com> writes:

> Eval the following code
>
> ;;;; BEGIN
> (defun yes ()
>   )
> (when nil
>   (cl-define-compiler-macro yes (&rest _)))
> ;;;; END

FWIW (and because it was not obvious to me), it's due to
eval-and-compile:

(when nil
   (eval-and-compile (message "foo")))
=> foo is shown in *Messages*

Same with this :
(defmacro bar () '(eval-and-compile (message "foo")))
(when nil (bar))

This case could be "fixed" by optimizing `when' for a nil condition :

(defmacro new-when (cond &rest body)
  (declare (indent 1) (debug t))
  (and cond
       (list 'if cond (cons 'progn body))))

Then
(new-when nil (bar))
doesn't show anything.

-- 
Nico.




This bug report was last modified 11 years and 13 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.