Emacs Lisp: What's “feature”?

By Xah Lee. Date: . Last updated: .

Emacs's Concept of Feature

For example, type Alt+x describe-variable Enter ↵ features Enter ↵. You'll see something like this:

ibuffer etags ring cc-mode cc-fonts cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs xlsl-mode encoded-kb speck sgml-mode dired info newcomment desktop recentf tree-widget wid-edit advice help-fns …

require and provide

The purpose of features is for emacs to know if a package is already loaded.

The features variable and the functions {provide, require}, is the mechanism.

The require function checks the features variable to see if a symbol is already there, if not, then load the file.

The provide function adds a symbol to the features list.

back to Emacs Lisp: require, load, load-file, autoload, feature, Explained

Like it? Buy Xah Emacs Tutorial. Thanks.

or, buy something from Best Keyboard for Emacs