emacs-devel
[Top][All Lists]
Advanced

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

Re: Why shouldn't we have a #if .... #else .... #endif construct in Emac


From: Ulrich Mueller
Subject: Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?
Date: Mon, 28 Aug 2023 23:01:53 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

>>>>> On Mon, 28 Aug 2023, Alan Mackenzie wrote:

>> >     (when (< emacs-major-version 24)
>> >       (defadvice .....))

>> I believe (eval-when-compile (< emacs-major-version 24)) would work?

> I've twisted my head into knots in the past trying to work out how to
> use eval-when/and-compile for this purpose.  The point is, I don't want
> the defadvice to be evaluated at compile time; I just want it to be
> compiled (or not).

Sorry, I should have been clearer. The full construct would look like
this:

    (when (eval-when-compile (< emacs-major-version 24))
      (defadvice .....))

So only the test would be evaluated at compile time, the defadvice
itself would be compiled normally (or not, if the test fails).



reply via email to

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