From: Glenn Morris Date: Thu, 20 Feb 2014 07:38:47 +0000 (-0800) Subject: Some doc for defalias-fset-function X-Git-Url: http://git.hcoop.net/bpt/emacs.git/commitdiff_plain/189e70077d1c088d4892a1377da2c4da156867b3 Some doc for defalias-fset-function * doc/lispref/functions.texi (Defining Functions): Mention defalias-fset-function. * src/data.c (Fdefalias): Doc fix. * etc/NEWS: Related edit. --- diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 7869bcfdc2..fcfb524934 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,7 @@ +2014-02-20 Glenn Morris + + * functions.texi (Defining Functions): Mention defalias-fset-function. + 2014-02-17 Glenn Morris * minibuf.texi (Text from Minibuffer): Update read-regexp details. diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index d86430a5ac..0781eaf056 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -592,6 +592,11 @@ If @var{doc} is non-@code{nil}, it becomes the function documentation of @var{name}. Otherwise, any documentation provided by @var{definition} is used. +@cindex defalias-fset-function property +Internally, @code{defalias} normally uses @code{fset} to set the definition. +If @var{name} has a @code{defalias-fset-function} property, however, +the associated value is used as a function to call in place of @code{fset}. + The proper place to use @code{defalias} is where a specific function name is being defined---especially where that name appears explicitly in the source file being loaded. This is because @code{defalias} records diff --git a/etc/NEWS b/etc/NEWS index bfe3ef6aae..c8f1c7f225 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1094,8 +1094,10 @@ treated as regexps rather than literal strings. Generic commands are interactive functions whose implementation can be selected among several alternatives, as a matter of user preference. -** The `defalias-fset-function' property lets you catch `defalias' -calls, and redirect them to your own function, instead of `fset'. ++++ +** If you give a symbol a `defalias-fset-function' property, `defalias' +on that symbol will use the associated value as a function to call +in place of `fset'. +++ ** New variable `enable-dir-local-variables'. diff --git a/src/ChangeLog b/src/ChangeLog index f89f7e084f..c127e79366 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2014-02-20 Glenn Morris + + * data.c (Fdefalias): Doc fix. + 2014-02-19 Eli Zaretskii * xdisp.c (display_line): Fix horizontal scrolling of large images diff --git a/src/data.c b/src/data.c index a52cee66b5..4ef81f2474 100644 --- a/src/data.c +++ b/src/data.c @@ -738,6 +738,10 @@ Associates the function with the current load file, if any. The optional third argument DOCSTRING specifies the documentation string for SYMBOL; if it is omitted or nil, SYMBOL uses the documentation string determined by DEFINITION. + +Internally, this normally uses `fset', but if SYMBOL has a +`defalias-fset-function' property, the associated value is used instead. + The return value is undefined. */) (register Lisp_Object symbol, Lisp_Object definition, Lisp_Object docstring) {