emacs-devel
[Top][All Lists]
Advanced

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

Re: New function `emacs-version>='


From: Juanma Barranquero
Subject: Re: New function `emacs-version>='
Date: Fri, 02 May 2003 23:35:14 +0200

On Fri, 02 May 2003 17:14:07 -0400, "Stefan Monnier" 
<monnier+gnu/address@hidden> wrote:

> I think Christoph knows that.

Sure, I didn't intend to imply otherwise. Rhetoric took hold of me :(

> It's just that sometimes it's difficult
> to test whether A works or not.  For instance, how do you check whether
> the `display' property is supported by your version of Emacs ?

Yeah, sure. But most features are not isolated, there are related
variables, functions and sometimes even an entry in `features'... And if
not, I'd call that a bug in the feature/fix implementation (I'm
exaggerating, but only a bit.)

And, as a last resort, you can often do something like

  (unless (ignore-errors XXXX)
    YYYY)

(I do that to check whether windmove-default-keybindings supports the
MODIFIER argument or not.)

> How do you test whether PNG images are supported (without actually
> displaying such an image) ? ...

(memq 'png image-types)   ; :-)

> In most cases, there's a better solution than testing emacs-version, but
> there are still some where testing emacs-version makes sense and furthermore
> people do it anyway, so I'd rather provide an `emacs-version>=' rather than
> see something fail in Emacs-21 because some idiot wrote
> (or (= 20 emacs-major-version) (>= 29 emacs-minor-version)).

I'm not going to oppose that, but I'd bet is going to bring more grief
than help. I can speak only about my very subjective experience, and
certainly my .emacs (1,600+ lines) is more robust now than before, when
I used several flavors of emacs and window-system checking.

> And then we can make bytecomp.el emit warning messages about
> how you shouldn't use that function ;-)

Eh, I *like* that ;-)

                                                           /L/e/k/t/u





reply via email to

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