emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to fix Emacs24 compiler warning w/o breaking code for previous v


From: Daniel Colascione
Subject: Re: How to fix Emacs24 compiler warning w/o breaking code for previous versions
Date: Sun, 19 Jun 2011 14:14:32 -0700
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10

On 6/16/11 8:42 PM, Jambunathan K wrote:
> I was hoping that there is an elisp equivalent for C-like
> 
> #if emacs-version > a
>     do this
> #else
>     do that
> #endif
> 

The Common Lisp #+ reader macro provides the facility you want. For example,

    (progn #+some-feature 42)

would read as

    (progn 42)

on systems with some-feature present and

    (progn)

on systems without that feature.

CL also allows arbitrary combinations of and, or, and not calls, e.g,

    #+(or feature1 (not feature2))

#- also exists, and is similar, except that the sense of the test is
inverted.

Might this feature be worth adding to Emacs? Of course, it would only
help code written for Emacs 24 and above.

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]