aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2005-03-08 03:20:18 +0000
committerRichard M. Stallman2005-03-08 03:20:18 +0000
commitc2579664e62393dd292e2306cffd0b91f78bbf8b (patch)
treedcff9a4533cef61d40ab8fcfa926b7180a5cd76f
parentf7c1d57b8588a44f12f9ba843dd81c066470a1f6 (diff)
downloademacs-c2579664e62393dd292e2306cffd0b91f78bbf8b.tar.gz
emacs-c2579664e62393dd292e2306cffd0b91f78bbf8b.zip
(Overlay Arrow, Fringe Bitmaps, Customizing Bitmaps): Now subnodes of Fringes.
(Overlay Arrow): Document overlay-arrow-variable-list. (Fringe Size/Pos): New node, broken out of Fringes. (Display): Explain clearing vs redisplay better. (Truncation): Clarify use of bitmaps. (The Echo Area): Clarify the uses of the echo area. Add max-mini-window-height. (Progress): Clarify. (Invisible Text): Explain that main loop moves point out. (Selective Display): Say "hidden", not "invisible". (Managing Overlays): Moved up. Describe relation to Undo here. (Overlay Properties): Clarify intro. (Finding Overlays): Explain return values when nothing found. (Width): truncate-string-to-width has added arg. (Displaying Faces): Clarify and update mode line face handling. (Face Functions): Minor cleanup. (Conditional Display): Merged into Other Display Specs. (Pixel Specification, Other Display Specs): Minor cleanups. (Images, Image Descriptors): Minor cleanups. (GIF Images): Patents have expired. (Showing Images): Explain default text for insert-image. (Manipulating Button Types): Merged into Manipulating Buttons. (Making Buttons): Explain return values. (Button Buffer Commands): Add xref. (Inverse Video): Update mode-line-inverse-video. (Display Table Format): Clarify. (Active Display Table): Give defaults for window-display-table.
-rw-r--r--lispref/display.texi753
1 files changed, 392 insertions, 361 deletions
diff --git a/lispref/display.texi b/lispref/display.texi
index de2ab26cf96..8379f9f1adc 100644
--- a/lispref/display.texi
+++ b/lispref/display.texi
@@ -19,7 +19,6 @@ that Emacs presents to the user.
19* Progress:: Informing user about progress of a long operation. 19* Progress:: Informing user about progress of a long operation.
20* Invisible Text:: Hiding part of the buffer text. 20* Invisible Text:: Hiding part of the buffer text.
21* Selective Display:: Hiding part of the buffer text (the old way). 21* Selective Display:: Hiding part of the buffer text (the old way).
22* Overlay Arrow:: Display of an arrow to indicate position.
23* Temporary Displays:: Displays that go away automatically. 22* Temporary Displays:: Displays that go away automatically.
24* Overlays:: Use overlays to highlight parts of the buffer. 23* Overlays:: Use overlays to highlight parts of the buffer.
25* Width:: How wide a character or string is on the screen. 24* Width:: How wide a character or string is on the screen.
@@ -27,8 +26,6 @@ that Emacs presents to the user.
27* Faces:: A face defines a graphics style for text characters: 26* Faces:: A face defines a graphics style for text characters:
28 font, colors, etc. 27 font, colors, etc.
29* Fringes:: Controlling window fringes. 28* Fringes:: Controlling window fringes.
30* Fringe Bitmaps:: Displaying bitmaps in the window fringes.
31* Customizing Bitmaps:: Specifying your own bitmaps to use in the fringes.
32* Scroll Bars:: Controlling vertical scroll bars. 29* Scroll Bars:: Controlling vertical scroll bars.
33* Pointer Shape:: Controlling the mouse pointer shape. 30* Pointer Shape:: Controlling the mouse pointer shape.
34* Display Property:: Enabling special display features. 31* Display Property:: Enabling special display features.
@@ -45,29 +42,30 @@ that Emacs presents to the user.
45@node Refresh Screen 42@node Refresh Screen
46@section Refreshing the Screen 43@section Refreshing the Screen
47 44
48The function @code{redraw-frame} redisplays the entire contents of a 45 The function @code{redraw-frame} clears and redisplays the entire
49given frame (@pxref{Frames}). 46contents of a given frame (@pxref{Frames}). This is useful if the
47screen is corrupted.
50 48
51@c Emacs 19 feature 49@c Emacs 19 feature
52@defun redraw-frame frame 50@defun redraw-frame frame
53This function clears and redisplays frame @var{frame}. 51This function clears and redisplays frame @var{frame}.
54@end defun 52@end defun
55 53
56Even more powerful is @code{redraw-display}: 54 Even more powerful is @code{redraw-display}:
57 55
58@deffn Command redraw-display 56@deffn Command redraw-display
59This function clears and redisplays all visible frames. 57This function clears and redisplays all visible frames.
60@end deffn 58@end deffn
61 59
62 This function forces certain windows to be redisplayed 60 This function calls for redisplay of certain windows, the next time
63but does not clear them. 61redisplay is done, but does not clear them first.
64 62
65@defun force-window-update object 63@defun force-window-update &optional object
66This function forces redisplay of some or all windows. If 64This function forces redisplay of some or all windows. If
67@var{object} is a window, it forces redisplay of that window. If 65@var{object} is a window, it forces redisplay of that window. If
68@var{object} is a buffer or buffer name, it forces redisplay of all 66@var{object} is a buffer or buffer name, it forces redisplay of all
69windows displaying that buffer. If @var{object} is @code{nil}, it 67windows displaying that buffer. If @var{object} is @code{nil} (or
70forces redisplay of all windows. 68omitted), it forces redisplay of all windows.
71@end defun 69@end defun
72 70
73 Processing user input takes absolute priority over redisplay. If you 71 Processing user input takes absolute priority over redisplay. If you
@@ -130,8 +128,8 @@ the rightmost column indicates a line that ``wraps'' onto the next line,
130which is also called @dfn{continuing} the line. (The display table can 128which is also called @dfn{continuing} the line. (The display table can
131specify alternative indicators; see @ref{Display Tables}.) 129specify alternative indicators; see @ref{Display Tables}.)
132 130
133 On a windowed display, the @samp{$} and @samp{\} indicators are 131 On a window system display, the @samp{$} and @samp{\} indicators are
134replaced with graphics bitmaps displayed in the window fringes 132replaced with arrow images displayed in the window fringes
135(@pxref{Fringes}). 133(@pxref{Fringes}).
136 134
137 Note that continuation is different from filling; continuation happens 135 Note that continuation is different from filling; continuation happens
@@ -164,9 +162,6 @@ If it is non-@code{nil}, these lines are truncated; otherwise,
164 When horizontal scrolling (@pxref{Horizontal Scrolling}) is in use in 162 When horizontal scrolling (@pxref{Horizontal Scrolling}) is in use in
165a window, that forces truncation. 163a window, that forces truncation.
166 164
167 You can override the glyphs that indicate continuation or truncation
168using the display table; see @ref{Display Tables}.
169
170 If your buffer contains @emph{very} long lines, and you use 165 If your buffer contains @emph{very} long lines, and you use
171continuation to display them, just thinking about them can make Emacs 166continuation to display them, just thinking about them can make Emacs
172redisplay slow. The column computation and indentation functions also 167redisplay slow. The column computation and indentation functions also
@@ -189,14 +184,14 @@ This variable is automatically buffer-local in every buffer.
189@cindex error display 184@cindex error display
190@cindex echo area 185@cindex echo area
191 186
192The @dfn{echo area} is used for displaying messages made with the 187The @dfn{echo area} is used for displaying error messages
193@code{message} primitive, and for echoing keystrokes. It is not the 188(@pxref{Errors}), for messages made with the @code{message} primitive,
194same as the minibuffer, despite the fact that the minibuffer appears 189and for echoing keystrokes. It is not the same as the minibuffer,
195(when active) in the same place on the screen as the echo area. The 190despite the fact that the minibuffer appears (when active) in the same
196@cite{GNU Emacs Manual} specifies the rules for resolving conflicts 191place on the screen as the echo area. The @cite{GNU Emacs Manual}
197between the echo area and the minibuffer for use of that screen space 192specifies the rules for resolving conflicts between the echo area and
198(@pxref{Minibuffer,, The Minibuffer, emacs, The GNU Emacs Manual}). 193the minibuffer for use of that screen space (@pxref{Minibuffer,, The
199Error messages appear in the echo area; see @ref{Errors}. 194Minibuffer, emacs, The GNU Emacs Manual}).
200 195
201You can write output in the echo area by using the Lisp printing 196You can write output in the echo area by using the Lisp printing
202functions with @code{t} as the stream (@pxref{Output Functions}), or as 197functions with @code{t} as the stream (@pxref{Output Functions}), or as
@@ -243,9 +238,15 @@ Minibuffer depth is 0.
243@end example 238@end example
244 239
245To automatically display a message in the echo area or in a pop-buffer, 240To automatically display a message in the echo area or in a pop-buffer,
246depending on its size, use @code{display-message-or-buffer}. 241depending on its size, use @code{display-message-or-buffer} (see below).
247@end defun 242@end defun
248 243
244@defopt max-mini-window-height
245This variable specifies the maximum height for resizing minibuffer
246windows. If a float, it specifies a fraction of the height of the
247frame. If an integer, it specifies a number of lines.
248@end defopt
249
249@tindex with-temp-message 250@tindex with-temp-message
250@defmac with-temp-message message &rest body 251@defmac with-temp-message message &rest body
251This construct displays a message in the echo area temporarily, during 252This construct displays a message in the echo area temporarily, during
@@ -538,11 +539,11 @@ that warning is not logged.
538@section Reporting Operation Progress 539@section Reporting Operation Progress
539@cindex progress reporting 540@cindex progress reporting
540 541
541When an operation can take a while to finish, you should inform the 542 When an operation can take a while to finish, you should inform the
542user about the progress it makes. This way the user can estimate 543user about the progress it makes. This way the user can estimate
543remaining time and clearly see that Emacs is busy working, not hung. 544remaining time and clearly see that Emacs is busy working, not hung.
544 545
545Functions listed in this section provide simple and efficient way of 546 Functions listed in this section provide simple and efficient way of
546reporting operation progress. Here is a working example that does 547reporting operation progress. Here is a working example that does
547nothing useful: 548nothing useful:
548 549
@@ -557,15 +558,16 @@ nothing useful:
557@end example 558@end example
558 559
559@defun make-progress-reporter message min-value max-value &optional current-value min-change min-time 560@defun make-progress-reporter message min-value max-value &optional current-value min-change min-time
560This function creates a progress reporter---the object you will use as 561This function creates and returns a @dfn{progress reporter}---an
561an argument for all other functions listed here. The idea is to 562object you will use as an argument for all other functions listed
562precompute as much data as possible to make progress reporting very 563here. The idea is to precompute as much data as possible to make
563fast. 564progress reporting very fast.
564 565
565The @var{message} will be displayed in the echo area, followed by 566When this progress reporter is subsequently used, it will display
566progress percentage. @var{message} is treated as a simple string. If 567@var{message} in the echo area, followed by progress percentage.
567you need it to depend on a filename, for instance, use @code{format} 568@var{message} is treated as a simple string. If you need it to depend
568before calling this function. 569on a filename, for instance, use @code{format} before calling this
570function.
569 571
570@var{min-value} and @var{max-value} arguments stand for starting and 572@var{min-value} and @var{max-value} arguments stand for starting and
571final states of your operation. For instance, if you scan a buffer, 573final states of your operation. For instance, if you scan a buffer,
@@ -592,9 +594,10 @@ message is printed immediately.
592 594
593@defun progress-reporter-update reporter value 595@defun progress-reporter-update reporter value
594This function does the main work of reporting progress of your 596This function does the main work of reporting progress of your
595operation. It print the message of @var{reporter} followed by 597operation. It displays the message of @var{reporter}, followed by
596progress percentage determined by @var{value}. If percentage is zero, 598progress percentage determined by @var{value}. If percentage is zero,
597then it is not printed at all. 599or close enough according to the @var{min-change} and @var{min-time}
600arguments, then it is omitted from the output.
598 601
599@var{reporter} must be the result of a call to 602@var{reporter} must be the result of a call to
600@code{make-progress-reporter}. @var{value} specifies the current 603@code{make-progress-reporter}. @var{value} specifies the current
@@ -655,7 +658,9 @@ this macro this way:
655You can make characters @dfn{invisible}, so that they do not appear on 658You can make characters @dfn{invisible}, so that they do not appear on
656the screen, with the @code{invisible} property. This can be either a 659the screen, with the @code{invisible} property. This can be either a
657text property (@pxref{Text Properties}) or a property of an overlay 660text property (@pxref{Text Properties}) or a property of an overlay
658(@pxref{Overlays}). 661(@pxref{Overlays}). Cursor motion also partly ignores these
662characters; if the command loop finds point within them, it moves
663point to the other side of them.
659 664
660In the simplest case, any non-@code{nil} @code{invisible} property makes 665In the simplest case, any non-@code{nil} @code{invisible} property makes
661a character invisible. This is the default case---if you don't alter 666a character invisible. This is the default case---if you don't alter
@@ -784,10 +789,11 @@ make it invisible again.
784 @dfn{Selective display} refers to a pair of related features for 789 @dfn{Selective display} refers to a pair of related features for
785hiding certain lines on the screen. 790hiding certain lines on the screen.
786 791
787 The first variant, explicit selective display, is designed for use in 792 The first variant, explicit selective display, is designed for use
788a Lisp program: it controls which lines are hidden by altering the text. 793in a Lisp program: it controls which lines are hidden by altering the
789The invisible text feature (@pxref{Invisible Text}) has partially 794text. This kind of hiding in some ways resembles the effect of the
790replaced this feature. 795@code{invisible} property (@pxref{Invisible Text}), but the two
796features are different and do not work the same way.
791 797
792 In the second variant, the choice of lines to hide is made 798 In the second variant, the choice of lines to hide is made
793automatically based on indentation. This variant is designed to be a 799automatically based on indentation. This variant is designed to be a
@@ -795,32 +801,32 @@ user-level feature.
795 801
796 The way you control explicit selective display is by replacing a 802 The way you control explicit selective display is by replacing a
797newline (control-j) with a carriage return (control-m). The text that 803newline (control-j) with a carriage return (control-m). The text that
798was formerly a line following that newline is now invisible. Strictly 804was formerly a line following that newline is now hidden. Strictly
799speaking, it is temporarily no longer a line at all, since only newlines 805speaking, it is temporarily no longer a line at all, since only
800can separate lines; it is now part of the previous line. 806newlines can separate lines; it is now part of the previous line.
801 807
802 Selective display does not directly affect editing commands. For 808 Selective display does not directly affect editing commands. For
803example, @kbd{C-f} (@code{forward-char}) moves point unhesitatingly into 809example, @kbd{C-f} (@code{forward-char}) moves point unhesitatingly
804invisible text. However, the replacement of newline characters with 810into hidden text. However, the replacement of newline characters with
805carriage return characters affects some editing commands. For example, 811carriage return characters affects some editing commands. For
806@code{next-line} skips invisible lines, since it searches only for 812example, @code{next-line} skips hidden lines, since it searches only
807newlines. Modes that use selective display can also define commands 813for newlines. Modes that use selective display can also define
808that take account of the newlines, or that make parts of the text 814commands that take account of the newlines, or that control which
809visible or invisible. 815parts of the text are hidden.
810 816
811 When you write a selectively displayed buffer into a file, all the 817 When you write a selectively displayed buffer into a file, all the
812control-m's are output as newlines. This means that when you next read 818control-m's are output as newlines. This means that when you next read
813in the file, it looks OK, with nothing invisible. The selective display 819in the file, it looks OK, with nothing hidden. The selective display
814effect is seen only within Emacs. 820effect is seen only within Emacs.
815 821
816@defvar selective-display 822@defvar selective-display
817This buffer-local variable enables selective display. This means that 823This buffer-local variable enables selective display. This means that
818lines, or portions of lines, may be made invisible. 824lines, or portions of lines, may be made hidden.
819 825
820@itemize @bullet 826@itemize @bullet
821@item 827@item
822If the value of @code{selective-display} is @code{t}, then the character 828If the value of @code{selective-display} is @code{t}, then the character
823control-m marks the start of invisible text; the control-m, and the rest 829control-m marks the start of hidden text; the control-m, and the rest
824of the line following it, are not displayed. This is explicit selective 830of the line following it, are not displayed. This is explicit selective
825display. 831display.
826 832
@@ -830,12 +836,12 @@ lines that start with more than that many columns of indentation are not
830displayed. 836displayed.
831@end itemize 837@end itemize
832 838
833When some portion of a buffer is invisible, the vertical movement 839When some portion of a buffer is hidden, the vertical movement
834commands operate as if that portion did not exist, allowing a single 840commands operate as if that portion did not exist, allowing a single
835@code{next-line} command to skip any number of invisible lines. 841@code{next-line} command to skip any number of hidden lines.
836However, character movement commands (such as @code{forward-char}) do 842However, character movement commands (such as @code{forward-char}) do
837not skip the invisible portion, and it is possible (if tricky) to insert 843not skip the hidden portion, and it is possible (if tricky) to insert
838or delete text in an invisible portion. 844or delete text in an hidden portion.
839 845
840In the examples below, we show the @emph{display appearance} of the 846In the examples below, we show the @emph{display appearance} of the
841buffer @code{foo}, which changes with the value of 847buffer @code{foo}, which changes with the value of
@@ -873,7 +879,7 @@ change.
873 879
874@defvar selective-display-ellipses 880@defvar selective-display-ellipses
875If this buffer-local variable is non-@code{nil}, then Emacs displays 881If this buffer-local variable is non-@code{nil}, then Emacs displays
876@samp{@dots{}} at the end of a line that is followed by invisible text. 882@samp{@dots{}} at the end of a line that is followed by hidden text.
877This example is a continuation of the previous one. 883This example is a continuation of the previous one.
878 884
879@example 885@example
@@ -894,42 +900,6 @@ You can use a display table to substitute other text for the ellipsis
894(@samp{@dots{}}). @xref{Display Tables}. 900(@samp{@dots{}}). @xref{Display Tables}.
895@end defvar 901@end defvar
896 902
897@node Overlay Arrow
898@section The Overlay Arrow
899@cindex overlay arrow
900
901 The @dfn{overlay arrow} is useful for directing the user's attention
902to a particular line in a buffer. For example, in the modes used for
903interface to debuggers, the overlay arrow indicates the line of code
904about to be executed.
905
906@defvar overlay-arrow-string
907This variable holds the string to display to call attention to a
908particular line, or @code{nil} if the arrow feature is not in use.
909On a graphical display the contents of the string are ignored; instead a
910glyph is displayed in the fringe area to the left of the display area.
911@end defvar
912
913@defvar overlay-arrow-position
914This variable holds a marker that indicates where to display the overlay
915arrow. It should point at the beginning of a line. On a non-graphical
916display the arrow text
917appears at the beginning of that line, overlaying any text that would
918otherwise appear. Since the arrow is usually short, and the line
919usually begins with indentation, normally nothing significant is
920overwritten.
921
922The overlay string is displayed only in the buffer that this marker
923points into. Thus, only one buffer can have an overlay arrow at any
924given time.
925@c !!! overlay-arrow-position: but the overlay string may remain in the display
926@c of some other buffer until an update is required. This should be fixed
927@c now. Is it?
928@end defvar
929
930 You can do a similar job by creating an overlay with a
931@code{before-string} property. @xref{Overlay Properties}.
932
933@node Temporary Displays 903@node Temporary Displays
934@section Temporary Displays 904@section Temporary Displays
935 905
@@ -1092,28 +1062,152 @@ you can specify whether text inserted at the beginning should be
1092inside the overlay or outside, and likewise for the end of the overlay. 1062inside the overlay or outside, and likewise for the end of the overlay.
1093 1063
1094@menu 1064@menu
1065* Managing Overlays:: Creating and moving overlays.
1095* Overlay Properties:: How to read and set properties. 1066* Overlay Properties:: How to read and set properties.
1096 What properties do to the screen display. 1067 What properties do to the screen display.
1097* Managing Overlays:: Creating and moving overlays.
1098* Finding Overlays:: Searching for overlays. 1068* Finding Overlays:: Searching for overlays.
1099@end menu 1069@end menu
1100 1070
1071@node Managing Overlays
1072@subsection Managing Overlays
1073
1074 This section describes the functions to create, delete and move
1075overlays, and to examine their contents. Overlay changes are not
1076recorded in the buffer's undo list, since the overlays are not
1077part of the buffer's contents.
1078
1079@defun overlayp object
1080This function returns @code{t} if @var{object} is an overlay.
1081@end defun
1082
1083@defun make-overlay start end &optional buffer front-advance rear-advance
1084This function creates and returns an overlay that belongs to
1085@var{buffer} and ranges from @var{start} to @var{end}. Both @var{start}
1086and @var{end} must specify buffer positions; they may be integers or
1087markers. If @var{buffer} is omitted, the overlay is created in the
1088current buffer.
1089
1090The arguments @var{front-advance} and @var{rear-advance} specify the
1091insertion type for the start of the overlay and for the end of the
1092overlay, respectively. @xref{Marker Insertion Types}. If
1093@var{front-advance} is non-@code{nil}, text inserted at the beginning
1094of the overlay is excluded from the overlay. If @var{read-advance} is
1095non-@code{nil}, text inserted at the beginning of the overlay is
1096included in the overlay.
1097@end defun
1098
1099@defun overlay-start overlay
1100This function returns the position at which @var{overlay} starts,
1101as an integer.
1102@end defun
1103
1104@defun overlay-end overlay
1105This function returns the position at which @var{overlay} ends,
1106as an integer.
1107@end defun
1108
1109@defun overlay-buffer overlay
1110This function returns the buffer that @var{overlay} belongs to. It
1111returns @code{nil} if @var{overlay} has been deleted.
1112@end defun
1113
1114@defun delete-overlay overlay
1115This function deletes @var{overlay}. The overlay continues to exist as
1116a Lisp object, and its property list is unchanged, but it ceases to be
1117attached to the buffer it belonged to, and ceases to have any effect on
1118display.
1119
1120A deleted overlay is not permanently disconnected. You can give it a
1121position in a buffer again by calling @code{move-overlay}.
1122@end defun
1123
1124@defun move-overlay overlay start end &optional buffer
1125This function moves @var{overlay} to @var{buffer}, and places its bounds
1126at @var{start} and @var{end}. Both arguments @var{start} and @var{end}
1127must specify buffer positions; they may be integers or markers.
1128
1129If @var{buffer} is omitted, @var{overlay} stays in the same buffer it
1130was already associated with; if @var{overlay} was deleted, it goes into
1131the current buffer.
1132
1133The return value is @var{overlay}.
1134
1135This is the only valid way to change the endpoints of an overlay. Do
1136not try modifying the markers in the overlay by hand, as that fails to
1137update other vital data structures and can cause some overlays to be
1138``lost''.
1139@end defun
1140
1141 Here are some examples:
1142
1143@example
1144;; @r{Create an overlay.}
1145(setq foo (make-overlay 1 10))
1146 @result{} #<overlay from 1 to 10 in display.texi>
1147(overlay-start foo)
1148 @result{} 1
1149(overlay-end foo)
1150 @result{} 10
1151(overlay-buffer foo)
1152 @result{} #<buffer display.texi>
1153;; @r{Give it a property we can check later.}
1154(overlay-put foo 'happy t)
1155 @result{} t
1156;; @r{Verify the property is present.}
1157(overlay-get foo 'happy)
1158 @result{} t
1159;; @r{Move the overlay.}
1160(move-overlay foo 5 20)
1161 @result{} #<overlay from 5 to 20 in display.texi>
1162(overlay-start foo)
1163 @result{} 5
1164(overlay-end foo)
1165 @result{} 20
1166;; @r{Delete the overlay.}
1167(delete-overlay foo)
1168 @result{} nil
1169;; @r{Verify it is deleted.}
1170foo
1171 @result{} #<overlay in no buffer>
1172;; @r{A deleted overlay has no position.}
1173(overlay-start foo)
1174 @result{} nil
1175(overlay-end foo)
1176 @result{} nil
1177(overlay-buffer foo)
1178 @result{} nil
1179;; @r{Undelete the overlay.}
1180(move-overlay foo 1 20)
1181 @result{} #<overlay from 1 to 20 in display.texi>
1182;; @r{Verify the results.}
1183(overlay-start foo)
1184 @result{} 1
1185(overlay-end foo)
1186 @result{} 20
1187(overlay-buffer foo)
1188 @result{} #<buffer display.texi>
1189;; @r{Moving and deleting the overlay does not change its properties.}
1190(overlay-get foo 'happy)
1191 @result{} t
1192@end example
1193
1101@node Overlay Properties 1194@node Overlay Properties
1102@subsection Overlay Properties 1195@subsection Overlay Properties
1103 1196
1104 Overlay properties are like text properties in that the properties that 1197 Overlay properties are like text properties in that the properties that
1105alter how a character is displayed can come from either source. But in 1198alter how a character is displayed can come from either source. But in
1106most respects they are different. Text properties are considered a part 1199most respects they are different. @xref{Text Properties}, for comparison.
1107of the text; overlays are specifically considered not to be part of the 1200
1108text. Thus, copying text between various buffers and strings preserves 1201 Text properties are considered a part of the text; overlays and
1109text properties, but does not try to preserve overlays. Changing a 1202their properties are specifically considered not to be part of the
1110buffer's text properties marks the buffer as modified, while moving an 1203text. Thus, copying text between various buffers and strings
1111overlay or changing its properties does not. Unlike text property 1204preserves text properties, but does not try to preserve overlays.
1112changes, overlay changes are not recorded in the buffer's undo list. 1205Changing a buffer's text properties marks the buffer as modified,
1113@xref{Text Properties}, for comparison. 1206while moving an overlay or changing its properties does not. Unlike
1114 1207text property changes, overlay property changes are not recorded in
1115 These functions are used for reading and writing the properties of an 1208the buffer's undo list.
1116overlay: 1209
1210 These functions read and set the properties of an overlay:
1117 1211
1118@defun overlay-get overlay prop 1212@defun overlay-get overlay prop
1119This function returns the value of property @var{prop} recorded in 1213This function returns the value of property @var{prop} recorded in
@@ -1301,127 +1395,6 @@ buffer's local map (and the map specified by the @code{local-map}
1301property) rather than replacing it. 1395property) rather than replacing it.
1302@end table 1396@end table
1303 1397
1304@node Managing Overlays
1305@subsection Managing Overlays
1306
1307 This section describes the functions to create, delete and move
1308overlays, and to examine their contents.
1309
1310@defun overlayp object
1311This function returns @code{t} if @var{object} is an overlay.
1312@end defun
1313
1314@defun make-overlay start end &optional buffer front-advance rear-advance
1315This function creates and returns an overlay that belongs to
1316@var{buffer} and ranges from @var{start} to @var{end}. Both @var{start}
1317and @var{end} must specify buffer positions; they may be integers or
1318markers. If @var{buffer} is omitted, the overlay is created in the
1319current buffer.
1320
1321The arguments @var{front-advance} and @var{rear-advance} specify the
1322insertion type for the start of the overlay and for the end of the
1323overlay, respectively. @xref{Marker Insertion Types}. If
1324@var{front-advance} is non-@code{nil}, text inserted at the beginning
1325of the overlay is excluded from the overlay. If @var{read-advance} is
1326non-@code{nil}, text inserted at the beginning of the overlay is
1327included in the overlay.
1328@end defun
1329
1330@defun overlay-start overlay
1331This function returns the position at which @var{overlay} starts,
1332as an integer.
1333@end defun
1334
1335@defun overlay-end overlay
1336This function returns the position at which @var{overlay} ends,
1337as an integer.
1338@end defun
1339
1340@defun overlay-buffer overlay
1341This function returns the buffer that @var{overlay} belongs to. It
1342returns @code{nil} if @var{overlay} has been deleted.
1343@end defun
1344
1345@defun delete-overlay overlay
1346This function deletes @var{overlay}. The overlay continues to exist as
1347a Lisp object, and its property list is unchanged, but it ceases to be
1348attached to the buffer it belonged to, and ceases to have any effect on
1349display.
1350
1351A deleted overlay is not permanently disconnected. You can give it a
1352position in a buffer again by calling @code{move-overlay}.
1353@end defun
1354
1355@defun move-overlay overlay start end &optional buffer
1356This function moves @var{overlay} to @var{buffer}, and places its bounds
1357at @var{start} and @var{end}. Both arguments @var{start} and @var{end}
1358must specify buffer positions; they may be integers or markers.
1359
1360If @var{buffer} is omitted, @var{overlay} stays in the same buffer it
1361was already associated with; if @var{overlay} was deleted, it goes into
1362the current buffer.
1363
1364The return value is @var{overlay}.
1365
1366This is the only valid way to change the endpoints of an overlay. Do
1367not try modifying the markers in the overlay by hand, as that fails to
1368update other vital data structures and can cause some overlays to be
1369``lost''.
1370@end defun
1371
1372 Here are some examples:
1373
1374@example
1375;; @r{Create an overlay.}
1376(setq foo (make-overlay 1 10))
1377 @result{} #<overlay from 1 to 10 in display.texi>
1378(overlay-start foo)
1379 @result{} 1
1380(overlay-end foo)
1381 @result{} 10
1382(overlay-buffer foo)
1383 @result{} #<buffer display.texi>
1384;; @r{Give it a property we can check later.}
1385(overlay-put foo 'happy t)
1386 @result{} t
1387;; @r{Verify the property is present.}
1388(overlay-get foo 'happy)
1389 @result{} t
1390;; @r{Move the overlay.}
1391(move-overlay foo 5 20)
1392 @result{} #<overlay from 5 to 20 in display.texi>
1393(overlay-start foo)
1394 @result{} 5
1395(overlay-end foo)
1396 @result{} 20
1397;; @r{Delete the overlay.}
1398(delete-overlay foo)
1399 @result{} nil
1400;; @r{Verify it is deleted.}
1401foo
1402 @result{} #<overlay in no buffer>
1403;; @r{A deleted overlay has no position.}
1404(overlay-start foo)
1405 @result{} nil
1406(overlay-end foo)
1407 @result{} nil
1408(overlay-buffer foo)
1409 @result{} nil
1410;; @r{Undelete the overlay.}
1411(move-overlay foo 1 20)
1412 @result{} #<overlay from 1 to 20 in display.texi>
1413;; @r{Verify the results.}
1414(overlay-start foo)
1415 @result{} 1
1416(overlay-end foo)
1417 @result{} 20
1418(overlay-buffer foo)
1419 @result{} #<buffer display.texi>
1420;; @r{Moving and deleting the overlay does not change its properties.}
1421(overlay-get foo 'happy)
1422 @result{} t
1423@end example
1424
1425@node Finding Overlays 1398@node Finding Overlays
1426@subsection Searching for Overlays 1399@subsection Searching for Overlays
1427 1400
@@ -1457,12 +1430,14 @@ they are located at @var{beg}, or strictly between @var{beg} and @var{end}.
1457 1430
1458@defun next-overlay-change pos 1431@defun next-overlay-change pos
1459This function returns the buffer position of the next beginning or end 1432This function returns the buffer position of the next beginning or end
1460of an overlay, after @var{pos}. 1433of an overlay, after @var{pos}. If there is none, it returns
1434@code{(point-max)}.
1461@end defun 1435@end defun
1462 1436
1463@defun previous-overlay-change pos 1437@defun previous-overlay-change pos
1464This function returns the buffer position of the previous beginning or 1438This function returns the buffer position of the previous beginning or
1465end of an overlay, before @var{pos}. 1439end of an overlay, before @var{pos}. If there is none, it returns
1440@code{(point-min)}.
1466@end defun 1441@end defun
1467 1442
1468 Here's an easy way to use @code{next-overlay-change} to search for the 1443 Here's an easy way to use @code{next-overlay-change} to search for the
@@ -1496,7 +1471,7 @@ This function returns the width in columns of the string @var{string},
1496if it were displayed in the current buffer and the selected window. 1471if it were displayed in the current buffer and the selected window.
1497@end defun 1472@end defun
1498 1473
1499@defun truncate-string-to-width string width &optional start-column padding 1474@defun truncate-string-to-width string width &optional start-column padding ellipsis
1500This function returns the part of @var{string} that fits within 1475This function returns the part of @var{string} that fits within
1501@var{width} columns, as a new string. 1476@var{width} columns, as a new string.
1502 1477
@@ -1519,6 +1494,13 @@ end of the result if it falls short of @var{width}. It is also used at
1519the beginning of the result if one multi-column character in 1494the beginning of the result if one multi-column character in
1520@var{string} extends across the column @var{start-column}. 1495@var{string} extends across the column @var{start-column}.
1521 1496
1497If @var{ellipsis} is non-@code{nil}, it should be a string which will
1498replace the end of @var{str} (including any padding) if it extends
1499beyond @var{end-column}, unless the display width of @var{str} is
1500equal to or less than the display width of @var{ellipsis}. If
1501@var{ellipsis} is non-@code{nil} and not a string, it stands for
1502@code{"..."}.
1503
1522@example 1504@example
1523(truncate-string-to-width "\tab\t" 12 4) 1505(truncate-string-to-width "\tab\t" 12 4)
1524 @result{} "ab" 1506 @result{} "ab"
@@ -2286,8 +2268,10 @@ With defaults. The @code{default} face is used as the ultimate
2286default for all text. (In Emacs 19 and 20, the @code{default} 2268default for all text. (In Emacs 19 and 20, the @code{default}
2287face is used only when no other face is specified.) 2269face is used only when no other face is specified.)
2288 2270
2289For a mode line or header line, the face @code{modeline} or 2271@item
2290@code{header-line} is used just before @code{default}. 2272For a mode line or header line, the face @code{mode-line} or
2273@code{mode-line-inactive}, or @code{header-line}, is merged in just
2274before @code{default}.
2291 2275
2292@item 2276@item
2293With text properties. A character can have a @code{face} property; if 2277With text properties. A character can have a @code{face} property; if
@@ -2313,20 +2297,16 @@ number. @xref{Glyphs}.
2313 2297
2314 If these various sources together specify more than one face for a 2298 If these various sources together specify more than one face for a
2315particular character, Emacs merges the attributes of the various faces 2299particular character, Emacs merges the attributes of the various faces
2316specified. The attributes of the faces of special glyphs come first; 2300specified. For each attribute, Emacs tries first the face of any
2317then comes the face for region highlighting, if appropriate; 2301special glyph; then the face for region highlighting, if appropriate;
2318then come attributes of faces from overlays, followed by those from text 2302then the faces specified by overlays, followed by those specified by
2319properties, and last the default face. 2303text properties, then the @code{mode-line} or
2304@code{mode-line-inactive} or @code{header-line} face (if in a mode
2305line or a header line), and last the @code{default} face.
2320 2306
2321 When multiple overlays cover one character, an overlay with higher 2307 When multiple overlays cover one character, an overlay with higher
2322priority overrides those with lower priority. @xref{Overlays}. 2308priority overrides those with lower priority. @xref{Overlays}.
2323 2309
2324 In Emacs 20, if an attribute such as the font or a color is not
2325specified in any of the above ways, the frame's own font or color is
2326used. In newer Emacs versions, this cannot happen, because the
2327@code{default} face specifies all attributes---in fact, the frame's own
2328font and colors are synonymous with those of the default face.
2329
2330@node Font Selection 2310@node Font Selection
2331@subsection Font Selection 2311@subsection Font Selection
2332 2312
@@ -2469,7 +2449,7 @@ This function returns a list of all defined face names.
2469@end defun 2449@end defun
2470 2450
2471@defun copy-face old-face new-name &optional frame new-frame 2451@defun copy-face old-face new-name &optional frame new-frame
2472This function defines the face @var{new-name} as a copy of the existing 2452This function defines a face named @var{new-name} as a copy of the existing
2473face named @var{old-face}. It creates the face @var{new-name} if that 2453face named @var{old-face}. It creates the face @var{new-name} if that
2474doesn't already exist. 2454doesn't already exist.
2475 2455
@@ -2758,15 +2738,25 @@ does that, this function's value may not be accurate.
2758 2738
2759 The @dfn{fringes} of a window are thin vertical strips down the 2739 The @dfn{fringes} of a window are thin vertical strips down the
2760sides that are used for displaying bitmaps that indicate truncation, 2740sides that are used for displaying bitmaps that indicate truncation,
2761continuation, horizontal scrolling, and the overlay arrow. The 2741continuation, horizontal scrolling, and the overlay arrow.
2762fringes normally appear between the display margins and the window 2742
2763text, but you can put them outside the display margins for a specific 2743@menu
2764buffer by setting @code{fringes-outside-margins} buffer-locally to a 2744* Fringe Size/Pos:: Specifying where to put the window fringes.
2765non-@code{nil} value. 2745* Fringe Bitmaps:: Displaying bitmaps in the window fringes.
2746* Customizing Bitmaps:: Specifying your own bitmaps to use in the fringes.
2747* Overlay Arrow:: Display of an arrow to indicate position.
2748@end menu
2749
2750@node Fringe Size/Pos
2751@subsection Fringe Size and Position
2752
2753 Here's how to control the position and width of the window fringes.
2766 2754
2767@defvar fringes-outside-margins 2755@defvar fringes-outside-margins
2768If the value is non-@code{nil}, the frames appear outside 2756If the value is non-@code{nil}, the frames appear outside the display
2769the display margins. 2757margins. The fringes normally appear between the display margins and
2758the window text. It works to set @code{fringes-outside-margins}
2759buffer-locally. @xref{Display Margins}.
2770@end defvar 2760@end defvar
2771 2761
2772@defvar left-fringe-width 2762@defvar left-fringe-width
@@ -2799,7 +2789,7 @@ should appear outside of the display margins.
2799This function returns information about the fringes of a window 2789This function returns information about the fringes of a window
2800@var{window}. If @var{window} is omitted or @code{nil}, the selected 2790@var{window}. If @var{window} is omitted or @code{nil}, the selected
2801window is used. The value has the form @code{(@var{left-width} 2791window is used. The value has the form @code{(@var{left-width}
2802@var{right-width} @var{frames-outside-margins})}. 2792@var{right-width} @var{outside-margins})}.
2803@end defun 2793@end defun
2804 2794
2805@defvar overflow-newline-into-fringe 2795@defvar overflow-newline-into-fringe
@@ -2810,7 +2800,7 @@ fringe.
2810@end defvar 2800@end defvar
2811 2801
2812@node Fringe Bitmaps 2802@node Fringe Bitmaps
2813@section Fringe Bitmaps 2803@subsection Fringe Bitmaps
2814@cindex fringe bitmaps 2804@cindex fringe bitmaps
2815@cindex bitmaps, fringe 2805@cindex bitmaps, fringe
2816 2806
@@ -2870,7 +2860,7 @@ If @var{pos} is @code{nil}, that stands for the value of point in
2870@end defun 2860@end defun
2871 2861
2872@node Customizing Bitmaps 2862@node Customizing Bitmaps
2873@section Customizing Fringe Bitmaps 2863@subsection Customizing Fringe Bitmaps
2874 2864
2875@defun define-fringe-bitmap bitmap bits &optional height width align 2865@defun define-fringe-bitmap bitmap bits &optional height width align
2876This function defines the symbol @var{bitmap} as a new fringe bitmap, 2866This function defines the symbol @var{bitmap} as a new fringe bitmap,
@@ -2921,6 +2911,61 @@ The face you use here should be derived from @code{fringe}, and should
2921specify only the foreground color. 2911specify only the foreground color.
2922@end defun 2912@end defun
2923 2913
2914@node Overlay Arrow
2915@subsection The Overlay Arrow
2916@cindex overlay arrow
2917
2918 The @dfn{overlay arrow} is useful for directing the user's attention
2919to a particular line in a buffer. For example, in the modes used for
2920interface to debuggers, the overlay arrow indicates the line of code
2921about to be executed. This feature has nothing to do with
2922@dfn{overlays} (@pxref{Overlays}).
2923
2924@defvar overlay-arrow-string
2925This variable holds the string to display to call attention to a
2926particular line, or @code{nil} if the arrow feature is not in use.
2927On a graphical display the contents of the string are ignored; instead a
2928glyph is displayed in the fringe area to the left of the display area.
2929@end defvar
2930
2931@defvar overlay-arrow-position
2932This variable holds a marker that indicates where to display the overlay
2933arrow. It should point at the beginning of a line. On a non-graphical
2934display the arrow text
2935appears at the beginning of that line, overlaying any text that would
2936otherwise appear. Since the arrow is usually short, and the line
2937usually begins with indentation, normally nothing significant is
2938overwritten.
2939
2940The overlay string is displayed only in the buffer that this marker
2941points into. Thus, only one buffer can have an overlay arrow at any
2942given time.
2943@c !!! overlay-arrow-position: but the overlay string may remain in the display
2944@c of some other buffer until an update is required. This should be fixed
2945@c now. Is it?
2946@end defvar
2947
2948 You can do a similar job by creating an overlay with a
2949@code{before-string} property. @xref{Overlay Properties}.
2950
2951 You can define multiple overlay arrows via the variable
2952@code{overlay-arrow-variable-list}.
2953
2954@defvar overlay-arrow-variable-list
2955This variable's value is a list of varibles, each of which specifies
2956the position of an overlay arrow. The variable
2957@code{overlay-arrow-position} has its normal meaning because it is on
2958this list.
2959@end defvar
2960
2961Each variable on this list can have properties
2962@code{overlay-arrow-string} and @code{overlay-arrow-bitmap} that
2963specify an overlay arrow string (for text-only terminals) or fringe
2964bitmap (for graphical terminals) to display at the corresponding
2965overlay arrow position. If either property is not set, the default
2966(@code{overlay-arrow-string} or @code{overlay-arrow-fringe-bitmap}) is
2967used.
2968
2924@node Scroll Bars 2969@node Scroll Bars
2925@section Scroll Bars 2970@section Scroll Bars
2926 2971
@@ -3029,8 +3074,6 @@ display specifications and what they mean.
3029 up or down on the page; adjusting the width 3074 up or down on the page; adjusting the width
3030 of spaces within text. 3075 of spaces within text.
3031* Display Margins:: Displaying text or images to the side of the main text. 3076* Display Margins:: Displaying text or images to the side of the main text.
3032* Conditional Display:: Making any of the above features conditional
3033 depending on some Lisp expression.
3034@end menu 3077@end menu
3035 3078
3036@node Specified Space 3079@node Specified Space
@@ -3156,10 +3199,11 @@ the left-margin, use
3156to the left edge of the text area. For example, @samp{:align-to 0} in a 3199to the left edge of the text area. For example, @samp{:align-to 0} in a
3157header-line aligns with the first text column in the text area. 3200header-line aligns with the first text column in the text area.
3158 3201
3159 A value of the form @code{(@var{num} . @var{expr})} stands 3202 A value of the form @code{(@var{num} . @var{expr})} stands for the
3160multiplying the values of @var{num} and @var{expr}. For example, 3203product of the values of @var{num} and @var{expr}. For example,
3161@code{(2 . in)} specifies a width of 2 inches, while @code{(0.5 . 3204@code{(2 . in)} specifies a width of 2 inches, while @code{(0.5 .
3162@var{image})} specifies half the width (or height) of the specified image. 3205@var{image})} specifies half the width (or height) of the specified
3206image.
3163 3207
3164 The form @code{(+ @var{expr} ...)} adds up the value of the 3208 The form @code{(+ @var{expr} ...)} adds up the value of the
3165expressions. The form @code{(- @var{expr} ...)} negates or subtracts 3209expressions. The form @code{(- @var{expr} ...)} negates or subtracts
@@ -3173,9 +3217,9 @@ in the @code{display} text property.
3173 3217
3174@table @code 3218@table @code
3175@item (image . @var{image-props}) 3219@item (image . @var{image-props})
3176This is in fact an image descriptor (@pxref{Images}). When used as a 3220This display specification is an image descriptor (@pxref{Images}).
3177display specification, it means to display the image instead of the text 3221When used as a display specification, it means to display the image
3178that has the display specification. 3222instead of the text that has the display specification.
3179 3223
3180@item (slice @var{x} @var{y} @var{width} @var{height}) 3224@item (slice @var{x} @var{y} @var{width} @var{height})
3181This specification together with @code{image} specifies a @dfn{slice} 3225This specification together with @code{image} specifies a @dfn{slice}
@@ -3246,6 +3290,17 @@ not affect the amount of raising or lowering, which is based on the
3246faces used for the text. 3290faces used for the text.
3247@end table 3291@end table
3248 3292
3293 You can make any display specification conditional. To do that,
3294package it in another list of the form @code{(when @var{condition} .
3295@var{spec})}. Then the specification @var{spec} applies only when
3296@var{condition} evaluates to a non-@code{nil} value. During the
3297evaluation, @code{object} is bound to the string or buffer having the
3298conditional @code{display} property. @code{position} and
3299@code{buffer-position} are bound to the position within @code{object}
3300and the buffer position where the @code{display} property was found,
3301respectively. Both positions can be different when @code{object} is a
3302string.
3303
3249@node Display Margins 3304@node Display Margins
3250@subsection Displaying in the Margins 3305@subsection Displaying in the Margins
3251@cindex display margins 3306@cindex display margins
@@ -3308,21 +3363,6 @@ as a cons cell of the form @code{(@var{left} . @var{right})}.
3308If @var{window} is @code{nil}, the selected window is used. 3363If @var{window} is @code{nil}, the selected window is used.
3309@end defun 3364@end defun
3310 3365
3311@node Conditional Display
3312@subsection Conditional Display Specifications
3313@cindex conditional display specifications
3314
3315 You can make any display specification conditional. To do that,
3316package it in another list of the form @code{(when @var{condition} .
3317@var{spec})}. Then the specification @var{spec} applies only when
3318@var{condition} evaluates to a non-@code{nil} value. During the
3319evaluation, @code{object} is bound to the string or buffer having the
3320conditional @code{display} property. @code{position} and
3321@code{buffer-position} are bound to the position within @code{object}
3322and the buffer position where the @code{display} property was found,
3323respectively. Both positions can be different when @code{object} is a
3324string.
3325
3326@node Images 3366@node Images
3327@section Images 3367@section Images
3328@cindex images in buffers 3368@cindex images in buffers
@@ -3333,16 +3373,16 @@ property of text that is displayed (@pxref{Display Property}).
3333 3373
3334 Emacs can display a number of different image formats; some of them 3374 Emacs can display a number of different image formats; some of them
3335are supported only if particular support libraries are installed on 3375are supported only if particular support libraries are installed on
3336your machine. In some environments, Emacs allows loading image 3376your machine. In some environments, Emacs can load image
3337libraries on demand; if so, the variable @code{image-library-alist} 3377libraries on demand; if so, the variable @code{image-library-alist}
3338can be used to modify the set of known names for these dynamic 3378can be used to modify the set of known names for these dynamic
3339libraries (though it is not possible to add new image formats). 3379libraries (though it is not possible to add new image formats).
3340 3380
3341 The supported image formats include XBM, XPM (needing the 3381 The supported image formats include XBM, XPM (this requires the
3342libraries @code{libXpm} version 3.4k and @code{libz}), GIF (needing 3382libraries @code{libXpm} version 3.4k and @code{libz}), GIF (requiring
3343@code{libungif} 4.1.0), Postscript, PBM, JPEG (needing the 3383@code{libungif} 4.1.0), Postscript, PBM, JPEG (requiring the
3344@code{libjpeg} library version v6a), TIFF (needing @code{libtiff} v3.4), 3384@code{libjpeg} library version v6a), TIFF (requiring @code{libtiff}
3345and PNG (needing @code{libpng} 1.0.2). 3385v3.4), and PNG (requiring @code{libpng} 1.0.2).
3346 3386
3347 You specify one of these formats with an image type symbol. The image 3387 You specify one of these formats with an image type symbol. The image
3348type symbols are @code{xbm}, @code{xpm}, @code{gif}, @code{postscript}, 3388type symbols are @code{xbm}, @code{xpm}, @code{gif}, @code{postscript},
@@ -3423,12 +3463,12 @@ types:
3423 3463
3424@table @code 3464@table @code
3425@item :file @var{file} 3465@item :file @var{file}
3426The @code{:file} property specifies to load the image from file 3466The @code{:file} property says to load the image from file
3427@var{file}. If @var{file} is not an absolute file name, it is expanded 3467@var{file}. If @var{file} is not an absolute file name, it is expanded
3428in @code{data-directory}. 3468in @code{data-directory}.
3429 3469
3430@item :data @var{data} 3470@item :data @var{data}
3431The @code{:data} property specifies the actual contents of the image. 3471The @code{:data} property says the actual contents of the image.
3432Each image must use either @code{:data} or @code{:file}, but not both. 3472Each image must use either @code{:data} or @code{:file}, but not both.
3433For most image types, the value of the @code{:data} property should be a 3473For most image types, the value of the @code{:data} property should be a
3434string containing the image data; we recommend using a unibyte string. 3474string containing the image data; we recommend using a unibyte string.
@@ -3687,12 +3727,7 @@ specifies the actual color to use for displaying that name.
3687@subsection GIF Images 3727@subsection GIF Images
3688@cindex GIF 3728@cindex GIF
3689 3729
3690 For GIF images, specify image type @code{gif}. Because of the patents 3730 For GIF images, specify image type @code{gif}.
3691in the US covering the LZW algorithm, the continued use of GIF format is
3692a problem for the whole Internet; to end this problem, it is a good idea
3693for everyone, even outside the US, to stop using GIFs right away
3694(@uref{http://www.burnallgifs.org/}). But if you still want to use
3695them, Emacs can display them.
3696 3731
3697@table @code 3732@table @code
3698@item :index @var{index} 3733@item :index @var{index}
@@ -3871,8 +3906,9 @@ section.
3871This function inserts @var{image} in the current buffer at point. The 3906This function inserts @var{image} in the current buffer at point. The
3872value @var{image} should be an image descriptor; it could be a value 3907value @var{image} should be an image descriptor; it could be a value
3873returned by @code{create-image}, or the value of a symbol defined with 3908returned by @code{create-image}, or the value of a symbol defined with
3874@code{defimage}. The argument @var{string} specifies the text to put in 3909@code{defimage}. The argument @var{string} specifies the text to put
3875the buffer to hold the image. 3910in the buffer to hold the image. If it is omitted or @code{nil},
3911@code{insert-image} uses @code{" "} by default.
3876 3912
3877The argument @var{area} specifies whether to put the image in a margin. 3913The argument @var{area} specifies whether to put the image in a margin.
3878If it is @code{left-margin}, the image appears in the left margin; 3914If it is @code{left-margin}, the image appears in the left margin;
@@ -3983,16 +4019,16 @@ manipulating clickable (with the mouse, or via keyboard commands)
3983buttons in Emacs buffers, such as might be used for help hyper-links, 4019buttons in Emacs buffers, such as might be used for help hyper-links,
3984etc. Emacs uses buttons for the hyper-links in help text and the like. 4020etc. Emacs uses buttons for the hyper-links in help text and the like.
3985 4021
3986A button is essentially a set of properties attached (via text 4022 A button is essentially a set of properties attached (via text
3987properties or overlays) to a region of text in an Emacs buffer, which 4023properties or overlays) to a region of text in an Emacs buffer. These
3988are called its button properties. @xref{Button Properties}. 4024properties are called @dfn{button properties}.
3989 4025
3990One of the these properties (@code{action}) is a function, which will 4026 One of the these properties (@code{action}) is a function, which will
3991be called when the user invokes it using the keyboard or the mouse. 4027be called when the user invokes it using the keyboard or the mouse.
3992The invoked function may then examine the button and use its other 4028The invoked function may then examine the button and use its other
3993properties as desired. 4029properties as desired.
3994 4030
3995In some ways the Emacs button package duplicates functionality offered 4031 In some ways the Emacs button package duplicates functionality offered
3996by the widget package (@pxref{Top, , Introduction, widget, The Emacs 4032by the widget package (@pxref{Top, , Introduction, widget, The Emacs
3997Widget Library}), but the button package has the advantage that it is 4033Widget Library}), but the button package has the advantage that it is
3998much faster, much smaller, and much simpler to use (for elisp 4034much faster, much smaller, and much simpler to use (for elisp
@@ -4008,7 +4044,6 @@ entries).
4008* Making Buttons:: Adding buttons to Emacs buffers. 4044* Making Buttons:: Adding buttons to Emacs buffers.
4009* Manipulating Buttons:: Getting and setting properties of buttons. 4045* Manipulating Buttons:: Getting and setting properties of buttons.
4010* Button Buffer Commands:: Buffer-wide commands and bindings for buttons. 4046* Button Buffer Commands:: Buffer-wide commands and bindings for buttons.
4011* Manipulating Button Types::
4012@end menu 4047@end menu
4013 4048
4014@node Button Properties 4049@node Button Properties
@@ -4017,13 +4052,10 @@ entries).
4017 4052
4018 Buttons have an associated list of properties defining their 4053 Buttons have an associated list of properties defining their
4019appearance and behavior, and other arbitrary properties may be used 4054appearance and behavior, and other arbitrary properties may be used
4020for application specific purposes. 4055for application specific purposes. Some properties that have special
4021 4056meaning to the button package include:
4022Some properties that have special meaning to the button package
4023include:
4024 4057
4025@table @code 4058@table @code
4026
4027@item action 4059@item action
4028@kindex action @r{(button property)} 4060@kindex action @r{(button property)}
4029The function to call when the user invokes the button, which is passed 4061The function to call when the user invokes the button, which is passed
@@ -4078,7 +4110,7 @@ in finding regions of text that comprise buttons (which is what the
4078standard button functions do). 4110standard button functions do).
4079@end table 4111@end table
4080 4112
4081There are other properties defined for the regions of text in a 4113 There are other properties defined for the regions of text in a
4082button, but these are not generally interesting for typical uses. 4114button, but these are not generally interesting for typical uses.
4083 4115
4084@node Button Types 4116@node Button Types
@@ -4106,9 +4138,9 @@ property values. Note that this inheritance happens only when
4106reflected in its subtypes. 4138reflected in its subtypes.
4107@end defun 4139@end defun
4108 4140
4109Using @code{define-button-type} to define default properties for 4141 Using @code{define-button-type} to define default properties for
4110buttons is not necessary---buttons without any specified type use the 4142buttons is not necessary---buttons without any specified type use the
4111built-in button-type @code{button}---but it is is encouraged, since 4143built-in button-type @code{button}---but it is encouraged, since
4112doing so usually makes the resulting code clearer and more efficient. 4144doing so usually makes the resulting code clearer and more efficient.
4113 4145
4114@node Making Buttons 4146@node Making Buttons
@@ -4116,19 +4148,19 @@ doing so usually makes the resulting code clearer and more efficient.
4116@cindex making buttons 4148@cindex making buttons
4117 4149
4118 Buttons are associated with a region of text, using an overlay or 4150 Buttons are associated with a region of text, using an overlay or
4119text-properties to hold button-specific information, all of which are 4151text properties to hold button-specific information, all of which are
4120initialized from the button's type (which defaults to the built-in 4152initialized from the button's type (which defaults to the built-in
4121button type @code{button}). Like all Emacs text, the appearance of 4153button type @code{button}). Like all Emacs text, the appearance of
4122the button is governed by the @code{face} property; by default (via 4154the button is governed by the @code{face} property; by default (via
4123the @code{face} property inherited from the @code{button} button-type) 4155the @code{face} property inherited from the @code{button} button-type)
4124this is a simple underline, like a typical web-page link. 4156this is a simple underline, like a typical web-page link.
4125 4157
4126For convenience, there are two sorts of button-creation functions, 4158 For convenience, there are two sorts of button-creation functions,
4127those that add button properties to an existing region of a buffer, 4159those that add button properties to an existing region of a buffer,
4128called @code{make-...button}, and those also insert the button text, 4160called @code{make-...button}, and those also insert the button text,
4129called @code{insert-...button}. 4161called @code{insert-...button}.
4130 4162
4131The button-creation functions all take the @code{&rest} argument 4163 The button-creation functions all take the @code{&rest} argument
4132@var{properties}, which should be a sequence of @var{property value} 4164@var{properties}, which should be a sequence of @var{property value}
4133pairs, specifying properties to add to the button; see @ref{Button 4165pairs, specifying properties to add to the button; see @ref{Button
4134Properties}. In addition, the keyword argument @code{:type} may be 4166Properties}. In addition, the keyword argument @code{:type} may be
@@ -4137,40 +4169,41 @@ see @ref{Button Types}. Any properties not explicitly specified
4137during creation will be inherited from the button's type (if the type 4169during creation will be inherited from the button's type (if the type
4138defines such a property). 4170defines such a property).
4139 4171
4140The following functions add a button using an overlay 4172 The following functions add a button using an overlay
4141(@pxref{Overlays}) to hold the button properties: 4173(@pxref{Overlays}) to hold the button properties:
4142 4174
4143@defun make-button beg end &rest properties 4175@defun make-button beg end &rest properties
4144@tindex make-button 4176@tindex make-button
4145Make a button from @var{beg} to @var{end} in the current buffer. 4177This makes a button from @var{beg} to @var{end} in the
4178current buffer, and returns it.
4146@end defun 4179@end defun
4147 4180
4148@defun insert-button label &rest properties 4181@defun insert-button label &rest properties
4149@tindex insert-button 4182@tindex insert-button
4150Insert a button with the label @var{label}. 4183This insert a button with the label @var{label} at point,
4184and returns it.
4151@end defun 4185@end defun
4152 4186
4153The following functions are similar, but use Emacs text-properties 4187 The following functions are similar, but use Emacs text properties
4154(@pxref{Text Properties}) to hold the button properties, making the 4188(@pxref{Text Properties}) to hold the button properties, making the
4155button actually part of the text instead of being a property of the 4189button actually part of the text instead of being a property of the
4156buffer (using text-properties is usually faster than using overlays, 4190buffer. Buttons using text properties do not create markers into the
4157so this may be preferable when creating large numbers of buttons): 4191buffer, which is important for speed when you use extremely large
4192numbers of buttons. Both functions return the position of the start
4193of the new button:
4158 4194
4159@defun make-text-button beg end &rest properties 4195@defun make-text-button beg end &rest properties
4160@tindex make-text-button 4196@tindex make-text-button
4161Make a button from @var{beg} to @var{end} in the current buffer, using 4197This makes a button from @var{beg} to @var{end} in the current buffer, using
4162text-properties. 4198text properties.
4163@end defun 4199@end defun
4164 4200
4165@defun insert-text-button label &rest properties 4201@defun insert-text-button label &rest properties
4166@tindex insert-text-button 4202@tindex insert-text-button
4167Insert a button with the label @var{label}, using text-properties. 4203This inserts a button with the label @var{label} at point, using text
4204properties.
4168@end defun 4205@end defun
4169 4206
4170Buttons using text-properties retain no markers into the buffer are
4171retained, which is important for speed in cases where there are
4172extremely large numbers of buttons.
4173
4174@node Manipulating Buttons 4207@node Manipulating Buttons
4175@subsection Manipulating Buttons 4208@subsection Manipulating Buttons
4176@cindex manipulating buttons 4209@cindex manipulating buttons
@@ -4234,6 +4267,21 @@ Return @code{t} if @var{button} has button-type @var{type}, or one of
4234Return the button at position @var{pos} in the current buffer, or @code{nil}. 4267Return the button at position @var{pos} in the current buffer, or @code{nil}.
4235@end defun 4268@end defun
4236 4269
4270@defun button-type-put type prop val
4271@tindex button-type-put
4272Set the button-type @var{type}'s @var{prop} property to @var{val}.
4273@end defun
4274
4275@defun button-type-get type prop
4276@tindex button-type-get
4277Get the property of button-type @var{type} named @var{prop}.
4278@end defun
4279
4280@defun button-type-subtype-p type supertype
4281@tindex button-type-subtype-p
4282Return @code{t} if button-type @var{type} is a subtype of @var{supertype}.
4283@end defun
4284
4237@node Button Buffer Commands 4285@node Button Buffer Commands
4238@subsection Button Buffer Commands 4286@subsection Button Buffer Commands
4239@cindex button buffer commands 4287@cindex button buffer commands
@@ -4251,8 +4299,9 @@ which uses buttons may want to use @code{button-buffer-map} as a
4251parent keymap for its keymap. 4299parent keymap for its keymap.
4252 4300
4253If the button has a non-@code{nil} @code{follow-link} property, and 4301If the button has a non-@code{nil} @code{follow-link} property, and
4254@var{mouse-1-click-follows-link} is set, a @key{Mouse-1} click will 4302@var{mouse-1-click-follows-link} is set, a quick @key{Mouse-1} click
4255also activate the @code{push-button} command. 4303will also activate the @code{push-button} command.
4304@xref{Links and Mouse-1}.
4256 4305
4257@deffn Command push-button &optional pos use-mouse-action 4306@deffn Command push-button &optional pos use-mouse-action
4258@tindex push-button 4307@tindex push-button
@@ -4304,25 +4353,6 @@ buffer. If @var{count-current} is non-@code{nil}, count any button at
4304@var{pos} in the search, instead of starting at the next button. 4353@var{pos} in the search, instead of starting at the next button.
4305@end defun 4354@end defun
4306 4355
4307@node Manipulating Button Types
4308@subsection Manipulating Button Types
4309@cindex manipulating button types
4310
4311@defun button-type-put type prop val
4312@tindex button-type-put
4313Set the button-type @var{type}'s @var{prop} property to @var{val}.
4314@end defun
4315
4316@defun button-type-get type prop
4317@tindex button-type-get
4318Get the property of button-type @var{type} named @var{prop}.
4319@end defun
4320
4321@defun button-type-subtype-p type supertype
4322@tindex button-type-subtype-p
4323Return @code{t} if button-type @var{type} is a subtype of @var{supertype}.
4324@end defun
4325
4326@node Blinking 4356@node Blinking
4327@section Blinking Parentheses 4357@section Blinking Parentheses
4328@cindex parenthesis matching 4358@cindex parenthesis matching
@@ -4396,14 +4426,10 @@ default is @code{nil}.
4396@end defopt 4426@end defopt
4397 4427
4398@defopt mode-line-inverse-video 4428@defopt mode-line-inverse-video
4399This variable controls the use of inverse video for mode lines and menu 4429This variable controls the use of inverse video for mode lines and
4400bars. If it is non-@code{nil}, then these lines are displayed in 4430menu bars. If it is non-@code{nil}, then these lines are displayed in
4401inverse video. Otherwise, these lines are displayed normally, just like 4431the face @code{mode-line}. Otherwise, these lines are displayed
4402other text. The default is @code{t}. 4432normally, just like other text. The default is @code{t}.
4403
4404For window frames, this feature actually applies the face named
4405@code{mode-line}; that face is normally set up as the inverse of the
4406default face, unless you change it.
4407@end defopt 4433@end defopt
4408 4434
4409@node Usual Display 4435@node Usual Display
@@ -4587,22 +4613,26 @@ means to use the default for that slot, as stated below.
4587@table @asis 4613@table @asis
4588@item 0 4614@item 0
4589The glyph for the end of a truncated screen line (the default for this 4615The glyph for the end of a truncated screen line (the default for this
4590is @samp{$}). @xref{Glyphs}. Newer Emacs versions, on some platforms, 4616is @samp{$}). @xref{Glyphs}. On graphical terminals, Emacs uses
4591display arrows to indicate truncation---the display table has no effect 4617arrows in the fringes to indicate truncation, so the display table has
4592in these situations. 4618no effect.
4619
4593@item 1 4620@item 1
4594The glyph for the end of a continued line (the default is @samp{\}). 4621The glyph for the end of a continued line (the default is @samp{\}).
4595Newer Emacs versions, on some platforms, display curved arrows to 4622On graphical terminals, Emacs uses curved arrows in the fringes to
4596indicate continuation---the display table has no effect in these 4623indicate continuation, so the display table has no effect.
4597situations. 4624
4598@item 2 4625@item 2
4599The glyph for indicating a character displayed as an octal character 4626The glyph for indicating a character displayed as an octal character
4600code (the default is @samp{\}). 4627code (the default is @samp{\}).
4628
4601@item 3 4629@item 3
4602The glyph for indicating a control character (the default is @samp{^}). 4630The glyph for indicating a control character (the default is @samp{^}).
4631
4603@item 4 4632@item 4
4604A vector of glyphs for indicating the presence of invisible lines (the 4633A vector of glyphs for indicating the presence of invisible lines (the
4605default is @samp{...}). @xref{Selective Display}. 4634default is @samp{...}). @xref{Selective Display}.
4635
4606@item 5 4636@item 5
4607The glyph used to draw the border between side-by-side windows (the 4637The glyph used to draw the border between side-by-side windows (the
4608default is @samp{|}). @xref{Splitting Windows}. This takes effect only 4638default is @samp{|}). @xref{Splitting Windows}. This takes effect only
@@ -4662,9 +4692,10 @@ table for buffer @var{b} if it has one; otherwise, the standard display
4662table if any. The display table chosen is called the @dfn{active} 4692table if any. The display table chosen is called the @dfn{active}
4663display table. 4693display table.
4664 4694
4665@defun window-display-table window 4695@defun window-display-table &optional window
4666This function returns @var{window}'s display table, or @code{nil} 4696This function returns @var{window}'s display table, or @code{nil}
4667if @var{window} does not have an assigned display table. 4697if @var{window} does not have an assigned display table. The default
4698for @var{window} is the selected window.
4668@end defun 4699@end defun
4669 4700
4670@defun set-window-display-table window table 4701@defun set-window-display-table window table