]> code.delx.au - gnu-emacs/blobdiff - lispref/display.texi
(diff-mode-shared-map): Don't bind M-W, M-U, M-C,
[gnu-emacs] / lispref / display.texi
index 071be35e01c13ed26dd3b541a60aa42ae91304b3..60084f98e8b66422ae218a1f3056127905e168eb 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   2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+@c   2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @setfilename ../info/display
 @node Display, System Interface, Processes, Top
@@ -126,7 +126,7 @@ the rightmost column indicates a line that ``wraps'' onto the next line,
 which is also called @dfn{continuing} the line.  (The display table can
 specify alternative indicators; see @ref{Display Tables}.)
 
-  On a window system display, the @samp{$} and @samp{\} indicators are
+  On a graphical display, the @samp{$} and @samp{\} indicators are
 replaced with arrow images displayed in the window fringes
 (@pxref{Fringes}).
 
@@ -800,15 +800,15 @@ explicitly ignore invisible newlines if
 @code{line-move-ignore-invisible} is non-@code{nil} (the default), but
 only because they are explicitly programmed to do so.
 
-  However, if a command ends with point inside or immediately after
+  However, if a command ends with point inside or immediately before
 invisible text, the main editing loop moves point further forward or
 further backward (in the same direction that the command already moved
 it) until that condition is no longer true.  Thus, if the command
 moved point back into an invisible range, Emacs moves point back to
-the beginning of that range, following the previous visible character.
-If the command moved point forward into an invisible range, Emacs
-moves point forward past the first visible character that follows the
-invisible text.
+the beginning of that range, and then back one more character.  If the
+command moved point forward into an invisible range, Emacs moves point
+forward up to the first visible character that follows the invisible
+text.
 
   Incremental search can make invisible overlays visible temporarily
 and/or permanently when a match includes invisible text.  To enable
@@ -1099,7 +1099,7 @@ object that belongs to a particular buffer, and has a specified
 beginning and end.  It also has properties that you can examine and set;
 these affect the display of the text within the overlay.
 
-An overlays uses markers to record its beginning and end; thus,
+An overlay uses markers to record its beginning and end; thus,
 editing the text of the buffer adjusts the beginning and end of each
 overlay so that it stays with the text.  When you create the overlay,
 you can specify whether text inserted at the beginning should be
@@ -1651,13 +1651,13 @@ parts of Emacs text.
 However, if the variable @code{default-line-spacing} is
 non-@code{nil}, it overrides the frame's @code{line-spacing}
 parameter.  An integer value specifies the number of pixels put below
-lines on window systems.  A floating point number specifies the
+lines on graphical displays.  A floating point number specifies the
 spacing relative to the frame's default line height.
 
 @vindex line-spacing
   You can specify the line spacing for all lines in a buffer via the
 buffer-local @code{line-spacing} variable.  An integer value specifies
-the number of pixels put below lines on window systems.  A floating
+the number of pixels put below lines on graphical displays.  A floating
 point number specifies the spacing relative to the default frame line
 height.  This overrides line spacings specified for the frame.
 
@@ -1737,7 +1737,7 @@ The purpose of @var{spec} is to specify how the face should appear on
 different kinds of terminals.  It should be an alist whose elements
 have the form @code{(@var{display} @var{atts})}.  Each element's
 @sc{car}, @var{display}, specifies a class of terminals.  (The first
-element, if it s @sc{car} is @code{default}, is special---it specifies
+element, if its @sc{car} is @code{default}, is special---it specifies
 defaults for the remaining elements).  The element's @sc{cadr},
 @var{atts}, is a list of face attributes and their values; it
 specifies what the face should look like on that kind of terminal.
@@ -2722,7 +2722,9 @@ continuation, horizontal scrolling, and the overlay arrow.
 
 @menu
 * Fringe Size/Pos::     Specifying where to put the window fringes.
-* Fringe Bitmaps::      Displaying bitmaps in the window fringes.
+* Fringe Indicators::   Displaying indicator icons in the window fringes.
+* Fringe Cursors::      Displaying cursors in the right fringe.
+* Fringe Bitmaps::      Specifying bitmaps for fringe indicators.
 * Customizing Bitmaps:: Specifying your own bitmaps to use in the fringes.
 * Overlay Arrow::       Display of an arrow to indicate position.
 @end menu
@@ -2774,6 +2776,151 @@ window is used.  The value has the form @code{(@var{left-width}
 @var{right-width} @var{outside-margins})}.
 @end defun
 
+
+@node Fringe Indicators
+@subsection Fringe Indicators
+@cindex fringe indicators
+@cindex indicators, fringe
+
+  The @dfn{fringe indicators} are tiny icons Emacs displays in the
+window fringe (on a graphic display) to indicate truncated or
+continued lines, buffer boundaries, overlay arrow, etc.
+
+@defopt indicate-empty-lines
+@tindex indicate-empty-lines
+@cindex fringes, and empty line indication
+When this is non-@code{nil}, Emacs displays a special glyph in the
+fringe of each empty line at the end of the buffer, on graphical
+displays.  @xref{Fringes}.  This variable is automatically
+buffer-local in every buffer.
+@end defopt
+
+@defvar indicate-buffer-boundaries
+This buffer-local variable controls how the buffer boundaries and
+window scrolling are indicated in the window fringes.
+
+Emacs can indicate the buffer boundaries---that is, the first and last
+line in the buffer---with angle icons when they appear on the screen.
+In addition, Emacs can display an up-arrow in the fringe to show
+that there is text above the screen, and a down-arrow to show
+there is text below the screen.
+
+There are four kinds of basic values:
+
+@table @asis
+@item @code{nil}
+Don't display the icons.
+@item @code{left}
+Display them in the left fringe.
+@item @code{right}
+Display them in the right fringe.
+@item @var{anything-else}
+Display the icon at the top of the window top in the left fringe, and other
+in the right fringe.
+@end table
+
+If value is a cons @code{(@var{angles} . @var{arrows})}, @var{angles}
+controls the angle icons, and @var{arrows} controls the arrows.  Both
+@var{angles} and @var{arrows} work according to the table above.
+Thus, @code{(t .  right)} places the top angle icon in the left
+fringe, the bottom angle icon in the right fringe, and both arrows in
+the right fringe.
+@end defvar
+
+@defvar default-indicate-buffer-boundaries
+The value of this variable is the default value for
+@code{indicate-buffer-boundaries} in buffers that do not override it.
+@end defvar
+
+@defvar fringe-indicator-alist
+This buffer-local variable specifies the mapping from logical fringe
+indicators to the actual bitmaps displayed in the window fringes.
+
+These symbols identify the logical fringe indicators:
+
+@table @asis
+@item Truncation and continuation line indicators:
+@code{truncation}, @code{continuation}.
+
+@item Buffer position indicators:
+@code{up}, @code{down},
+@code{top}, @code{bottom},
+@code{top-bottom}.
+
+@item Empty line indicator:
+@code{empty-line}.
+
+@item Overlay arrow indicator:
+@code{overlay-arrow}.
+
+@item Unknown bitmap indicator:
+@code{unknown}.
+@end table
+
+  The value is an alist where each element @code{(@var{indicator} . @var{bitmaps})}
+specifies the fringe bitmaps used to display a specific logical
+fringe indicator.
+
+Here, @var{indicator} specifies the logical indicator type, and
+@var{bitmaps} is list of symbols @code{(@var{left} @var{right}
+[@var{left1} @var{right1}])} which specifies the actual bitmap shown
+in the left or right fringe for the logical indicator.
+
+The @var{left} and @var{right} symbols specify the bitmaps shown in
+the left and/or right fringe for the specific indicator.  The
+@var{left1} or @var{right1} bitmaps are used only for the `bottom' and
+`top-bottom indicators when the last (only) line in has no final
+newline.  Alternatively, @var{bitmaps} may be a single symbol which is
+used in both left and right fringes.
+
+When @code{fringe-indicator-alist} has a buffer-local value, and there
+is no bitmap defined for a logical indicator, or the bitmap is
+@code{t}, the corresponding value from the (non-local)
+@code{default-fringe-indicator-alist} is used.
+
+To completely hide a specific indicator, set the bitmap to @code{nil}.
+@end defvar
+
+@defvar default-fringe-indicator-alist
+The value of this variable is the default value for
+@code{fringe-indicator-alist} in buffers that do not override it.
+@end defvar
+
+@table @asis
+@item Standard fringe bitmaps for indicators:
+@code{left-arrow}, @code{right-arrow}, @code{up-arrow}, @code{down-arrow},
+@code{left-curly-arrow}, @code{right-curly-arrow},
+@code{left-triangle}, @code{right-triangle},
+@code{top-left-angle}, @code{top-right-angle},
+@code{bottom-left-angle}, @code{bottom-right-angle},
+@code{left-bracket}, @code{right-bracket},
+@code{filled-rectangle}, @code{hollow-rectangle},
+@code{filled-square}, @code{hollow-square},
+@code{vertical-bar}, @code{horizontal-bar},
+@code{empty-line},
+@code{question-mark}.
+@end table
+
+@node Fringe Cursors
+@subsection Fringe Cursors
+@cindex fringe cursors
+@cindex cursor, fringe
+
+  When a line is exactly as wide as the window, Emacs displays the
+cursor in the right fringe instead of using two lines.  Different
+bitmaps are used to represent the cursor in the fringe depending on
+the current buffer's cursor type.
+
+@table @asis
+@item Logical cursor types:
+@code{box} , @code{hollow}, @code{bar},
+@code{hbar}, @code{hollow-small}.
+@end table
+
+The @code{hollow-small} type is used instead of @code{hollow} when the
+normal @code{hollow-rectangle} bitmap is too tall to fit on a specific
+display line.
+
 @defvar overflow-newline-into-fringe
 If this is non-@code{nil}, lines exactly as wide as the window (not
 counting the final newline character) are not continued.  Instead,
@@ -2781,16 +2928,44 @@ when point is at the end of the line, the cursor appears in the right
 fringe.
 @end defvar
 
+@defvar fringe-cursor-alist
+This variable specifies the mapping from logical cursor type to the
+actual fringe bitmaps displayed in the right fringe.  The value is an
+alist where each element @code{(@var{cursor}. @var{bitmap})} specifies
+the fringe bitmaps used to display a specific logical cursor type in
+the fringe.  Here, @var{cursor} specifies the logical cursor type and
+@var{bitmap} is a symbol specifying the fringe bitmap to be displayed
+for that logical cursor type.
+
+When @code{fringe-cursor-alist} has a buffer-local value, and there is
+no bitmap defined for a cursor type, the corresponding value from the
+(non-local) @code{default-fringes-indicator-alist} is used.
+@end defvar
+
+@defvar default-fringes-cursor-alist
+The value of this variable is the default value for
+@code{fringe-cursor-alist} in buffers that do not override it.
+@end defvar
+
+@table @asis
+@item Standard bitmaps for displaying the cursor in right fringe:
+@code{filled-rectangle}, @code{hollow-rectangle},
+@code{filled-square}, @code{hollow-square},
+@code{vertical-bar}, @code{horizontal-bar}.
+@end table
+
+
 @node Fringe Bitmaps
 @subsection Fringe Bitmaps
 @cindex fringe bitmaps
 @cindex bitmaps, fringe
 
-  The @dfn{fringe bitmaps} are tiny icons Emacs displays in the window
-fringe (on a graphic display) to indicate truncated or continued
-lines, buffer boundaries, overlay arrow, etc.  The fringe bitmaps are
-shared by all frames and windows.  You can redefine the built-in
-fringe bitmaps, and you can define new fringe bitmaps.
+  The @dfn{fringe bitmaps} are the actual bitmaps which represent the
+logical fringe indicators for truncated or continued lines, buffer
+boundaries, overlay arrow, etc.  Fringe bitmap symbols have their own
+name space.  The fringe bitmaps are shared by all frames and windows.
+You can redefine the built-in fringe bitmaps, and you can define new
+fringe bitmaps.
 
   The way to display a bitmap in the left or right fringes for a given
 line in a window is by specifying the @code{display} property for one
@@ -2804,32 +2979,6 @@ default @code{fringe} face.  @var{face} is automatically merged with
 the @code{fringe} face, so normally @var{face} need only specify the
 foreground color for the bitmap.
 
-  These symbols identify the standard fringe bitmaps.  Evaluate
-@code{(require 'fringe)} to define them.  Fringe bitmap symbols have
-their own name space.
-
-@table @asis
-@item Truncation and continuation line bitmaps:
-@code{left-truncation}, @code{right-truncation},
-@code{continued-line}, @code{continuation-line}.
-
-@item Buffer indication bitmaps:
-@code{up-arrow}, @code{down-arrow},
-@code{top-left-angle}, @code{top-right-angle},
-@code{bottom-left-angle}, @code{bottom-right-angle},
-@code{left-bracket}, @code{right-bracket}.
-
-@item Empty line indication bitmap:
-@code{empty-line}.
-
-@item Overlay arrow bitmap:
-@code{overlay-arrow}.
-
-@item Bitmaps for displaying the cursor in right fringe:
-@code{filled-box-cursor}, @code{hollow-box-cursor}, @code{hollow-square},
-@code{bar-cursor}, @code{hbar-cursor}.
-@end table
-
 @defun fringe-bitmaps-at-pos &optional pos window
 This function returns the fringe bitmaps of the display line
 containing position @var{pos} in window @var{window}.  The return
@@ -2922,9 +3071,12 @@ otherwise appear.  Since the arrow is usually short, and the line
 usually begins with indentation, normally nothing significant is
 overwritten.
 
-The overlay string is displayed only in the buffer that this marker
-points into.  Thus, only one buffer can have an overlay arrow at any
-given time.
+The overlay-arrow string is displayed in any given buffer if the value
+of @code{overlay-arrow-position} in that buffer points into that
+buffer.  Thus, it works to can display multiple overlay arrow strings
+by creating buffer-local bindings of @code{overlay-arrow-position}.
+However, it is usually cleaner to use
+@code{overlay-arrow-variable-list} to achieve this result.
 @c !!! overlay-arrow-position: but the overlay string may remain in the display
 @c of some other buffer until an update is required.  This should be fixed
 @c now.  Is it?
@@ -3274,6 +3426,9 @@ in the @code{display} text property.
 @item @var{string}
 Display @var{string} instead of the text that has this property.
 
+Recursive display specifications are not supported---@var{string}'s
+@code{display} properties, if any, are not used.
+
 @item (image . @var{image-props})
 This kind of display specification is an image descriptor (@pxref{Images}).
 When used as a display specification, it means to display the image
@@ -3289,14 +3444,11 @@ in the range 0.0--1.0 stands for that fraction of the width or height
 of the entire image.
 
 @item ((margin nil) @var{string})
-@itemx @var{string}
 A display specification of this form means to display @var{string}
 instead of the text that has the display specification, at the same
-position as that text.  This is a special case of marginal display
-(@pxref{Display Margins}).
-
-Recursive display specifications are not supported---string display
-specifications must not have @code{display} properties themselves.
+position as that text.  It is equivalent to using just @var{string},
+but it is done as a special case of marginal display (@pxref{Display
+Margins}).
 
 @item (space-width @var{factor})
 This display specification affects all the space characters within the
@@ -3348,9 +3500,13 @@ not affect the amount of raising or lowering, which is based on the
 faces used for the text.
 @end table
 
+@c We put all the `@code{(when ...)}' on one line to encourage
+@c makeinfo's end-of-sentence heuristics to DTRT.  Previously, the dot
+@c was at eol; the info file ended up w/ two spaces rendered after it.
   You can make any display specification conditional.  To do that,
-package it in another list of the form @code{(when @var{condition} .
-@var{spec})}.  Then the specification @var{spec} applies only when
+package it in another list of the form
+@code{(when @var{condition} . @var{spec})}.
+Then the specification @var{spec} applies only when
 @var{condition} evaluates to a non-@code{nil} value.  During the
 evaluation, @code{object} is bound to the string or buffer having the
 conditional @code{display} property.  @code{position} and
@@ -3504,12 +3660,11 @@ function always returns @code{t}; for other image types, it returns
 @subsection Image Descriptors
 @cindex image descriptor
 
-  An image description is a list of the form @code{(image
-. @var{props})}, where @var{props} is a property list containing
-alternating keyword symbols (symbols whose names start with a colon) and
-their values.  You can use any Lisp object as a property, but the only
-properties that have any special meaning are certain symbols, all of
-them keywords.
+  An image description is a list of the form @code{(image . @var{props})},
+where @var{props} is a property list containing alternating keyword
+symbols (symbols whose names start with a colon) and their values.
+You can use any Lisp object as a property, but the only properties
+that have any special meaning are certain symbols, all of them keywords.
 
   Every image descriptor must contain the property @code{:type
 @var{type}} to specify the format of the image.  The value of @var{type}
@@ -3974,6 +4129,41 @@ should specify the image as follows:
 @end example
 @end defvar
 
+@defun image-load-path-for-library library image &optional path no-error
+@tindex image-load-path-for-library
+This function returns a suitable search path for images used by the
+Lisp package @var{library}.
+
+It searches for @var{image} in @code{image-load-path} (excluding
+@file{@code{data-directory}/images}) and @code{load-path}, followed by
+a path suitable for @var{library}, which includes
+@file{../../etc/images} and @file{../etc/images} relative to the
+library file itself, and then in @file{@code{data-directory}/images}.
+
+Then this function returns a list of directories which contains first
+the directory in which @var{image} was found, followed by the value of
+@code{load-path}.  If @var{path} is given, it is used instead of
+@code{load-path}.
+
+If @var{no-error} is non-@code{nil} and a suitable path can't be
+found, don't signal an error.  Instead, return a list of directories as
+before, except that @code{nil} appears in place of the image directory.
+
+Here is an example that uses a common idiom to provide compatibility
+with versions of Emacs that lack the variable @code{image-load-path}:
+
+@example
+;; Shush compiler.
+(defvar image-load-path)
+
+(let* ((load-path (image-load-path-for-library "mh-e" "mh-logo.xpm"))
+       (image-load-path (cons (car load-path)
+                              (when (boundp 'image-load-path)
+                                image-load-path))))
+  (mh-tool-bar-folder-buttons-init))
+@end example
+@end defun
+
 @node Showing Images
 @subsection Showing Images
 
@@ -4061,10 +4251,14 @@ Focus}).
 @defvar max-image-size
 @tindex max-image-size
 This variable is used to define the maximum size of image that Emacs
-will load.  If its value is a floating point number, that number is
-multiplied by the width and height of the selected frame, in pixels,
-to give the maximum image width and height.  Emacs will refuse to load
-and display any image that is larger than this.
+will load.  Emacs will refuse to load (and display) any image that is
+larger than this limit.
+
+If the value is an integer, it directly specifies the maximum
+image height and width, measured in pixels.  If it is a floating
+point number, it specifies the maximum image height and width
+as a ratio to the frame height and width.  If the value is
+non-numeric, there is no explicit limit on the size of images.
 
 The purpose of this variable is to prevent unreasonably large images
 from accidentally being loaded into Emacs.  It only takes effect the
@@ -4251,8 +4445,8 @@ this is a simple underline, like a typical web-page link.
 
   For convenience, there are two sorts of button-creation functions,
 those that add button properties to an existing region of a buffer,
-called @code{make-...button}, and those also insert the button text,
-called @code{insert-...button}.
+called @code{make-...button}, and those that also insert the button
+text, called @code{insert-...button}.
 
   The button-creation functions all take the @code{&rest} argument
 @var{properties}, which should be a sequence of @var{property value}
@@ -4592,52 +4786,6 @@ is completely independent of the user-settable tab stops used by the
 command @code{tab-to-tab-stop}.  @xref{Indent Tabs}.
 @end defopt
 
-@defopt indicate-empty-lines
-@tindex indicate-empty-lines
-@cindex fringes, and empty line indication
-When this is non-@code{nil}, Emacs displays a special glyph in the
-fringe of each empty line at the end of the buffer, on terminals that
-support it (window systems).  @xref{Fringes}.
-This variable is automatically buffer-local in every buffer.
-@end defopt
-
-@defvar indicate-buffer-boundaries
-This buffer-local variable controls how the buffer boundaries and
-window scrolling are indicated in the window fringes.
-
-Emacs can indicate the buffer boundaries---that is, the first and last
-line in the buffer---with angle icons when they appear on the screen.
-In addition, Emacs can display an up-arrow in the fringe to show
-that there is text above the screen, and a down-arrow to show
-there is text below the screen.
-
-There are four kinds of basic values:
-
-@table @asis
-@item @code{nil}
-Don't display the icons.
-@item @code{left}
-Display them in the left fringe.
-@item @code{right}
-Display them in the right fringe.
-@item @var{anything-else}
-Display the icon at the top of the window top in the left fringe, and other
-in the right fringe.
-@end table
-
-If value is a cons @code{(@var{angles} . @var{arrows})}, @var{angles}
-controls the angle icons, and @var{arrows} controls the arrows.  Both
-@var{angles} and @var{arrows} work according to the table above.
-Thus, @code{(t .  right)} places the top angle icon in the left
-fringe, the bottom angle icon in the right fringe, and both arrows in
-the right fringe.
-@end defvar
-
-@defvar default-indicate-buffer-boundaries
-The value of this variable is the default value for
-@code{indicate-buffer-boundaries} in buffers that do not override it.
-@end defvar
-
 @node Display Tables
 @section Display Tables
 
@@ -4847,7 +4995,7 @@ on character terminals.  On graphical displays, all glyphs are simple.
 @item @var{string}
 Send the characters in @var{string} to the terminal to output
 this glyph.  This alternative is available on character terminals,
-but not under a window system.
+but not on graphical displays.
 
 @item @var{integer}
 Define this glyph code as an alias for glyph code @var{integer}.  You
@@ -4889,7 +5037,7 @@ This is a synonym for @code{ding}.
 @defopt visible-bell
 This variable determines whether Emacs should flash the screen to
 represent a bell.  Non-@code{nil} means yes, @code{nil} means no.  This
-is effective on a window system, and on a character-only terminal
+is effective on graphical displays, and on text-only terminals
 provided the terminal's Termcap entry defines the visible bell
 capability (@samp{vb}).
 @end defopt