>>>>> "Chris" == Chris Beggy <[EMAIL PROTECTED]> writes:

    Chris> From: Alex Schroeder <[EMAIL PROTECTED]>
    >> 
    >> Lots of packages define missing functions in order to run on Emacs and
    >> XEmacs.  Other packages test wethere critical functions are bound or

Hi Alex, All!

featurep of XEmacs 21.1 and newer has fairly sophisticated emacs
version testing support.  Has this been implemented for GNU Emacs yet?

`featurep' (buffer: *grep*, mode: grep)


Built-in function:

  arguments: (FEXP)

  Return non-nil if feature FEXP is present in this Emacs.
  Use this to conditionalize execution of lisp code based on the
   presence or absence of emacs or environment extensions.
  FEXP can be a symbol, a number, or a list.
  If it is a symbol, that symbol is looked up in the `features' variable,
   and non-nil will be returned if found.
  If it is a number, the function will return non-nil if this Emacs
   has an equal or greater version number than FEXP.
  If it is a list whose car is the symbol `and', it will return
   non-nil if all the features in its cdr are non-nil.
  If it is a list whose car is the symbol `or', it will return non-nil
   if any of the features in its cdr are non-nil.
  If it is a list whose car is the symbol `not', it will return
   non-nil if the feature is not present.

  Examples:

    (featurep 'xemacs)
      => ; Non-nil on XEmacs.

    (featurep '(and xemacs gnus))
      => ; Non-nil on XEmacs with Gnus loaded.

    (featurep '(or tty-frames (and emacs 19.30)))
      => ; Non-nil if this Emacs supports TTY frames.

    (featurep '(or (and xemacs 19.15) (and emacs 19.34)))
      => ; Non-nil on XEmacs 19.15 and later, or FSF Emacs 19.34 and later.

    (featurep '(and xemacs 21.02))
      => ; Non-nil on XEmacs 21.2 and later.

  NOTE: The advanced arguments of this function (anything other than a
  symbol) are not yet supported by FSF Emacs.  If you feel they are useful
  for supporting multiple Emacs variants, lobby Richard Stallman at
  <[EMAIL PROTECTED]>.

    >> not, and then assume they are on Emacs or XEmacs.  :(
    >> 
    >> I've had a similar problem with one package or another because BBDB
    >> used to do that as well (don't know wether it still does).

    Chris> What's the best solution for library writers then?  Do you know
    Chris> of any code examples where this is handled well?

    Chris> I agree that "featurep" tests aren't sufficient...

    Chris> Chris


    Chris> _______________________________________________
    Chris> [EMAIL PROTECTED]
    Chris> https://lists.sourceforge.net/lists/listinfo/bbdb-info
    Chris> BBDB Home Page: http://bbdb.sourceforge.net/

-- 
Adrian Aichner
 mailto:[EMAIL PROTECTED]
 http://www.xemacs.org/


_______________________________________________
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/

Reply via email to