bugtracker: Correct locations of bzr *.conf files.
[bpt/emacs.git] / doc / lispref / text.texi
index 5636162..025bf1b 100644 (file)
@@ -1,7 +1,8 @@
 @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   2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+@c   2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+@c   Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @setfilename ../../info/text
 @node Text, Non-ASCII Characters, Markers, Top
@@ -42,7 +43,7 @@ the character after point.
 * The Kill Ring::    Where removed text sometimes is saved for later use.
 * Undo::             Undoing changes to the text of a buffer.
 * Maintaining Undo:: How to enable and disable undo information.
-                       How to control how much information is kept.
+                        How to control how much information is kept.
 * Filling::          Functions for explicit filling.
 * Margins::          How to specify margins for filling commands.
 * Adaptive Fill::    Adaptive Fill mode chooses a fill prefix from context.
@@ -821,7 +822,7 @@ would be difficult to change the terminology now.
 * Kill Functions::         Functions that kill text.
 * Yanking::                How yanking is done.
 * Yank Commands::          Commands that access the kill ring.
-* Low-Level Kill Ring::           Functions and variables for kill ring access.
+* Low-Level Kill Ring::    Functions and variables for kill ring access.
 * Internals of Kill Ring:: Variables that hold kill ring data.
 @end menu
 
@@ -864,7 +865,7 @@ adds it to the most recent element.  It determines automatically (using
 @code{last-command}) whether the previous command was a kill command,
 and if so appends the killed text to the most recent entry.
 
-@deffn Command kill-region start end &optional yank-handler
+@deffn Command kill-region start end
 This function kills the text in the region defined by @var{start} and
 @var{end}.  The text is deleted but saved in the kill ring, along with
 its text properties.  The value is always @code{nil}.
@@ -872,17 +873,10 @@ its text properties.  The value is always @code{nil}.
 In an interactive call, @var{start} and @var{end} are point and
 the mark.
 
-@c Emacs 19 feature
 If the buffer or text is read-only, @code{kill-region} modifies the kill
 ring just the same, then signals an error without modifying the buffer.
 This is convenient because it lets the user use a series of kill
 commands to copy text from a read-only buffer into the kill ring.
-
-If @var{yank-handler} is non-@code{nil}, this puts that value onto
-the string of killed text, as a @code{yank-handler} text property.
-@xref{Yanking}.  Note that if @var{yank-handler} is @code{nil}, any
-@code{yank-handler} properties present on the killed text are copied
-onto the kill ring, like other text properties.
 @end deffn
 
 @defopt kill-read-only-ok
@@ -899,10 +893,10 @@ from the buffer.  It returns @code{nil}.
 The command does not set @code{this-command} to @code{kill-region}, so a
 subsequent kill command does not append to the same kill ring entry.
 
-Don't call @code{copy-region-as-kill} in Lisp programs unless you aim to
-support Emacs 18.  For newer Emacs versions, it is better to use
-@code{kill-new} or @code{kill-append} instead.  @xref{Low-Level Kill
-Ring}.
+@c FIXME Why is it better?  Why isn't copy-region-as-kill obsolete then?
+@c Why is it used in many places in Emacs?
+In Lisp programs, it is better to use @code{kill-new} or
+@code{kill-append} instead of this command.  @xref{Low-Level Kill Ring}.
 @end deffn
 
 @node Yanking
@@ -1040,8 +1034,8 @@ text property, if there is one.
 @subsection Low-Level Kill Ring
 
   These functions and variables provide access to the kill ring at a
-lower level, but still convenient for use in Lisp programs, because they
-take care of interaction with window system selections
+lower level, but are still convenient for use in Lisp programs,
+because they take care of interaction with window system selections
 (@pxref{Window System Selections}).
 
 @defun current-kill n &optional do-not-move
@@ -1067,7 +1061,7 @@ it returns the entry pointed at by the yanking pointer and does not
 move the yanking pointer.
 @end defun
 
-@defun kill-new string &optional replace yank-handler
+@defun kill-new string &optional replace
 This function pushes the text @var{string} onto the kill ring and
 makes the yanking pointer point to it.  It discards the oldest entry
 if appropriate.  It also invokes the value of
@@ -1076,25 +1070,15 @@ if appropriate.  It also invokes the value of
 If @var{replace} is non-@code{nil}, then @code{kill-new} replaces the
 first element of the kill ring with @var{string}, rather than pushing
 @var{string} onto the kill ring.
-
-If @var{yank-handler} is non-@code{nil}, this puts that value onto
-the string of killed text, as a @code{yank-handler} property.
-@xref{Yanking}.  Note that if @var{yank-handler} is @code{nil}, then
-@code{kill-new} copies any @code{yank-handler} properties present on
-@var{string} onto the kill ring, as it does with other text properties.
 @end defun
 
-@defun kill-append string before-p &optional yank-handler
+@defun kill-append string before-p
 This function appends the text @var{string} to the first entry in the
 kill ring and makes the yanking pointer point to the combined entry.
 Normally @var{string} goes at the end of the entry, but if
 @var{before-p} is non-@code{nil}, it goes at the beginning.  This
 function also invokes the value of @code{interprogram-cut-function}
-(see below).  This handles @var{yank-handler} just like
-@code{kill-new}, except that if @var{yank-handler} is different from
-the @code{yank-handler} property of the first entry of the kill ring,
-@code{kill-append} pushes the concatenated string onto the kill ring,
-instead of replacing the original first entry with it.
+(see below).
 @end defun
 
 @defvar interprogram-paste-function
@@ -1298,13 +1282,16 @@ This function places a boundary element in the undo list.  The undo
 command stops at such a boundary, and successive undo commands undo
 to earlier and earlier boundaries.  This function returns @code{nil}.
 
-The editor command loop automatically creates an undo boundary before
-each key sequence is executed.  Thus, each undo normally undoes the
-effects of one command.  Self-inserting input characters are an
-exception.  The command loop makes a boundary for the first such
-character; the next 19 consecutive self-inserting input characters do
-not make boundaries, and then the 20th does, and so on as long as
-self-inserting characters continue.
+The editor command loop automatically calls @code{undo-boundary} just
+before executing each key sequence, so that each undo normally undoes
+the effects of one command.  As an exception, the command
+@code{self-insert-command}, which produces self-inserting input
+characters (@pxref{Commands for Insertion}), may remove the boundary
+inserted by the command loop: a boundary is accepted for the first
+such character, the next 19 consecutive self-inserting input
+characters do not have boundaries, and then the 20th does; and so on
+as long as the self-inserting characters continue.  Hence, sequences
+of consecutive character insertions can be undone as a group.
 
 All buffer modifications add a boundary whenever the previous undoable
 change was made in some other buffer.  This is to ensure that
@@ -1629,15 +1616,9 @@ As a practical matter, if you are writing text for other people to
 read, you should set @code{fill-column} to no more than 70.  Otherwise
 the line will be too long for people to read comfortably, and this can
 make the text seem clumsy.
-@end defopt
-
-@defvar default-fill-column
-The value of this variable is the default value for @code{fill-column} in
-buffers that do not override it.  This is the same as
-@code{(default-value 'fill-column)}.
 
-The default value for @code{default-fill-column} is 70.
-@end defvar
+The default value for @code{fill-column} is 70.
+@end defopt
 
 @deffn Command set-left-margin from to margin
 This sets the @code{left-margin} property on the text from @var{from} to
@@ -2599,9 +2580,9 @@ along with the characters; this includes such diverse functions as
 
 @menu
 * Examining Properties::   Looking at the properties of one character.
-* Changing Properties::           Setting the properties of a range of text.
-* Property Search::       Searching for where a property changes value.
-* Special Properties::    Particular properties with special meanings.
+* Changing Properties::    Setting the properties of a range of text.
+* Property Search::        Searching for where a property changes value.
+* Special Properties::     Particular properties with special meanings.
 * Format Properties::      Properties for representing formatting of text.
 * Sticky Properties::      How inserted text gets properties from
                              neighboring text.
@@ -2611,8 +2592,8 @@ along with the characters; this includes such diverse functions as
                              do something when you click on them.
 * Fields::                 The @code{field} property defines
                              fields within the buffer.
-* Not Intervals::         Why text properties do not use
-                            Lisp-visible text intervals.
+* Not Intervals::          Why text properties do not use
+                             Lisp-visible text intervals.
 @end menu
 
 @node Examining Properties
@@ -3018,7 +2999,7 @@ time you want to specify a particular attribute for certain text.
 
 @item
 A cons cell with the form @code{(foreground-color . @var{color-name})}
-or @code{(background-color . @var{color-name})}.  These are older,
+or @code{(background-color . @var{color-name})}.  These are old,
 deprecated equivalents for @code{(:foreground @var{color-name})} and
 @code{(:background @var{color-name})}.  Please convert code that uses
 them.
@@ -3037,7 +3018,7 @@ The @code{font-lock-face} property is equivalent to the @code{face}
 property when Font Lock mode is enabled.  When Font Lock mode is disabled,
 @code{font-lock-face} has no effect.
 
-The @code{font-lock-mode} property is useful for special modes that
+The @code{font-lock-face} property is useful for special modes that
 implement their own highlighting.  @xref{Precalculated Fontification}.
 
 @item mouse-face
@@ -3172,9 +3153,20 @@ Consecutive characters with the same @code{field} property constitute a
 @item cursor
 @kindex cursor @r{(text property)}
 Normally, the cursor is displayed at the end of any overlay and text
-property strings present at the current window position.  You can
+property strings present at the current buffer position.  You can
 place the cursor on any desired character of these strings by giving
-that character a non-@code{nil} @var{cursor} text property.
+that character a non-@code{nil} @code{cursor} text property.  In
+addition, if the value of the @code{cursor} property of an overlay
+string is an integer number, it specifies the number of buffer's
+character positions associated with the overlay string; this way,
+Emacs will display the cursor on the character with that property
+regardless of whether the current buffer position is actually covered
+by the overlay.  Specifically, if the value of the @code{cursor}
+property of a character is the number @var{n}, the cursor will be
+displayed on this character for any buffer position in the range
+@code{[@var{ovpos}..@var{ovpos}+@var{n}]}, where @var{ovpos} is the
+starting buffer position covered by the overlay (@pxref{Managing
+Overlays}).
 
 @item pointer
 @kindex pointer @r{(text property)}
@@ -3519,13 +3511,12 @@ following command:
 (defun dired-mouse-find-file-other-window (event)
   "In Dired, visit the file or directory name you click on."
   (interactive "e")
-  (let (window pos file)
-    (save-excursion
-      (setq window (posn-window (event-end event))
-            pos (posn-point (event-end event)))
-      (if (not (windowp window))
-          (error "No file chosen"))
-      (set-buffer (window-buffer window))
+  (let ((window (posn-window (event-end event)))
+        (pos (posn-point (event-end event)))
+        file)
+    (if (not (windowp window))
+        (error "No file chosen"))
+    (with-current-buffer (window-buffer window)
       (goto-char pos)
       (setq file (dired-get-file-for-visit)))
     (if (file-directory-p file)
@@ -4271,6 +4262,4 @@ code that is itself run from a modification hook, then rebind locally
 @code{inhibit-modification-hooks} to @code{nil}.
 @end defvar
 
-@ignore
-   arch-tag: 3721e738-a1cb-4085-bc1a-6cb8d8e1d32b
-@end ignore
+