Mercurial > hg > xemacs-beta
changeset 2492:6780963faf78
[xemacs-hg @ 2005-01-21 09:43:09 by aidan]
Rename "functions" node to "functions and commands," move the definition of
a command further up the list of types of functions, give information on a
trivial (interactive) declaration, and cross-reference to the key binding
detail. Cf. 87vf9wgd08.fsf@tleepslib.sk.tsukuba.ac.jp (comp.emacs.xemacs,
2005-01-18).
author | aidan |
---|---|
date | Fri, 21 Jan 2005 09:43:12 +0000 |
parents | 876c400e58d7 |
children | ec25549f1f43 |
files | man/ChangeLog man/lispref/eval.texi man/lispref/functions.texi man/lispref/lispref.texi man/lispref/macros.texi man/lispref/symbols.texi man/lispref/variables.texi |
diffstat | 7 files changed, 59 insertions(+), 33 deletions(-) [+] |
line wrap: on
line diff
--- a/man/ChangeLog Fri Jan 21 09:30:49 2005 +0000 +++ b/man/ChangeLog Fri Jan 21 09:43:12 2005 +0000 @@ -1,3 +1,16 @@ +2005-01-19 Aidan Kehoe <kehoea@parhasard.net> + + * man/lispref/functions.texi (Functions): Rename to "Functions and + Commands" + * man/lispref/functions.texi (What Is a Function): Move the definition + of a command further up the list, give information on a trivial + (interactive) declaration, and cross-reference to the key binding + detail. Cf. 87vf9wgd08.fsf@tleepslib.sk.tsukuba.ac.jp + (comp.emacs.xemacs, 2005-01-18). + * man/lispref/eval.texi man/lispref/lispref.texi + man/lispref/macros.texi man/lispref/symbols.texi + man/lispref/variables.texi: Fix cross references. + 2004-12-28 Ben Wing <ben@xemacs.org> * xemacs-faq.texi (Top):
--- a/man/lispref/eval.texi Fri Jan 21 09:30:49 2005 +0000 +++ b/man/lispref/eval.texi Fri Jan 21 09:43:12 2005 +0000 @@ -74,7 +74,7 @@ function @code{car}. Evaluation of a function call ultimately calls the function specified -in it. @xref{Functions}. The execution of the function may itself work +in it. @xref{Functions and Commands}. The execution of the function may itself work by evaluating the function definition; or the function may be a Lisp primitive implemented in C, or it may be a byte-compiled function (@pxref{Byte Compilation}).
--- a/man/lispref/functions.texi Fri Jan 21 09:30:49 2005 +0000 +++ b/man/lispref/functions.texi Fri Jan 21 09:43:12 2005 +0000 @@ -3,8 +3,8 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. @c See the file lispref.texi for copying conditions. @setfilename ../../info/functions.info -@node Functions, Macros, Variables, Top -@chapter Functions +@node Functions and Commands, Macros, Variables, Top +@chapter Functions and Commands A Lisp program is composed mainly of Lisp functions. This chapter explains what functions are, how they accept arguments, and how to @@ -45,6 +45,39 @@ specifically to mean a function written in Lisp. Special forms and macros are not functions. +@item command +@cindex command + +A @dfn{command} is a possible definition for a key sequence---we count +mouse events and menu accesses as key sequences for this purpose. More +formally, within XEmacs lisp, a command is something that +@code{command-execute} can invoke. + +Some functions are commands; a function written in Lisp is a command if +it contains an interactive declaration. A trivial interactive +declaration is a line @code{(interactive)} immediately after the +documentation string. For more complex examples, with prompting and +completion, see @xref{Defining Commands}. Such a function can be called +from Lisp expressions like other functions; in this case, the fact that +the function is a command makes no difference. + +Keyboard macros (strings and vectors) are commands also, even though +they are not functions. A symbol is a command if its function +definition is a command; such symbols can be invoked with @kbd{M-x}. +The symbol is a function as well if the definition is a function. + +In the case where you want to call a command in reaction to a +user-generated event, you'll need to bind it to that event. For how to +do this, see @xref{Key Binding Commands}. +@xref{Command Overview}. + +@item keystroke command +@cindex keystroke command +A @dfn{keystroke command} is a command that is bound to a key sequence +(typically one to three keystrokes). The distinction is made here +merely to avoid confusion with the meaning of ``command'' in non-Emacs +editors; for Lisp programs, the distinction is normally unimportant. + @item primitive @cindex primitive @cindex subr @@ -84,28 +117,6 @@ things that special forms can do. @xref{Macros}, for how to define and use macros. -@item command -@cindex command -A @dfn{command} is an object that @code{command-execute} can invoke; it -is a possible definition for a key sequence. Some functions are -commands; a function written in Lisp is a command if it contains an -interactive declaration (@pxref{Defining Commands}). Such a function -can be called from Lisp expressions like other functions; in this case, -the fact that the function is a command makes no difference. - -Keyboard macros (strings and vectors) are commands also, even though -they are not functions. A symbol is a command if its function -definition is a command; such symbols can be invoked with @kbd{M-x}. -The symbol is a function as well if the definition is a function. -@xref{Command Overview}. - -@item keystroke command -@cindex keystroke command -A @dfn{keystroke command} is a command that is bound to a key sequence -(typically one to three keystrokes). The distinction is made here -merely to avoid confusion with the meaning of ``command'' in non-Emacs -editors; for Lisp programs, the distinction is normally unimportant. - @item compiled function A @dfn{compiled function} is a function that has been compiled by the byte compiler. @xref{Compiled-Function Type}.
--- a/man/lispref/lispref.texi Fri Jan 21 09:30:49 2005 +0000 +++ b/man/lispref/lispref.texi Fri Jan 21 09:43:12 2005 +0000 @@ -144,8 +144,10 @@ * Evaluation:: How Lisp expressions are evaluated. * Control Structures:: Conditionals, loops, nonlocal exits. * Variables:: Using symbols in programs to stand for values. -* Functions:: A function is a Lisp program - that can be invoked from other functions. + +* Functions and Commands:: A function is a Lisp program that can be + invoked from other functions. + * Macros:: Macros are a way to extend the Lisp language. * Customization:: Writing customization declarations.
--- a/man/lispref/macros.texi Fri Jan 21 09:30:49 2005 +0000 +++ b/man/lispref/macros.texi Fri Jan 21 09:43:12 2005 +0000 @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. @c See the file lispref.texi for copying conditions. @setfilename ../../info/macros.info -@node Macros, Loading, Functions, Top +@node Macros, Loading, Functions and Commands, Top @chapter Macros @cindex macros
--- a/man/lispref/symbols.texi Fri Jan 21 09:30:49 2005 +0000 +++ b/man/lispref/symbols.texi Fri Jan 21 09:43:12 2005 +0000 @@ -11,8 +11,8 @@ describes symbols, their components, their property lists, and how they are created and interned. Separate chapters describe the use of symbols as variables and as function names; see @ref{Variables}, and -@ref{Functions}. For the precise read syntax for symbols, see -@ref{Symbol Type}. +@ref{Functions and Commands}. For the precise read syntax for symbols, +see @ref{Symbol Type}. You can test whether an arbitrary Lisp object is a symbol with @code{symbolp}: @@ -154,7 +154,7 @@ cell, is derived from the idea that @code{defun} gives the symbol its definition as a function.) @code{defsubst}, @code{define-function} and @code{defalias} are other ways of defining a function. -@xref{Functions}. +@xref{Functions and Commands}. @code{defmacro} defines a symbol as a macro. It creates a macro object and stores it in the function cell of the symbol. Note that a
--- a/man/lispref/variables.texi Fri Jan 21 09:30:49 2005 +0000 +++ b/man/lispref/variables.texi Fri Jan 21 09:43:12 2005 +0000 @@ -3,7 +3,7 @@ @c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. @c See the file lispref.texi for copying conditions. @setfilename ../../info/variables.info -@node Variables, Functions, Control Structures, Top +@node Variables, Functions and Commands, Control Structures, Top @chapter Variables @cindex variable @@ -225,7 +225,7 @@ @itemize @bullet @item -Function calls (@pxref{Functions}). +Function calls (@pxref{Functions and Commands}). @item Macro calls (@pxref{Macros}).