]> code.delx.au - gnu-emacs/blobdiff - lispref/text.texi
(Time Conversion): decode-time arg is optional.
[gnu-emacs] / lispref / text.texi
index 5bfc0a2f46d08f19f936fbb983b39b105ee1053c..3197a72c8d7d5e6351ad122069868a33b79e4efc 100644 (file)
@@ -1,7 +1,7 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
 @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001
-@c   Free Software Foundation, Inc. 
+@c   Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @setfilename ../info/text
 @node Text, Non-ASCII Characters, Markers, Top
@@ -89,7 +89,7 @@ buffer is @samp{@@}:
 @defun char-before &optional position
 This function returns the character in the current buffer immediately
 before position @var{position}.  If @var{position} is out of range for
-this purpose, either before the beginning of the buffer, or at or beyond
+this purpose, either at or before the beginning of the buffer, or beyond
 the end, then the value is @code{nil}.  The default for
 @var{position} is point.
 @end defun
@@ -224,6 +224,21 @@ This is the contents of buffer foo
 @end example
 @end defun
 
+@tindex current-word
+@defun current-word &optional strict really-word
+This function returns the symbol (or word) at or near point, as a string.
+The return value includes no text properties.
+
+The optional argument @var{really-word} is non-@code{nil}, it finds a
+word; otherwise, it finds a symbol (which includes word characters and
+both symbol constituent characters).
+
+If the optional argument @var{strict} is non-@code{nil}, then point
+must be in or next to the symbol or word---if no symbol or word is
+there, the function returns @code{nil}.  Otherwise, a nearby symbol or
+word on the same line is acceptable.
+@end defun
+
 @defun thing-at-point thing
 Return the @var{thing} around or next to point, as a string.
 
@@ -340,7 +355,7 @@ inserted text falls outside the overlay; if a nonempty overlay ends at
 the insertion point, the inserted text falls inside that overlay.
 @end defun
 
-@defun insert-char character &optional count inherit
+@defun insert-char character count &optional inherit
 This function inserts @var{count} instances of @var{character} into the
 current buffer before point.  The argument @var{count} should be a
 number (@code{nil} means 1), and @var{character} must be a character.
@@ -429,7 +444,7 @@ Do not try substituting your own definition of
 loop handles this function specially.
 @end deffn
 
-@deffn Command newline &optional number-of-newlines 
+@deffn Command newline &optional number-of-newlines
 This command inserts newlines into the current buffer before point.
 If @var{number-of-newlines} is supplied, that many newline characters
 are inserted.
@@ -614,7 +629,7 @@ You thought
 @end example
 @end deffn
 
-@deffn Command delete-indentation &optional join-following-p 
+@deffn Command delete-indentation &optional join-following-p
 This function joins the line point is on to the previous line, deleting
 any whitespace at the join and in some cases replacing it with one
 space.  If @var{join-following-p} is non-@code{nil},
@@ -945,7 +960,7 @@ selection from the newly killed text.  @xref{Window System Selections}.
 
   The variable @code{kill-ring} holds the kill ring contents, in the
 form of a list of strings.  The most recent kill is always at the front
-of the list. 
+of the list.
 
   The @code{kill-ring-yank-pointer} variable points to a link in the
 kill ring list, whose @sc{car} is the text to yank next.  We say it
@@ -970,7 +985,7 @@ rotate the ring so that the newly killed text is at the front.
 
   Here is a diagram that shows the variable @code{kill-ring-yank-pointer}
 pointing to the second entry in the kill ring @code{("some text" "a
-different piece of text" "yet older text")}.  
+different piece of text" "yet older text")}.
 
 @example
 @group
@@ -980,11 +995,11 @@ kill-ring                  ---- kill-ring-yank-pointer
   |     --- ---          --- ---      --- ---
    --> |   |   |------> |   |   |--> |   |   |--> nil
         --- ---          --- ---      --- ---
-         |                |            |            
-         |                |            |            
-         |                |             -->"yet older text" 
+         |                |            |
+         |                |            |
+         |                |             -->"yet older text"
          |                |
-         |                 --> "a different piece of text" 
+         |                 --> "a different piece of text"
          |
           --> "some text"
 @end group
@@ -1040,7 +1055,7 @@ to record where point was before the command.
 
 @item (@var{beg} . @var{end})
 This kind of element indicates how to delete text that was inserted.
-Upon insertion, the text occupied the range @var{beg}--@var{end} in the 
+Upon insertion, the text occupied the range @var{beg}--@var{end} in the
 buffer.
 
 @item (@var{text} . @var{position})
@@ -2123,7 +2138,7 @@ interactively.
   These commands, primarily for interactive use, act based on the
 indentation in the text.
 
-@deffn Command back-to-indentation 
+@deffn Command back-to-indentation
 @comment !!SourceFile simple.el
 This command moves point to the first non-whitespace character in the
 current line (which is the line in which point is located).  It returns
@@ -2322,7 +2337,7 @@ overlays.
 This variable holds an alist which maps property names to a list of
 alternative property names.  If a character does not specify a direct
 value for a property, the alternative property names are consulted in
-order; the first non-nil value is used.  This variable takes
+order; the first non-@code{nil} value is used.  This variable takes
 precedence over @code{default-text-properties}, and @code{category}
 properties take precedence over this variable.
 @end defvar
@@ -2361,9 +2376,11 @@ range; more often, it is useful to add, change, or delete just certain
 properties specified by name.
 
   Since text properties are considered part of the contents of the
-buffer (or string), and can affect how a buffer looks on the screen, any
-change in buffer text properties marks the buffer as modified.  Buffer
-text property changes are undoable also (@pxref{Undo}).
+buffer (or string), and can affect how a buffer looks on the screen,
+any change in buffer text properties marks the buffer as modified.
+Buffer text property changes are undoable also (@pxref{Undo}).
+Positions in a string start from 0, whereas positions in a buffer
+start from 1.
 
 @defun put-text-property start end prop value &optional object
 This function sets the @var{prop} property to @var{value} for the text
@@ -2507,7 +2524,7 @@ properties are not identical to those of the character just after
 @var{pos}.
 
 If @var{limit} is non-@code{nil}, then the scan ends at position
-@var{limit}.  If there is no property change before that point, 
+@var{limit}.  If there is no property change before that point,
 @code{next-property-change} returns @var{limit}.
 
 The value is @code{nil} if the properties remain unchanged all the way
@@ -2538,7 +2555,7 @@ returns the position of the first character beyond @var{pos} whose
 @var{pos}.
 
 If @var{limit} is non-@code{nil}, then the scan ends at position
-@var{limit}.  If there is no property change before that point, 
+@var{limit}.  If there is no property change before that point,
 @code{next-single-property-change} returns @var{limit}.
 
 The value is @code{nil} if the property remains unchanged all the way to
@@ -2745,18 +2762,20 @@ This feature is used in the mode line and for other active text.
 @cindex keymap of character
 @kindex keymap @r{(text property)}
 The @code{keymap} property specifies an additional keymap for
-commands.  The property's value for the character after point, if
-non-@code{nil}, is used for key lookup before the buffer's local map.
-(For mouse clicks, the @code{keymap} property of the character clicked
-on is the one used.)  If the property value is a symbol, the symbol's
-function definition is used as the keymap.  @xref{Active Keymaps}.
+commands.  The property's value for the character before point applies
+if it is non-@code{nil} and rear-sticky, and the property's value for
+the character after point applies if it is non-@code{nil} and
+front-sticky.  When the value applies, it is used for key lookup
+before the buffer's local map.  (For mouse clicks, the position of the
+click is used instead of the position of point.)  If the property
+value is a symbol, the symbol's function definition is used as the
+keymap.  @xref{Active Keymaps}.
 
 @item local-map
 @kindex local-map @r{(text property)}
-This property specifies a keymap to use @emph{instead of} the buffer's
-local map.  If the property value is a symbol, the symbol's function
-definition is used as the keymap.  For most purposes (perhaps all
-purposes), the @code{keymap} is superior.
+This property works like @code{keymap} except that it specifies a
+keymap to use @emph{instead of} the buffer's local map.  For most
+purposes (perhaps all purposes), the @code{keymap} is superior.
 
 @item syntax-table
 The @code{syntax-table} property overrides what the syntax table says
@@ -3050,7 +3069,7 @@ uses may be possible.
 
 We invite users to write Lisp programs to store and retrieve text
 properties in files, using these hooks, and thus to experiment with
-various data formats and find good ones.  Eventually we hope users 
+various data formats and find good ones.  Eventually we hope users
 will produce good, general extensions we can install in Emacs.
 
 We suggest not trying to handle arbitrary Lisp objects as text property
@@ -3294,7 +3313,7 @@ name, then any field boundaries are ignored.
 
 You can cause @code{constrain-to-field} to ignore all field boundaries
 (and so never constrain anything) by binding the variable
-@code{inhibit-field-text-motion} to a non-nil value.
+@code{inhibit-field-text-motion} to a non-@code{nil} value.
 @end defun
 
 @node Not Intervals
@@ -3624,7 +3643,7 @@ The decoding functions ignore newline characters in the encoded text.
 @defun base64-decode-string string
 @tindex base64-decode-string
 This function converts the string @var{string} from base 64 code into
-the corresponding decoded text.  It returns a string containing the
+the corresponding decoded text.  It returns a unibyte string containing the
 decoded text.
 
 The decoding functions ignore newline characters in the encoded text.
@@ -3713,6 +3732,9 @@ changed text, its length is simply the difference between the first two
 arguments.
 @end defvar
 
+  Output of messges into the @samp{*Messages*} buffer does not
+call these functions.
+
 @defmac combine-after-change-calls body...
 The macro executes @var{body} normally, but arranges to call the
 after-change functions just once for a series of several changes---if