emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] New convenience macros


From: Steve Youngs
Subject: Re: [PATCH] New convenience macros
Date: Thu, 23 Aug 2007 21:13:11 +1000
User-agent: Gnus/5.110007 (No Gnus v0.7) SXEmacs/22.1.7 (De Lorean, linux)

* Stefan Monnier <address@hidden> writes:

  >> I added these to SXEmacs a little while ago.  They are a couple of
  >> macros that can be used when you need to conditionalise on emacs
  >> flavour.  And at the same time not generate byte-compiler warnings,
  >> regardless of the flavour of emacs you are using to compile the
  >> .el.

  > We've done it differently in Emacs-22 (and maybe even Emacs-21:
  > can't remember exactly when it was introduced): (featurep 'xemacs)
  > is known by the source-level optimizer as a constant of value nil,
  > so

  >   (if (featurep 'xemacs) a b)

  > will only look at `b' and won't generate any warnings about code in
  > `a'.  The corresponding code is very simple (in byte-opt.el):

  >    (put 'featurep 'byte-optimizer 'byte-optimize-featurep)
  >    (defun byte-optimize-featurep (form)
  >      ;; Emacs-21's byte-code doesn't run under XEmacs anyway, so we can
  >      ;; safely optimize away this test.
  >      (if (equal '((quote xemacs)) (cdr-safe form))
  >          nil
  >        form))

Oh, that's nice.  Thank you very much for showing me this, Stefan, I'm
going to add something similar to SXEmacs (and XEmacs too I hope).

  > I haven't come across any (featurep 'sxemacs) yet, so the code
  > hasn't been updated for that use yet, but it's trivial to do so,
  > obviously.

And because it would be so trivial, perhaps you wouldn't mind adding it
now, Stefan?  There's currently not much (if anything) out in the wild
that would depend on (featurep 'sxemacs), but we're constantly adding
new stuff so it's only a matter of time. :-)

Thanks very much!

-- 
|---<Steve Youngs>---------------<GnuPG KeyID: A94B3003>---|
|       SXEmacs - The only _______ you'll ever need.       |
|         Fill in the blank, yes, it's THAT good!          |
|------------------------------------<address@hidden>---|

Attachment: pgpMiIfyuaDGA.pgp
Description: PGP signature


reply via email to

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