[Top][All Lists]

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

Re: [PATCH] New convenience macros

From: Kim F. Storm
Subject: Re: [PATCH] New convenience macros
Date: Mon, 20 Aug 2007 12:58:47 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Steve Youngs <address@hidden> writes:

> NotDashEscaped: You need GnuPG to verify this message
> * Richard Stallman <address@hidden> writes:
>   > I don't want to contrast the name "XEmacs" with the name "GNU Emacs",
>   > so I don't want these macros installed in Emacs under the names
>   > proposed.
> How about.. `do-in-emacs', `do-in-xemacs', `do-in-sxemacs', and
> `with-emacs-type', and change the symbol in `with-emacs-type' from `gnu'
> to `emacs'.  Would that be better?
> The names aren't that important, providing they are consistent across
> the 3 emacs variants.  I have no particular preference so I'm happy to
> go with whatever names you decide, Richard.  Just let me know what names
> you do use for these macros so I can ensure the same goes into XEmacs
> and SXEmacs.

So far, there is code in Emacs which is XEmacs aware by testing on
(if (featurep 'xemacs) ...) and the byte compiler being aware that
this condition is always false in Emacs, so XEmacs code is ignored.

We could arrange for to byte-compiler to know about (featurep
'sxemacs) as well, but I think that's as far as we should go in terms
of differentiating yet another Emacs derivate.

I suppose that SXEmacs also provides xemacs (or you will have to edit
a lot of existing code!), so it is really only for the differences
between SXEmacs and XEmacs that you may need additional sxemacs tests.

I really don't see why Emacs has to be concerned about that.
Next month somebody else will ask for support for TXEmacs.

I could go as far as creating a new macro "when-emacs" that could
be used as

  (when-emacs emacs ...)
  (when-emacs xemacs ...)
  (when-emacs sxemacs ...)

which simply expands into

  (if (featurep (quote VARIANT)) BODY)

And instead of just a fixed 'xemacs symbol in the byte compiler,
there could be a list of features to ignore:

(defvar byte-compiler-ignored-features '(xemacs sxemacs))

Kim F. Storm <address@hidden> http://www.cua.dk

reply via email to

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