changeset 27385:f7b7fdb0f3f4

*** empty log message ***
author Richard M. Stallman <rms@gnu.org>
date Fri, 21 Jan 2000 03:42:21 +0000
parents a10a13dd0670
children 549ccf34df84
files etc/NEWS lisp/ChangeLog lispref/abbrevs.texi lispref/control.texi lispref/positions.texi lispref/symbols.texi
diffstat 6 files changed, 114 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/etc/NEWS	Fri Jan 21 03:40:33 2000 +0000
+++ b/etc/NEWS	Fri Jan 21 03:42:21 2000 +0000
@@ -911,27 +911,35 @@
 ** The function `clear-this-command-keys' now also clears the vector
 returned by function `recent-keys'.
 
-** New function `keyword-p' is an efficient type predicate for keyword
-symbols.
-
-** Variables `beginning-of-defun' and `end-of-defun', can be used to
-define handlers for the functions of the same names.  Major modes can
-define these locally instead of rebinding M-C-a etc. if the normal
-definitions of the functions are not appropriate for the mode.
-
++++
+** Variables `beginning-of-defun-function' and `end-of-defun-function'
+can be used to define handlers for the functions that find defuns.
+Major modes can define these locally instead of rebinding M-C-a
+etc. if the normal conventions for defuns are not appropriate for the
+mode.
+
++++
 ** easy-mmode-define-minor-mode now takes an additional BODY argument
 and is renamed `define-minor-mode'.
 
-** If an abbrev has only a hook, and that hook has a non-nil
-`no-self-insert' property, the return value of the hook specifies
-whether an expansion has been done or not.  If it returns nil, no
-expansion has been performed.  The character leading to the call of
-the hook will then be self-inserted.
-
++++
+** If an abbrev has a hook function which is a symbol, and that symbol
+has a non-nil `no-self-insert' property, the return value of the hook
+function specifies whether an expansion has been done or not.  If it
+returns nil, abbrev-expand also returns nil, meaning "no expansion has
+been performed."
+
+When abbrev expansion is done by typing a self-inserting character,
+and the abbrev has a hook with the `no-self-insert' property, and the
+hook function returns non-nil meaning expansion has been done,
+then the self-inserting character is not inserted.
+
++++
 ** The function `intern-soft' now accepts a symbol as first argument.
 In this case, that exact symbol is looked up in the specified obarray,
 and the function's value is nil if it is not found.
 
++++
 ** The new macro `with-syntax-table' can be used to evaluate forms
 with the syntax table of the current buffer temporarily set to a
 specified table.
@@ -943,18 +951,23 @@
 saved table is restored, even in case of an abnormal exit.  Value is
 what BODY returns.
 
++++
 ** Regular expressions now support Perl's non-greedy *? +? and ??
 operators.
 
++++
 ** The optional argument BUFFER of function file-local-copy has been
 removed since it wasn't used by anything.
 
++++
 ** The file name argument of function `file-locked-p' is now required
 instead of being optional.
 
++++
 ** The new built-in error `text-read-only' is signaled when trying to
 modify read-only text.
 
++++
 ** New functions and variables for locales.
 
 The new variable `locale-coding-system' specifies how to encode and
@@ -971,14 +984,17 @@
 `locale-language-names', `locale-charset-language-names', and
 `locale-preferred-coding-systems' to make its decisions.
 
++++
 ** syntax tables now understand nested comments.
 To declare a comment syntax as allowing nesting, just add an `n'
 modifier to either of the characters of the comment end and the comment
 start sequences.
 
++++
 ** The function `pixmap-spec-p' has been renamed `bitmap-spec-p'
 because `bitmap' is more in line with the usual X terminology.
 
++++
 ** New function `propertize'
 
 The new function `propertize' can be used to conveniently construct
@@ -996,14 +1012,28 @@
 +++
 ** push and pop macros.
 
-A simple version of the push and pop macros of Common Lisp
-is now defined in Emacs Lisp.  These macros allow only symbols
+Simple versions of the push and pop macros of Common Lisp
+are now defined in Emacs Lisp.  These macros allow only symbols
 as the place that holds the list to be changed.
 
 (push NEWELT LISTNAME)  add NEWELT to the front of LISTNAME's value.
 (pop LISTNAME)          return first elt of LISTNAME, and remove it
 			(thus altering the value of LISTNAME).
 
+** New dolist and dotimes macros.
+
+The dolist and dotimes macros of Common Lisp are now available.
+
+(dolist (VAR LIST [RESULT]) BODY...)
+      Execute body once for each element of LIST,
+      using the variable VAR to hold the current element.
+      Then return the value of RESULT, or nil if RESULT is omitted.
+
+(dotimes (VAR COUNT [RESULT]) BODY...)
+      Execute BODY with VAR bound to successive integers running from 0,
+      inclusive, to COUNT, exclusive.
+      Then return the value of RESULT, or nil if RESULT is omitted.
+
 +++
 ** Regular expressions now support Posix character classes such
 as [:alpha:], [:space:] and so on.
--- a/lisp/ChangeLog	Fri Jan 21 03:40:33 2000 +0000
+++ b/lisp/ChangeLog	Fri Jan 21 03:42:21 2000 +0000
@@ -1,5 +1,7 @@
 2000-01-20  Richard M. Stallman  <rms@caffeine.ai.mit.edu>
 
+	* subr.el (with-syntax-table): Use make-symbol, not gensym.
+
 	* emacs-lisp/lisp.el (beginning-of-defun-function):
 	Variable renamed from beginning-of-defun.
 	Do not call make-variable-buffer-local.
@@ -9,9 +11,8 @@
 	Do not call make-variable-buffer-local.
 	(end-of-defun): Use new variable name; doc fix.
 
-	* emacs-lisp/cl-macs.el (dolist, dotimes): Moved to subr.el.
-
-	* subr.el (dolist, dotimes): Moved from cl-macs.el.
+	* subr.el (dolist, dotimes): Copied from cl-macs.el
+	and made to work.
 
 	* mail/undigest.el (rmail-digest-end-regexps): 
 	Variable replaces rmail-digest-end-regexp.
--- a/lispref/abbrevs.texi	Fri Jan 21 03:40:33 2000 +0000
+++ b/lispref/abbrevs.texi	Fri Jan 21 03:42:21 2000 +0000
@@ -142,6 +142,14 @@
 non-@code{nil}, then it is called with no arguments after the abbrev is
 replaced with @var{expansion}; point is located at the end of
 @var{expansion} when @var{hook} is called.
+
+If @var{hook} is a non-nil symbol whose @code{no-self-insert} property
+is non-@code{nil}, @var{hook} can explicitly control whether to insert
+the self-inserting input character that triggered the expansion.  If
+@var{hook} returns non-@code{nil} in this case, that inhibits insertion
+of the character.  By contrast, if @var{hook} returns @code{nil},
+@code{expand-abbrev} also returns @code{nil}, as if expansion had not
+really occurred.
 @end defun
 
 @defopt only-global-abbrevs
@@ -228,6 +236,11 @@
 This command expands the abbrev before point, if any.  If point does not
 follow an abbrev, this command does nothing.  The command returns the
 abbrev symbol if it did expansion, @code{nil} otherwise.
+
+If the abbrev symbol has a hook function which is a symbol whose
+@code{no-self-insert} property is non-@code{nil}, and if the hook
+function returns @code{nil} as its value, then @code{expand-abbrev}
+returns @code{nil} even though expansion did occur.
 @end deffn
 
 @deffn Command abbrev-prefix-mark &optional arg
--- a/lispref/control.texi	Fri Jan 21 03:40:33 2000 +0000
+++ b/lispref/control.texi	Fri Jan 21 03:42:21 2000 +0000
@@ -471,6 +471,39 @@
 body, just the end test (which also does the real work of moving point).
 @end defspec
 
+  The @code{dolist} and @code{dotimes} macros provide convenient ways to
+write two common kinds of loops.
+
+@defmac dolist (var list [result]) body@dots{}
+@tindex dolist
+This construct executes @var{body} once for each element of @var{list},
+using the variable @var{var} to hold the current element.  Then it
+returns the value of evaluating @var{result}, or @code{nil} if
+@var{result} is omitted.  For example, here is how you could use
+@code{dolist} to define the @code{reverse} function:
+
+@example
+(defun reverse (list)
+  (let (value)
+    (dolist (elt list value)
+      (setq value (cons elt value)))))
+@end example
+@end defmac
+
+@defmac dotimes (var count [result]) body@dots{}
+@tindex dotimes
+This construct executes @var{body} once for each integer from 0
+(inclusive) to @var{count} (exclusive), using the variable @var{var} to
+hold the integer for the current iteration.  Then it returns the value
+of evaluating @var{result}, or @code{nil} if @var{result} is omitted.
+Here is an example of using @code{dotimes} do something 100 times:
+
+@example
+(dotimes (i 100)
+  (insert "I will not obey absurd orders\n"))
+@end example
+@end defmac
+
 @node Nonlocal Exits
 @section Nonlocal Exits
 @cindex nonlocal exits
--- a/lispref/positions.texi	Fri Jan 21 03:40:33 2000 +0000
+++ b/lispref/positions.texi	Fri Jan 21 03:42:21 2000 +0000
@@ -678,6 +678,20 @@
 open-parenthesis syntax.
 @end defopt
 
+@defvar beginning-of-defun-function
+@tindex beginning-of-defun-function
+If non-@code{nil}, this variable holds a function for finding the
+beginning of a defun.  The function @code{beginning-of-defun}
+calls this function instead of using its normal method.
+@end defvar
+
+@defvar end-of-defun-function
+@tindex end-of-defun-function
+If non-@code{nil}, this variable holds a function for finding the end of
+a defun.  The function @code{end-of-defun} calls this function instead
+of using its normal method.
+@end defvar
+
 @node Skipping Characters
 @comment  node-name,  next,  previous,  up
 @subsection Skipping Characters
--- a/lispref/symbols.texi	Fri Jan 21 03:40:33 2000 +0000
+++ b/lispref/symbols.texi	Fri Jan 21 03:42:21 2000 +0000
@@ -326,6 +326,10 @@
 a given name is already interned.  If @var{obarray} is omitted, the
 value of the global variable @code{obarray} is used.
 
+The argument @var{name} may also be a symbol; in that case,
+the function returns @var{name} if @var{name} is interned
+in the specified obarray, and otherwise @code{nil}.
+
 @smallexample
 (intern-soft "frazzle")        ; @r{No such symbol exists.}
      @result{} nil