Mercurial > hg > xemacs-beta
comparison man/lispref/loading.texi @ 280:7df0dd720c89 r21-0b38
Import from CVS: tag r21-0b38
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:32:22 +0200 |
parents | c7528f8e288d |
children | 70ad99077275 |
comparison
equal
deleted
inserted
replaced
279:c20b2fb5bb0a | 280:7df0dd720c89 |
---|---|
600 If loading the file fails to provide @var{feature}, @code{require} | 600 If loading the file fails to provide @var{feature}, @code{require} |
601 signals an error, @samp{Required feature @var{feature} was not | 601 signals an error, @samp{Required feature @var{feature} was not |
602 provided}. | 602 provided}. |
603 @end defun | 603 @end defun |
604 | 604 |
605 @defun featurep feature | 605 @defun featurep fexp |
606 This function returns @code{t} if @var{feature} has been provided in the | 606 This function returns @code{t} if feature @var{fexp} is present in this |
607 current XEmacs session (i.e., @var{feature} is a member of | 607 Emacs. Use this to conditionalize execution of lisp code based on the |
608 @code{features}.) | 608 presence or absence of emacs or environment extensions. |
609 | |
610 @var{fexp} can be a symbol, a number, or a list. | |
611 | |
612 If @var{fexp} is a symbol, it is looked up in the `features' variable, | |
613 and @code{t} is returned if it is found, @code{nil} otherwise. | |
614 | |
615 If @var{fexp} is a number, the function returns @code{t} if this Emacs | |
616 has an equal or greater number than @code{fexp}, @code{nil} otherwise. | |
617 Note that minor Emacs version is expected to be 2 decimal places wide, | |
618 so @code{(featurep 20.4)} will return @code{nil} on XEmacs 20.4---you | |
619 must write @code{(featurep 20.04)}, unless you wish to match for XEmacs | |
620 20.40. | |
621 | |
622 If @var{fexp} is a list whose car is the symbol @code{and}, the function | |
623 returns @code{t} if all the features in its cdr are present, @code{nil} | |
624 otherwise. | |
625 | |
626 If @var{fexp} is a list whose car is the symbol @code{or}, the function | |
627 returns @code{t} if any the features in its cdr are present, @code{nil} | |
628 otherwise. | |
629 | |
630 If @var{fexp} is a list whose car is the symbol @code{not}, the function | |
631 returns @code{t} if the feature is not present, @code{nil} otherwise. | |
632 | |
633 Examples: | |
634 | |
635 @example | |
636 (featurep 'xemacs) | |
637 @result{} ; @r{t on XEmacs.} | |
638 | |
639 (featurep '(and xemacs gnus)) | |
640 @result{} ; @r{t on XEmacs with Gnus loaded.} | |
641 | |
642 (featurep '(or tty-frames (and emacs 19.30))) | |
643 @result{} ; @r{t if this Emacs supports TTY frames.} | |
644 | |
645 (featurep '(or (and xemacs 19.15) (and emacs 19.34))) | |
646 @result{} ; @r{t on XEmacs 19.15 and later, or on} | |
647 ; @r{FSF Emacs 19.34 and later.} | |
648 @end example | |
649 | |
650 @strong{NOTE}: The advanced arguments of this function (anything other than a | |
651 symbol) are not yet supported by FSF Emacs. If you feel they are useful | |
652 for supporting multiple Emacs variants, lobby Richard Stallman at | |
653 @samp{<bug-gnu-emacs@@prep.ai.mit.edu>}. | |
609 @end defun | 654 @end defun |
610 | 655 |
611 @defvar features | 656 @defvar features |
612 The value of this variable is a list of symbols that are the features | 657 The value of this variable is a list of symbols that are the features |
613 loaded in the current XEmacs session. Each symbol was put in this list | 658 loaded in the current XEmacs session. Each symbol was put in this list |