diff options
| author | Richard M. Stallman | 2005-03-08 03:20:18 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2005-03-08 03:20:18 +0000 |
| commit | c2579664e62393dd292e2306cffd0b91f78bbf8b (patch) | |
| tree | dcff9a4533cef61d40ab8fcfa926b7180a5cd76f | |
| parent | f7c1d57b8588a44f12f9ba843dd81c066470a1f6 (diff) | |
| download | emacs-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.texi | 753 |
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 | ||
| 48 | The function @code{redraw-frame} redisplays the entire contents of a | 45 | The function @code{redraw-frame} clears and redisplays the entire |
| 49 | given frame (@pxref{Frames}). | 46 | contents of a given frame (@pxref{Frames}). This is useful if the |
| 47 | screen is corrupted. | ||
| 50 | 48 | ||
| 51 | @c Emacs 19 feature | 49 | @c Emacs 19 feature |
| 52 | @defun redraw-frame frame | 50 | @defun redraw-frame frame |
| 53 | This function clears and redisplays frame @var{frame}. | 51 | This function clears and redisplays frame @var{frame}. |
| 54 | @end defun | 52 | @end defun |
| 55 | 53 | ||
| 56 | Even 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 |
| 59 | This function clears and redisplays all visible frames. | 57 | This 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 |
| 63 | but does not clear them. | 61 | redisplay is done, but does not clear them first. |
| 64 | 62 | ||
| 65 | @defun force-window-update object | 63 | @defun force-window-update &optional object |
| 66 | This function forces redisplay of some or all windows. If | 64 | This 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 |
| 69 | windows displaying that buffer. If @var{object} is @code{nil}, it | 67 | windows displaying that buffer. If @var{object} is @code{nil} (or |
| 70 | forces redisplay of all windows. | 68 | omitted), 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, | |||
| 130 | which is also called @dfn{continuing} the line. (The display table can | 128 | which is also called @dfn{continuing} the line. (The display table can |
| 131 | specify alternative indicators; see @ref{Display Tables}.) | 129 | specify 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 |
| 134 | replaced with graphics bitmaps displayed in the window fringes | 132 | replaced 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 |
| 165 | a window, that forces truncation. | 163 | a window, that forces truncation. |
| 166 | 164 | ||
| 167 | You can override the glyphs that indicate continuation or truncation | ||
| 168 | using 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 |
| 171 | continuation to display them, just thinking about them can make Emacs | 166 | continuation to display them, just thinking about them can make Emacs |
| 172 | redisplay slow. The column computation and indentation functions also | 167 | redisplay 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 | ||
| 192 | The @dfn{echo area} is used for displaying messages made with the | 187 | The @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, |
| 194 | same as the minibuffer, despite the fact that the minibuffer appears | 189 | and 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 | 190 | despite the fact that the minibuffer appears (when active) in the same |
| 196 | @cite{GNU Emacs Manual} specifies the rules for resolving conflicts | 191 | place on the screen as the echo area. The @cite{GNU Emacs Manual} |
| 197 | between the echo area and the minibuffer for use of that screen space | 192 | specifies the rules for resolving conflicts between the echo area and |
| 198 | (@pxref{Minibuffer,, The Minibuffer, emacs, The GNU Emacs Manual}). | 193 | the minibuffer for use of that screen space (@pxref{Minibuffer,, The |
| 199 | Error messages appear in the echo area; see @ref{Errors}. | 194 | Minibuffer, emacs, The GNU Emacs Manual}). |
| 200 | 195 | ||
| 201 | You can write output in the echo area by using the Lisp printing | 196 | You can write output in the echo area by using the Lisp printing |
| 202 | functions with @code{t} as the stream (@pxref{Output Functions}), or as | 197 | functions 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 | ||
| 245 | To automatically display a message in the echo area or in a pop-buffer, | 240 | To automatically display a message in the echo area or in a pop-buffer, |
| 246 | depending on its size, use @code{display-message-or-buffer}. | 241 | depending 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 | ||
| 245 | This variable specifies the maximum height for resizing minibuffer | ||
| 246 | windows. If a float, it specifies a fraction of the height of the | ||
| 247 | frame. 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 |
| 251 | This construct displays a message in the echo area temporarily, during | 252 | This 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 | ||
| 541 | When 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 |
| 542 | user about the progress it makes. This way the user can estimate | 543 | user about the progress it makes. This way the user can estimate |
| 543 | remaining time and clearly see that Emacs is busy working, not hung. | 544 | remaining time and clearly see that Emacs is busy working, not hung. |
| 544 | 545 | ||
| 545 | Functions listed in this section provide simple and efficient way of | 546 | Functions listed in this section provide simple and efficient way of |
| 546 | reporting operation progress. Here is a working example that does | 547 | reporting operation progress. Here is a working example that does |
| 547 | nothing useful: | 548 | nothing 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 |
| 560 | This function creates a progress reporter---the object you will use as | 561 | This function creates and returns a @dfn{progress reporter}---an |
| 561 | an argument for all other functions listed here. The idea is to | 562 | object you will use as an argument for all other functions listed |
| 562 | precompute as much data as possible to make progress reporting very | 563 | here. The idea is to precompute as much data as possible to make |
| 563 | fast. | 564 | progress reporting very fast. |
| 564 | 565 | ||
| 565 | The @var{message} will be displayed in the echo area, followed by | 566 | When this progress reporter is subsequently used, it will display |
| 566 | progress percentage. @var{message} is treated as a simple string. If | 567 | @var{message} in the echo area, followed by progress percentage. |
| 567 | you 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 |
| 568 | before calling this function. | 569 | on a filename, for instance, use @code{format} before calling this |
| 570 | function. | ||
| 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 |
| 571 | final states of your operation. For instance, if you scan a buffer, | 573 | final 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 |
| 594 | This function does the main work of reporting progress of your | 596 | This function does the main work of reporting progress of your |
| 595 | operation. It print the message of @var{reporter} followed by | 597 | operation. It displays the message of @var{reporter}, followed by |
| 596 | progress percentage determined by @var{value}. If percentage is zero, | 598 | progress percentage determined by @var{value}. If percentage is zero, |
| 597 | then it is not printed at all. | 599 | or close enough according to the @var{min-change} and @var{min-time} |
| 600 | arguments, 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: | |||
| 655 | You can make characters @dfn{invisible}, so that they do not appear on | 658 | You can make characters @dfn{invisible}, so that they do not appear on |
| 656 | the screen, with the @code{invisible} property. This can be either a | 659 | the screen, with the @code{invisible} property. This can be either a |
| 657 | text property (@pxref{Text Properties}) or a property of an overlay | 660 | text property (@pxref{Text Properties}) or a property of an overlay |
| 658 | (@pxref{Overlays}). | 661 | (@pxref{Overlays}). Cursor motion also partly ignores these |
| 662 | characters; if the command loop finds point within them, it moves | ||
| 663 | point to the other side of them. | ||
| 659 | 664 | ||
| 660 | In the simplest case, any non-@code{nil} @code{invisible} property makes | 665 | In the simplest case, any non-@code{nil} @code{invisible} property makes |
| 661 | a character invisible. This is the default case---if you don't alter | 666 | a 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 |
| 785 | hiding certain lines on the screen. | 790 | hiding 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 |
| 788 | a Lisp program: it controls which lines are hidden by altering the text. | 793 | in a Lisp program: it controls which lines are hidden by altering the |
| 789 | The invisible text feature (@pxref{Invisible Text}) has partially | 794 | text. This kind of hiding in some ways resembles the effect of the |
| 790 | replaced this feature. | 795 | @code{invisible} property (@pxref{Invisible Text}), but the two |
| 796 | features 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 |
| 793 | automatically based on indentation. This variant is designed to be a | 799 | automatically 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 |
| 797 | newline (control-j) with a carriage return (control-m). The text that | 803 | newline (control-j) with a carriage return (control-m). The text that |
| 798 | was formerly a line following that newline is now invisible. Strictly | 804 | was formerly a line following that newline is now hidden. Strictly |
| 799 | speaking, it is temporarily no longer a line at all, since only newlines | 805 | speaking, it is temporarily no longer a line at all, since only |
| 800 | can separate lines; it is now part of the previous line. | 806 | newlines 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 |
| 803 | example, @kbd{C-f} (@code{forward-char}) moves point unhesitatingly into | 809 | example, @kbd{C-f} (@code{forward-char}) moves point unhesitatingly |
| 804 | invisible text. However, the replacement of newline characters with | 810 | into hidden text. However, the replacement of newline characters with |
| 805 | carriage return characters affects some editing commands. For example, | 811 | carriage return characters affects some editing commands. For |
| 806 | @code{next-line} skips invisible lines, since it searches only for | 812 | example, @code{next-line} skips hidden lines, since it searches only |
| 807 | newlines. Modes that use selective display can also define commands | 813 | for newlines. Modes that use selective display can also define |
| 808 | that take account of the newlines, or that make parts of the text | 814 | commands that take account of the newlines, or that control which |
| 809 | visible or invisible. | 815 | parts 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 |
| 812 | control-m's are output as newlines. This means that when you next read | 818 | control-m's are output as newlines. This means that when you next read |
| 813 | in the file, it looks OK, with nothing invisible. The selective display | 819 | in the file, it looks OK, with nothing hidden. The selective display |
| 814 | effect is seen only within Emacs. | 820 | effect is seen only within Emacs. |
| 815 | 821 | ||
| 816 | @defvar selective-display | 822 | @defvar selective-display |
| 817 | This buffer-local variable enables selective display. This means that | 823 | This buffer-local variable enables selective display. This means that |
| 818 | lines, or portions of lines, may be made invisible. | 824 | lines, or portions of lines, may be made hidden. |
| 819 | 825 | ||
| 820 | @itemize @bullet | 826 | @itemize @bullet |
| 821 | @item | 827 | @item |
| 822 | If the value of @code{selective-display} is @code{t}, then the character | 828 | If the value of @code{selective-display} is @code{t}, then the character |
| 823 | control-m marks the start of invisible text; the control-m, and the rest | 829 | control-m marks the start of hidden text; the control-m, and the rest |
| 824 | of the line following it, are not displayed. This is explicit selective | 830 | of the line following it, are not displayed. This is explicit selective |
| 825 | display. | 831 | display. |
| 826 | 832 | ||
| @@ -830,12 +836,12 @@ lines that start with more than that many columns of indentation are not | |||
| 830 | displayed. | 836 | displayed. |
| 831 | @end itemize | 837 | @end itemize |
| 832 | 838 | ||
| 833 | When some portion of a buffer is invisible, the vertical movement | 839 | When some portion of a buffer is hidden, the vertical movement |
| 834 | commands operate as if that portion did not exist, allowing a single | 840 | commands 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. |
| 836 | However, character movement commands (such as @code{forward-char}) do | 842 | However, character movement commands (such as @code{forward-char}) do |
| 837 | not skip the invisible portion, and it is possible (if tricky) to insert | 843 | not skip the hidden portion, and it is possible (if tricky) to insert |
| 838 | or delete text in an invisible portion. | 844 | or delete text in an hidden portion. |
| 839 | 845 | ||
| 840 | In the examples below, we show the @emph{display appearance} of the | 846 | In the examples below, we show the @emph{display appearance} of the |
| 841 | buffer @code{foo}, which changes with the value of | 847 | buffer @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 |
| 875 | If this buffer-local variable is non-@code{nil}, then Emacs displays | 881 | If 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. |
| 877 | This example is a continuation of the previous one. | 883 | This 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 | ||
| 902 | to a particular line in a buffer. For example, in the modes used for | ||
| 903 | interface to debuggers, the overlay arrow indicates the line of code | ||
| 904 | about to be executed. | ||
| 905 | |||
| 906 | @defvar overlay-arrow-string | ||
| 907 | This variable holds the string to display to call attention to a | ||
| 908 | particular line, or @code{nil} if the arrow feature is not in use. | ||
| 909 | On a graphical display the contents of the string are ignored; instead a | ||
| 910 | glyph is displayed in the fringe area to the left of the display area. | ||
| 911 | @end defvar | ||
| 912 | |||
| 913 | @defvar overlay-arrow-position | ||
| 914 | This variable holds a marker that indicates where to display the overlay | ||
| 915 | arrow. It should point at the beginning of a line. On a non-graphical | ||
| 916 | display the arrow text | ||
| 917 | appears at the beginning of that line, overlaying any text that would | ||
| 918 | otherwise appear. Since the arrow is usually short, and the line | ||
| 919 | usually begins with indentation, normally nothing significant is | ||
| 920 | overwritten. | ||
| 921 | |||
| 922 | The overlay string is displayed only in the buffer that this marker | ||
| 923 | points into. Thus, only one buffer can have an overlay arrow at any | ||
| 924 | given 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 | |||
| 1092 | inside the overlay or outside, and likewise for the end of the overlay. | 1062 | inside 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 | ||
| 1075 | overlays, and to examine their contents. Overlay changes are not | ||
| 1076 | recorded in the buffer's undo list, since the overlays are not | ||
| 1077 | part of the buffer's contents. | ||
| 1078 | |||
| 1079 | @defun overlayp object | ||
| 1080 | This 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 | ||
| 1084 | This function creates and returns an overlay that belongs to | ||
| 1085 | @var{buffer} and ranges from @var{start} to @var{end}. Both @var{start} | ||
| 1086 | and @var{end} must specify buffer positions; they may be integers or | ||
| 1087 | markers. If @var{buffer} is omitted, the overlay is created in the | ||
| 1088 | current buffer. | ||
| 1089 | |||
| 1090 | The arguments @var{front-advance} and @var{rear-advance} specify the | ||
| 1091 | insertion type for the start of the overlay and for the end of the | ||
| 1092 | overlay, respectively. @xref{Marker Insertion Types}. If | ||
| 1093 | @var{front-advance} is non-@code{nil}, text inserted at the beginning | ||
| 1094 | of the overlay is excluded from the overlay. If @var{read-advance} is | ||
| 1095 | non-@code{nil}, text inserted at the beginning of the overlay is | ||
| 1096 | included in the overlay. | ||
| 1097 | @end defun | ||
| 1098 | |||
| 1099 | @defun overlay-start overlay | ||
| 1100 | This function returns the position at which @var{overlay} starts, | ||
| 1101 | as an integer. | ||
| 1102 | @end defun | ||
| 1103 | |||
| 1104 | @defun overlay-end overlay | ||
| 1105 | This function returns the position at which @var{overlay} ends, | ||
| 1106 | as an integer. | ||
| 1107 | @end defun | ||
| 1108 | |||
| 1109 | @defun overlay-buffer overlay | ||
| 1110 | This function returns the buffer that @var{overlay} belongs to. It | ||
| 1111 | returns @code{nil} if @var{overlay} has been deleted. | ||
| 1112 | @end defun | ||
| 1113 | |||
| 1114 | @defun delete-overlay overlay | ||
| 1115 | This function deletes @var{overlay}. The overlay continues to exist as | ||
| 1116 | a Lisp object, and its property list is unchanged, but it ceases to be | ||
| 1117 | attached to the buffer it belonged to, and ceases to have any effect on | ||
| 1118 | display. | ||
| 1119 | |||
| 1120 | A deleted overlay is not permanently disconnected. You can give it a | ||
| 1121 | position in a buffer again by calling @code{move-overlay}. | ||
| 1122 | @end defun | ||
| 1123 | |||
| 1124 | @defun move-overlay overlay start end &optional buffer | ||
| 1125 | This function moves @var{overlay} to @var{buffer}, and places its bounds | ||
| 1126 | at @var{start} and @var{end}. Both arguments @var{start} and @var{end} | ||
| 1127 | must specify buffer positions; they may be integers or markers. | ||
| 1128 | |||
| 1129 | If @var{buffer} is omitted, @var{overlay} stays in the same buffer it | ||
| 1130 | was already associated with; if @var{overlay} was deleted, it goes into | ||
| 1131 | the current buffer. | ||
| 1132 | |||
| 1133 | The return value is @var{overlay}. | ||
| 1134 | |||
| 1135 | This is the only valid way to change the endpoints of an overlay. Do | ||
| 1136 | not try modifying the markers in the overlay by hand, as that fails to | ||
| 1137 | update 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.} | ||
| 1170 | foo | ||
| 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 |
| 1105 | alter how a character is displayed can come from either source. But in | 1198 | alter how a character is displayed can come from either source. But in |
| 1106 | most respects they are different. Text properties are considered a part | 1199 | most respects they are different. @xref{Text Properties}, for comparison. |
| 1107 | of the text; overlays are specifically considered not to be part of the | 1200 | |
| 1108 | text. Thus, copying text between various buffers and strings preserves | 1201 | Text properties are considered a part of the text; overlays and |
| 1109 | text properties, but does not try to preserve overlays. Changing a | 1202 | their properties are specifically considered not to be part of the |
| 1110 | buffer's text properties marks the buffer as modified, while moving an | 1203 | text. Thus, copying text between various buffers and strings |
| 1111 | overlay or changing its properties does not. Unlike text property | 1204 | preserves text properties, but does not try to preserve overlays. |
| 1112 | changes, overlay changes are not recorded in the buffer's undo list. | 1205 | Changing a buffer's text properties marks the buffer as modified, |
| 1113 | @xref{Text Properties}, for comparison. | 1206 | while moving an overlay or changing its properties does not. Unlike |
| 1114 | 1207 | text property changes, overlay property changes are not recorded in | |
| 1115 | These functions are used for reading and writing the properties of an | 1208 | the buffer's undo list. |
| 1116 | overlay: | 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 |
| 1119 | This function returns the value of property @var{prop} recorded in | 1213 | This 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} | |||
| 1301 | property) rather than replacing it. | 1395 | property) 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 | ||
| 1308 | overlays, and to examine their contents. | ||
| 1309 | |||
| 1310 | @defun overlayp object | ||
| 1311 | This 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 | ||
| 1315 | This function creates and returns an overlay that belongs to | ||
| 1316 | @var{buffer} and ranges from @var{start} to @var{end}. Both @var{start} | ||
| 1317 | and @var{end} must specify buffer positions; they may be integers or | ||
| 1318 | markers. If @var{buffer} is omitted, the overlay is created in the | ||
| 1319 | current buffer. | ||
| 1320 | |||
| 1321 | The arguments @var{front-advance} and @var{rear-advance} specify the | ||
| 1322 | insertion type for the start of the overlay and for the end of the | ||
| 1323 | overlay, respectively. @xref{Marker Insertion Types}. If | ||
| 1324 | @var{front-advance} is non-@code{nil}, text inserted at the beginning | ||
| 1325 | of the overlay is excluded from the overlay. If @var{read-advance} is | ||
| 1326 | non-@code{nil}, text inserted at the beginning of the overlay is | ||
| 1327 | included in the overlay. | ||
| 1328 | @end defun | ||
| 1329 | |||
| 1330 | @defun overlay-start overlay | ||
| 1331 | This function returns the position at which @var{overlay} starts, | ||
| 1332 | as an integer. | ||
| 1333 | @end defun | ||
| 1334 | |||
| 1335 | @defun overlay-end overlay | ||
| 1336 | This function returns the position at which @var{overlay} ends, | ||
| 1337 | as an integer. | ||
| 1338 | @end defun | ||
| 1339 | |||
| 1340 | @defun overlay-buffer overlay | ||
| 1341 | This function returns the buffer that @var{overlay} belongs to. It | ||
| 1342 | returns @code{nil} if @var{overlay} has been deleted. | ||
| 1343 | @end defun | ||
| 1344 | |||
| 1345 | @defun delete-overlay overlay | ||
| 1346 | This function deletes @var{overlay}. The overlay continues to exist as | ||
| 1347 | a Lisp object, and its property list is unchanged, but it ceases to be | ||
| 1348 | attached to the buffer it belonged to, and ceases to have any effect on | ||
| 1349 | display. | ||
| 1350 | |||
| 1351 | A deleted overlay is not permanently disconnected. You can give it a | ||
| 1352 | position in a buffer again by calling @code{move-overlay}. | ||
| 1353 | @end defun | ||
| 1354 | |||
| 1355 | @defun move-overlay overlay start end &optional buffer | ||
| 1356 | This function moves @var{overlay} to @var{buffer}, and places its bounds | ||
| 1357 | at @var{start} and @var{end}. Both arguments @var{start} and @var{end} | ||
| 1358 | must specify buffer positions; they may be integers or markers. | ||
| 1359 | |||
| 1360 | If @var{buffer} is omitted, @var{overlay} stays in the same buffer it | ||
| 1361 | was already associated with; if @var{overlay} was deleted, it goes into | ||
| 1362 | the current buffer. | ||
| 1363 | |||
| 1364 | The return value is @var{overlay}. | ||
| 1365 | |||
| 1366 | This is the only valid way to change the endpoints of an overlay. Do | ||
| 1367 | not try modifying the markers in the overlay by hand, as that fails to | ||
| 1368 | update 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.} | ||
| 1401 | foo | ||
| 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 |
| 1459 | This function returns the buffer position of the next beginning or end | 1432 | This function returns the buffer position of the next beginning or end |
| 1460 | of an overlay, after @var{pos}. | 1433 | of 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 |
| 1464 | This function returns the buffer position of the previous beginning or | 1438 | This function returns the buffer position of the previous beginning or |
| 1465 | end of an overlay, before @var{pos}. | 1439 | end 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}, | |||
| 1496 | if it were displayed in the current buffer and the selected window. | 1471 | if 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 |
| 1500 | This function returns the part of @var{string} that fits within | 1475 | This 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 | |||
| 1519 | the beginning of the result if one multi-column character in | 1494 | the 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 | ||
| 1497 | If @var{ellipsis} is non-@code{nil}, it should be a string which will | ||
| 1498 | replace the end of @var{str} (including any padding) if it extends | ||
| 1499 | beyond @var{end-column}, unless the display width of @var{str} is | ||
| 1500 | equal 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 | |||
| 2286 | default for all text. (In Emacs 19 and 20, the @code{default} | 2268 | default for all text. (In Emacs 19 and 20, the @code{default} |
| 2287 | face is used only when no other face is specified.) | 2269 | face is used only when no other face is specified.) |
| 2288 | 2270 | ||
| 2289 | For a mode line or header line, the face @code{modeline} or | 2271 | @item |
| 2290 | @code{header-line} is used just before @code{default}. | 2272 | For 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 | ||
| 2274 | before @code{default}. | ||
| 2291 | 2275 | ||
| 2292 | @item | 2276 | @item |
| 2293 | With text properties. A character can have a @code{face} property; if | 2277 | With 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 |
| 2315 | particular character, Emacs merges the attributes of the various faces | 2299 | particular character, Emacs merges the attributes of the various faces |
| 2316 | specified. The attributes of the faces of special glyphs come first; | 2300 | specified. For each attribute, Emacs tries first the face of any |
| 2317 | then comes the face for region highlighting, if appropriate; | 2301 | special glyph; then the face for region highlighting, if appropriate; |
| 2318 | then come attributes of faces from overlays, followed by those from text | 2302 | then the faces specified by overlays, followed by those specified by |
| 2319 | properties, and last the default face. | 2303 | text properties, then the @code{mode-line} or |
| 2304 | @code{mode-line-inactive} or @code{header-line} face (if in a mode | ||
| 2305 | line 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 |
| 2322 | priority overrides those with lower priority. @xref{Overlays}. | 2308 | priority 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 | ||
| 2325 | specified in any of the above ways, the frame's own font or color is | ||
| 2326 | used. In newer Emacs versions, this cannot happen, because the | ||
| 2327 | @code{default} face specifies all attributes---in fact, the frame's own | ||
| 2328 | font 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 |
| 2472 | This function defines the face @var{new-name} as a copy of the existing | 2452 | This function defines a face named @var{new-name} as a copy of the existing |
| 2473 | face named @var{old-face}. It creates the face @var{new-name} if that | 2453 | face named @var{old-face}. It creates the face @var{new-name} if that |
| 2474 | doesn't already exist. | 2454 | doesn'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 |
| 2760 | sides that are used for displaying bitmaps that indicate truncation, | 2740 | sides that are used for displaying bitmaps that indicate truncation, |
| 2761 | continuation, horizontal scrolling, and the overlay arrow. The | 2741 | continuation, horizontal scrolling, and the overlay arrow. |
| 2762 | fringes normally appear between the display margins and the window | 2742 | |
| 2763 | text, but you can put them outside the display margins for a specific | 2743 | @menu |
| 2764 | buffer by setting @code{fringes-outside-margins} buffer-locally to a | 2744 | * Fringe Size/Pos:: Specifying where to put the window fringes. |
| 2765 | non-@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 |
| 2768 | If the value is non-@code{nil}, the frames appear outside | 2756 | If the value is non-@code{nil}, the frames appear outside the display |
| 2769 | the display margins. | 2757 | margins. The fringes normally appear between the display margins and |
| 2758 | the window text. It works to set @code{fringes-outside-margins} | ||
| 2759 | buffer-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. | |||
| 2799 | This function returns information about the fringes of a window | 2789 | This 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 |
| 2801 | window is used. The value has the form @code{(@var{left-width} | 2791 | window 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 |
| 2876 | This function defines the symbol @var{bitmap} as a new fringe bitmap, | 2866 | This 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 | |||
| 2921 | specify only the foreground color. | 2911 | specify 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 | ||
| 2919 | to a particular line in a buffer. For example, in the modes used for | ||
| 2920 | interface to debuggers, the overlay arrow indicates the line of code | ||
| 2921 | about to be executed. This feature has nothing to do with | ||
| 2922 | @dfn{overlays} (@pxref{Overlays}). | ||
| 2923 | |||
| 2924 | @defvar overlay-arrow-string | ||
| 2925 | This variable holds the string to display to call attention to a | ||
| 2926 | particular line, or @code{nil} if the arrow feature is not in use. | ||
| 2927 | On a graphical display the contents of the string are ignored; instead a | ||
| 2928 | glyph is displayed in the fringe area to the left of the display area. | ||
| 2929 | @end defvar | ||
| 2930 | |||
| 2931 | @defvar overlay-arrow-position | ||
| 2932 | This variable holds a marker that indicates where to display the overlay | ||
| 2933 | arrow. It should point at the beginning of a line. On a non-graphical | ||
| 2934 | display the arrow text | ||
| 2935 | appears at the beginning of that line, overlaying any text that would | ||
| 2936 | otherwise appear. Since the arrow is usually short, and the line | ||
| 2937 | usually begins with indentation, normally nothing significant is | ||
| 2938 | overwritten. | ||
| 2939 | |||
| 2940 | The overlay string is displayed only in the buffer that this marker | ||
| 2941 | points into. Thus, only one buffer can have an overlay arrow at any | ||
| 2942 | given 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 | ||
| 2955 | This variable's value is a list of varibles, each of which specifies | ||
| 2956 | the position of an overlay arrow. The variable | ||
| 2957 | @code{overlay-arrow-position} has its normal meaning because it is on | ||
| 2958 | this list. | ||
| 2959 | @end defvar | ||
| 2960 | |||
| 2961 | Each variable on this list can have properties | ||
| 2962 | @code{overlay-arrow-string} and @code{overlay-arrow-bitmap} that | ||
| 2963 | specify an overlay arrow string (for text-only terminals) or fringe | ||
| 2964 | bitmap (for graphical terminals) to display at the corresponding | ||
| 2965 | overlay arrow position. If either property is not set, the default | ||
| 2966 | (@code{overlay-arrow-string} or @code{overlay-arrow-fringe-bitmap}) is | ||
| 2967 | used. | ||
| 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 | |||
| 3156 | to the left edge of the text area. For example, @samp{:align-to 0} in a | 3199 | to the left edge of the text area. For example, @samp{:align-to 0} in a |
| 3157 | header-line aligns with the first text column in the text area. | 3200 | header-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 |
| 3160 | multiplying the values of @var{num} and @var{expr}. For example, | 3203 | product 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 |
| 3206 | image. | ||
| 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 |
| 3165 | expressions. The form @code{(- @var{expr} ...)} negates or subtracts | 3209 | expressions. 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}) |
| 3176 | This is in fact an image descriptor (@pxref{Images}). When used as a | 3220 | This display specification is an image descriptor (@pxref{Images}). |
| 3177 | display specification, it means to display the image instead of the text | 3221 | When used as a display specification, it means to display the image |
| 3178 | that has the display specification. | 3222 | instead 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}) |
| 3181 | This specification together with @code{image} specifies a @dfn{slice} | 3225 | This 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 | |||
| 3246 | faces used for the text. | 3290 | faces used for the text. |
| 3247 | @end table | 3291 | @end table |
| 3248 | 3292 | ||
| 3293 | You can make any display specification conditional. To do that, | ||
| 3294 | package 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 | ||
| 3297 | evaluation, @code{object} is bound to the string or buffer having the | ||
| 3298 | conditional @code{display} property. @code{position} and | ||
| 3299 | @code{buffer-position} are bound to the position within @code{object} | ||
| 3300 | and the buffer position where the @code{display} property was found, | ||
| 3301 | respectively. Both positions can be different when @code{object} is a | ||
| 3302 | string. | ||
| 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})}. | |||
| 3308 | If @var{window} is @code{nil}, the selected window is used. | 3363 | If @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, | ||
| 3316 | package 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 | ||
| 3319 | evaluation, @code{object} is bound to the string or buffer having the | ||
| 3320 | conditional @code{display} property. @code{position} and | ||
| 3321 | @code{buffer-position} are bound to the position within @code{object} | ||
| 3322 | and the buffer position where the @code{display} property was found, | ||
| 3323 | respectively. Both positions can be different when @code{object} is a | ||
| 3324 | string. | ||
| 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 |
| 3335 | are supported only if particular support libraries are installed on | 3375 | are supported only if particular support libraries are installed on |
| 3336 | your machine. In some environments, Emacs allows loading image | 3376 | your machine. In some environments, Emacs can load image |
| 3337 | libraries on demand; if so, the variable @code{image-library-alist} | 3377 | libraries on demand; if so, the variable @code{image-library-alist} |
| 3338 | can be used to modify the set of known names for these dynamic | 3378 | can be used to modify the set of known names for these dynamic |
| 3339 | libraries (though it is not possible to add new image formats). | 3379 | libraries (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 |
| 3342 | libraries @code{libXpm} version 3.4k and @code{libz}), GIF (needing | 3382 | libraries @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} |
| 3345 | and PNG (needing @code{libpng} 1.0.2). | 3385 | v3.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 |
| 3348 | type symbols are @code{xbm}, @code{xpm}, @code{gif}, @code{postscript}, | 3388 | type 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} |
| 3426 | The @code{:file} property specifies to load the image from file | 3466 | The @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 |
| 3428 | in @code{data-directory}. | 3468 | in @code{data-directory}. |
| 3429 | 3469 | ||
| 3430 | @item :data @var{data} | 3470 | @item :data @var{data} |
| 3431 | The @code{:data} property specifies the actual contents of the image. | 3471 | The @code{:data} property says the actual contents of the image. |
| 3432 | Each image must use either @code{:data} or @code{:file}, but not both. | 3472 | Each image must use either @code{:data} or @code{:file}, but not both. |
| 3433 | For most image types, the value of the @code{:data} property should be a | 3473 | For most image types, the value of the @code{:data} property should be a |
| 3434 | string containing the image data; we recommend using a unibyte string. | 3474 | string 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}. |
| 3691 | in the US covering the LZW algorithm, the continued use of GIF format is | ||
| 3692 | a problem for the whole Internet; to end this problem, it is a good idea | ||
| 3693 | for everyone, even outside the US, to stop using GIFs right away | ||
| 3694 | (@uref{http://www.burnallgifs.org/}). But if you still want to use | ||
| 3695 | them, 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. | |||
| 3871 | This function inserts @var{image} in the current buffer at point. The | 3906 | This function inserts @var{image} in the current buffer at point. The |
| 3872 | value @var{image} should be an image descriptor; it could be a value | 3907 | value @var{image} should be an image descriptor; it could be a value |
| 3873 | returned by @code{create-image}, or the value of a symbol defined with | 3908 | returned 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 |
| 3875 | the buffer to hold the image. | 3910 | in the buffer to hold the image. If it is omitted or @code{nil}, |
| 3911 | @code{insert-image} uses @code{" "} by default. | ||
| 3876 | 3912 | ||
| 3877 | The argument @var{area} specifies whether to put the image in a margin. | 3913 | The argument @var{area} specifies whether to put the image in a margin. |
| 3878 | If it is @code{left-margin}, the image appears in the left margin; | 3914 | If 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) | |||
| 3983 | buttons in Emacs buffers, such as might be used for help hyper-links, | 4019 | buttons in Emacs buffers, such as might be used for help hyper-links, |
| 3984 | etc. Emacs uses buttons for the hyper-links in help text and the like. | 4020 | etc. Emacs uses buttons for the hyper-links in help text and the like. |
| 3985 | 4021 | ||
| 3986 | A button is essentially a set of properties attached (via text | 4022 | A button is essentially a set of properties attached (via text |
| 3987 | properties or overlays) to a region of text in an Emacs buffer, which | 4023 | properties or overlays) to a region of text in an Emacs buffer. These |
| 3988 | are called its button properties. @xref{Button Properties}. | 4024 | properties are called @dfn{button properties}. |
| 3989 | 4025 | ||
| 3990 | One of the these properties (@code{action}) is a function, which will | 4026 | One of the these properties (@code{action}) is a function, which will |
| 3991 | be called when the user invokes it using the keyboard or the mouse. | 4027 | be called when the user invokes it using the keyboard or the mouse. |
| 3992 | The invoked function may then examine the button and use its other | 4028 | The invoked function may then examine the button and use its other |
| 3993 | properties as desired. | 4029 | properties as desired. |
| 3994 | 4030 | ||
| 3995 | In some ways the Emacs button package duplicates functionality offered | 4031 | In some ways the Emacs button package duplicates functionality offered |
| 3996 | by the widget package (@pxref{Top, , Introduction, widget, The Emacs | 4032 | by the widget package (@pxref{Top, , Introduction, widget, The Emacs |
| 3997 | Widget Library}), but the button package has the advantage that it is | 4033 | Widget Library}), but the button package has the advantage that it is |
| 3998 | much faster, much smaller, and much simpler to use (for elisp | 4034 | much 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 |
| 4019 | appearance and behavior, and other arbitrary properties may be used | 4054 | appearance and behavior, and other arbitrary properties may be used |
| 4020 | for application specific purposes. | 4055 | for application specific purposes. Some properties that have special |
| 4021 | 4056 | meaning to the button package include: | |
| 4022 | Some properties that have special meaning to the button package | ||
| 4023 | include: | ||
| 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)} |
| 4029 | The function to call when the user invokes the button, which is passed | 4061 | The 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 | |||
| 4078 | standard button functions do). | 4110 | standard button functions do). |
| 4079 | @end table | 4111 | @end table |
| 4080 | 4112 | ||
| 4081 | There are other properties defined for the regions of text in a | 4113 | There are other properties defined for the regions of text in a |
| 4082 | button, but these are not generally interesting for typical uses. | 4114 | button, 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 | |||
| 4106 | reflected in its subtypes. | 4138 | reflected in its subtypes. |
| 4107 | @end defun | 4139 | @end defun |
| 4108 | 4140 | ||
| 4109 | Using @code{define-button-type} to define default properties for | 4141 | Using @code{define-button-type} to define default properties for |
| 4110 | buttons is not necessary---buttons without any specified type use the | 4142 | buttons is not necessary---buttons without any specified type use the |
| 4111 | built-in button-type @code{button}---but it is is encouraged, since | 4143 | built-in button-type @code{button}---but it is encouraged, since |
| 4112 | doing so usually makes the resulting code clearer and more efficient. | 4144 | doing 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 |
| 4119 | text-properties to hold button-specific information, all of which are | 4151 | text properties to hold button-specific information, all of which are |
| 4120 | initialized from the button's type (which defaults to the built-in | 4152 | initialized from the button's type (which defaults to the built-in |
| 4121 | button type @code{button}). Like all Emacs text, the appearance of | 4153 | button type @code{button}). Like all Emacs text, the appearance of |
| 4122 | the button is governed by the @code{face} property; by default (via | 4154 | the button is governed by the @code{face} property; by default (via |
| 4123 | the @code{face} property inherited from the @code{button} button-type) | 4155 | the @code{face} property inherited from the @code{button} button-type) |
| 4124 | this is a simple underline, like a typical web-page link. | 4156 | this is a simple underline, like a typical web-page link. |
| 4125 | 4157 | ||
| 4126 | For convenience, there are two sorts of button-creation functions, | 4158 | For convenience, there are two sorts of button-creation functions, |
| 4127 | those that add button properties to an existing region of a buffer, | 4159 | those that add button properties to an existing region of a buffer, |
| 4128 | called @code{make-...button}, and those also insert the button text, | 4160 | called @code{make-...button}, and those also insert the button text, |
| 4129 | called @code{insert-...button}. | 4161 | called @code{insert-...button}. |
| 4130 | 4162 | ||
| 4131 | The 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} |
| 4133 | pairs, specifying properties to add to the button; see @ref{Button | 4165 | pairs, specifying properties to add to the button; see @ref{Button |
| 4134 | Properties}. In addition, the keyword argument @code{:type} may be | 4166 | Properties}. In addition, the keyword argument @code{:type} may be |
| @@ -4137,40 +4169,41 @@ see @ref{Button Types}. Any properties not explicitly specified | |||
| 4137 | during creation will be inherited from the button's type (if the type | 4169 | during creation will be inherited from the button's type (if the type |
| 4138 | defines such a property). | 4170 | defines such a property). |
| 4139 | 4171 | ||
| 4140 | The 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 |
| 4145 | Make a button from @var{beg} to @var{end} in the current buffer. | 4177 | This makes a button from @var{beg} to @var{end} in the |
| 4178 | current 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 |
| 4150 | Insert a button with the label @var{label}. | 4183 | This insert a button with the label @var{label} at point, |
| 4184 | and returns it. | ||
| 4151 | @end defun | 4185 | @end defun |
| 4152 | 4186 | ||
| 4153 | The 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 |
| 4155 | button actually part of the text instead of being a property of the | 4189 | button actually part of the text instead of being a property of the |
| 4156 | buffer (using text-properties is usually faster than using overlays, | 4190 | buffer. Buttons using text properties do not create markers into the |
| 4157 | so this may be preferable when creating large numbers of buttons): | 4191 | buffer, which is important for speed when you use extremely large |
| 4192 | numbers of buttons. Both functions return the position of the start | ||
| 4193 | of 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 |
| 4161 | Make a button from @var{beg} to @var{end} in the current buffer, using | 4197 | This makes a button from @var{beg} to @var{end} in the current buffer, using |
| 4162 | text-properties. | 4198 | text 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 |
| 4167 | Insert a button with the label @var{label}, using text-properties. | 4203 | This inserts a button with the label @var{label} at point, using text |
| 4204 | properties. | ||
| 4168 | @end defun | 4205 | @end defun |
| 4169 | 4206 | ||
| 4170 | Buttons using text-properties retain no markers into the buffer are | ||
| 4171 | retained, which is important for speed in cases where there are | ||
| 4172 | extremely 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 | |||
| 4234 | Return the button at position @var{pos} in the current buffer, or @code{nil}. | 4267 | Return 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 | ||
| 4272 | Set 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 | ||
| 4277 | Get 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 | ||
| 4282 | Return @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 | |||
| 4251 | parent keymap for its keymap. | 4299 | parent keymap for its keymap. |
| 4252 | 4300 | ||
| 4253 | If the button has a non-@code{nil} @code{follow-link} property, and | 4301 | If 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 |
| 4255 | also activate the @code{push-button} command. | 4303 | will 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 | ||
| 4313 | Set 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 | ||
| 4318 | Get 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 | ||
| 4323 | Return @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 |
| 4399 | This variable controls the use of inverse video for mode lines and menu | 4429 | This variable controls the use of inverse video for mode lines and |
| 4400 | bars. If it is non-@code{nil}, then these lines are displayed in | 4430 | menu bars. If it is non-@code{nil}, then these lines are displayed in |
| 4401 | inverse video. Otherwise, these lines are displayed normally, just like | 4431 | the face @code{mode-line}. Otherwise, these lines are displayed |
| 4402 | other text. The default is @code{t}. | 4432 | normally, just like other text. The default is @code{t}. |
| 4403 | |||
| 4404 | For window frames, this feature actually applies the face named | ||
| 4405 | @code{mode-line}; that face is normally set up as the inverse of the | ||
| 4406 | default 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 |
| 4589 | The glyph for the end of a truncated screen line (the default for this | 4615 | The glyph for the end of a truncated screen line (the default for this |
| 4590 | is @samp{$}). @xref{Glyphs}. Newer Emacs versions, on some platforms, | 4616 | is @samp{$}). @xref{Glyphs}. On graphical terminals, Emacs uses |
| 4591 | display arrows to indicate truncation---the display table has no effect | 4617 | arrows in the fringes to indicate truncation, so the display table has |
| 4592 | in these situations. | 4618 | no effect. |
| 4619 | |||
| 4593 | @item 1 | 4620 | @item 1 |
| 4594 | The glyph for the end of a continued line (the default is @samp{\}). | 4621 | The glyph for the end of a continued line (the default is @samp{\}). |
| 4595 | Newer Emacs versions, on some platforms, display curved arrows to | 4622 | On graphical terminals, Emacs uses curved arrows in the fringes to |
| 4596 | indicate continuation---the display table has no effect in these | 4623 | indicate continuation, so the display table has no effect. |
| 4597 | situations. | 4624 | |
| 4598 | @item 2 | 4625 | @item 2 |
| 4599 | The glyph for indicating a character displayed as an octal character | 4626 | The glyph for indicating a character displayed as an octal character |
| 4600 | code (the default is @samp{\}). | 4627 | code (the default is @samp{\}). |
| 4628 | |||
| 4601 | @item 3 | 4629 | @item 3 |
| 4602 | The glyph for indicating a control character (the default is @samp{^}). | 4630 | The glyph for indicating a control character (the default is @samp{^}). |
| 4631 | |||
| 4603 | @item 4 | 4632 | @item 4 |
| 4604 | A vector of glyphs for indicating the presence of invisible lines (the | 4633 | A vector of glyphs for indicating the presence of invisible lines (the |
| 4605 | default is @samp{...}). @xref{Selective Display}. | 4634 | default is @samp{...}). @xref{Selective Display}. |
| 4635 | |||
| 4606 | @item 5 | 4636 | @item 5 |
| 4607 | The glyph used to draw the border between side-by-side windows (the | 4637 | The glyph used to draw the border between side-by-side windows (the |
| 4608 | default is @samp{|}). @xref{Splitting Windows}. This takes effect only | 4638 | default 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 | |||
| 4662 | table if any. The display table chosen is called the @dfn{active} | 4692 | table if any. The display table chosen is called the @dfn{active} |
| 4663 | display table. | 4693 | display table. |
| 4664 | 4694 | ||
| 4665 | @defun window-display-table window | 4695 | @defun window-display-table &optional window |
| 4666 | This function returns @var{window}'s display table, or @code{nil} | 4696 | This function returns @var{window}'s display table, or @code{nil} |
| 4667 | if @var{window} does not have an assigned display table. | 4697 | if @var{window} does not have an assigned display table. The default |
| 4698 | for @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 |