CVS update by stephent xemacs/src ...

xemacs-cvs at xemacs.org xemacs-cvs at xemacs.org
Thu Feb 22 11:53:29 EST 2007


  User: stephent
  Date: 07/02/22 17:53:29

  Modified:    xemacs/src ChangeLog eval.c fns.c
Log:
Doc fixes 2007-02-21. <87k5yaku0s.fsf at uwakimon.sk.tsukuba.ac.jp>

Revision  Changes    Path
1.787     +8 -0      XEmacs/xemacs/lisp/ChangeLog

Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/ChangeLog,v
retrieving revision 1.786
retrieving revision 1.787
diff -u -p -r1.786 -r1.787
--- ChangeLog	2007/02/11 18:55:40	1.786
+++ ChangeLog	2007/02/22 16:53:20	1.787
@@ -1,3 +1,11 @@
+2007-01-23  Stephen J. Turnbull  <stephen at xemacs.org>
+
+	* cus-face.el (custom-theme-reset-faces): Move code after docstring.
+
+2007-01-22  Stephen J. Turnbull  <stephen at xemacs.org>
+
+	* subr.el (lambda): Improve docstring.
+
 2007-01-21  Ville Skyttä  <scop at xemacs.org>
 
 	* mule/canna-leim.el (canna-activate): Look for canna_api, not



1.40      +18 -6     XEmacs/xemacs/lisp/subr.el

Index: subr.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/subr.el,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -p -r1.39 -r1.40
--- subr.el	2006/08/11 01:30:23	1.39
+++ subr.el	2007/02/22 16:53:21	1.40
@@ -79,12 +79,24 @@ function, i.e., stored as the function v
 funcall or mapcar, etc.
 
 ARGS should take the same form as an argument list for a `defun'.
-DOCSTRING is an optional documentation string.
- If present, it should describe how to call the function.
- But documentation strings are usually not useful in nameless functions.
-INTERACTIVE should be a call to the function `interactive', which see.
-It may also be omitted.
-BODY should be a list of lisp expressions."
+Optional DOCSTRING is a documentation string.
+If present, it should describe how to call the function.  Docstrings are
+rarely useful unless the lambda will be named, eg, using `fset'.
+Optional INTERACTIVE should be a call to the function `interactive'.
+BODY should be a list of lisp expressions.
+
+The byte-compiler treats lambda expressions specially.  If the lambda
+expression is syntactically a function to be called, it will be compiled
+unless protected by `quote'.  Conversely, quoting a lambda expression with
+`function' hints to the byte-compiler that it should compile the expression.
+\(The byte-compiler may or may not actually compile it; for example it will
+never compile lambdas nested in a data structure: `'(#'(lambda (x) x))').
+
+The byte-compiler will warn about common problems such as the form
+`(fset 'f '(lambda (x) x))' (the lambda cannot be byte-compiled; probably
+the programmer intended `#'', although leaving the lambda unquoted will
+normally suffice), but in general is it the programmer's responsibility to
+quote lambda expressions appropriately."
   `(function (lambda , at cdr)))
 
 ;; FSF 21.2 has various basic macros here.  We don't because they're either



1.13      +1 -1      XEmacs/xemacs/lisp/cus-face.el

Index: cus-face.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/cus-face.el,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -p -r1.12 -r1.13
--- cus-face.el	2005/10/25 11:28:24	1.12
+++ cus-face.el	2007/02/22 16:53:21	1.13
@@ -359,7 +359,6 @@ FACE.  Nil otherwise."
 
 ;;;###autoload
 (defun custom-theme-reset-faces (theme &rest args)
-  (custom-check-theme theme)
   "Reset the value of the face to values previously defined.
 Associate this setting with THEME.
 
@@ -368,6 +367,7 @@ ARGS is a list of lists of the form
     (face to-theme)
 
 This means reset face to its value in to-theme."
+  (custom-check-theme theme)
   (mapc #'(lambda (arg)
 	    (apply #'custom-theme-reset-internal-face arg)
 	    (custom-push-theme (car arg) 'theme-face theme 'reset (cadr arg)))



1.1049    +7 -0      XEmacs/xemacs/src/ChangeLog

Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.1048
retrieving revision 1.1049
diff -u -p -r1.1048 -r1.1049
--- ChangeLog	2007/02/22 16:19:40	1.1048
+++ ChangeLog	2007/02/22 16:53:25	1.1049
@@ -1,3 +1,10 @@
+2007-01-22  Stephen J. Turnbull  <stephen at xemacs.org>
+
+	* eval.c (quote):
+	(function):
+	* fns.c (Frequire):
+	Improve docstrings.
+
 2007-02-21  Stephen J. Turnbull  <stephen at xemacs.org>
 
 	* objects-tty.c (tty_font_spec_matches_charset): Use Aidan's enum.



1.95      +21 -16    XEmacs/xemacs/src/eval.c

Index: eval.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/eval.c,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -p -r1.94 -r1.95
--- eval.c	2007/01/20 16:57:06	1.94
+++ eval.c	2007/02/22 16:53:26	1.95
@@ -1178,14 +1178,16 @@ The return value of the `setq' form is t
 DEFUN ("quote", Fquote, 1, UNEVALLED, 0, /*
 Return the argument, without evaluating it.  `(quote x)' yields `x'.
 
-There is an alternative and more used reader syntax for `quote'.  Precede
-any Lisp object with a single apostrophe, and that Lisp object will be
-returned unevaluated. 'x is thus equivalent to (quote x).
+`quote' differs from `function' in that it is a hint that an expression is
+data, not a function.  In particular, under some circumstances the byte
+compiler will compile an expression quoted with `function', but it will
+never do so for an expression quoted with `quote'.  These issues are most
+important for lambda expressions (see `lambda').
 
-Do not use `quote' or the single apostrophe for lambda expressions that you
-would prefer to be byte-compiled.  Use `function', which see, or take
-advantage of the fact that lambda expressions are self-quoting and such
-lambda expressions will be automatically byte-compiled.
+There is an alternative, more readable, reader syntax for `quote':  a Lisp
+object preceded by `''. Thus, `'x' is equivalent to `(quote x)', in all
+contexts.  A print function may use either.  Internally the expression is
+represented as `(quote x)').
 */
        (args))
 {
@@ -1193,17 +1195,20 @@ lambda expressions will be automatically
 }
 
 DEFUN ("function", Ffunction, 1, UNEVALLED, 0, /*
-Like `quote', but preferred for objects which are functions.
+Return the argument, without evaluating it.  `(function x)' yields `x'.
 
-As with `quote' there is an alternative reader syntax for `function' which
-in practice is used more often.  Writing #'OBJECT is equivalent to writing
-\(function OBJECT), where OBJECT is some Lisp object.
+`function' differs from `quote' in that it is a hint that an expression is
+a function, not data.  In particular, under some circumstances the byte
+compiler will compile an expression quoted with `function', but it will
+never do so for an expression quoted with `quote'.  However, the byte
+compiler will not compile an expression buried in a data structure such as
+a vector or a list which is not syntactically a function.  These issues are
+most important for lambda expressions (see `lambda').
 
-In byte compilation, `function' causes a lambda expression argument to be
-compiled.  `quote' cannot do that.  lambda expressions are, however,
-self-quoting, and self-quoted lambda expressions will be byte-compiled.
-Only lambda expressions explicitly quoted with `quote' or that occur in
-nested data lists will not be byte-compiled.
+There is an alternative, more readable, reader syntax for `function':  a Lisp
+object preceded by `#''. Thus, #'x is equivalent to (function x), in all
+contexts.  A print function may use either.  Internally the expression is
+represented as `(function x)').
 */
        (args))
 {



1.66      +19 -12    XEmacs/xemacs/src/fns.c

Index: fns.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/fns.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -p -r1.65 -r1.66
--- fns.c	2007/01/20 16:57:06	1.65
+++ fns.c	2007/02/22 16:53:27	1.66
@@ -3576,19 +3576,26 @@ This function updates the value of the v
 }
 
 DEFUN ("require", Frequire, 1, 3, 0, /*
-If feature FEATURE is not loaded, load it from FILENAME.
-If FEATURE is not a member of the list `features', then the feature
-is not loaded; so load the file FILENAME.
-If FILENAME is omitted, the printname of FEATURE is used as the file name.
-If optional third argument NOERROR is non-nil, then return nil if the file
-is not found instead of signaling an error.
-Normally the return value is FEATURE.
-The normal messages at start and end of loading FILENAME are suppressed.
+Ensure that FEATURE is present in the Lisp environment.
+FEATURE is a symbol naming a collection of resources (functions, etc).
+Optional FILENAME is a library from which to load resources; it defaults to
+the print name of FEATURE.
+Optional NOERROR, if non-nil, causes require to return nil rather than signal
+`file-error' if loading the library fails.
 
-In order to make it possible for a required package to provide macros to be
-expanded at byte-compilation time, top level calls of `require' are
-evaluated both at byte-compile time and at run time.  That is, any top-level
-call to `require' is wrapped in an implicit \(eval-and-compile ...\) block.
+If feature FEATURE is present in `features', update `load-history' to reflect
+the require and return FEATURE.  Otherwise, try to load it from a library.
+The normal messages at start and end of loading are suppressed.
+If the library is successfully loaded and it calls `(provide FEATURE)', add
+FEATURE to `features', update `load-history' and return FEATURE.
+If the load succeeds but FEATURE is not provided by the library, signal
+`invalid-state'.
+
+The byte-compiler treats top-level calls to `require' specially, by evaluating
+them at compile time (and then compiling them normally).  Thus a library may
+request that definitions that should be inlined such as macros and defsubsts
+be loaded into its compilation environment.  Achieving this in other contexts
+requires an explicit \(eval-and-compile ...\) block.
 */
        (feature, filename, noerror))
 {





More information about the XEmacs-CVS mailing list