Mercurial > emacs
comparison lispref/display.texi @ 57221:18bdf278f148
(Fringes): Rewrite previous change.
(Fringe Bitmaps): Merge text from Display Fringe Bitmaps. Rewrite.
(Display Fringe Bitmaps): Node deleted, text moved.
(Customizing Bitmaps): Split off from Fringe Bitmaps. Rewrite.
(Scroll Bars): Clarify set-window-scroll-bars.
(Pointer Shape): Rewrite.
(Specified Space): Clarify :align-to, etc.
(Pixel Specification): Use @var. Clarify new text.
(Other Display Specs): Clarify `slice'.
(Image Descriptors): Cleanups.
(Showing Images): Cleanups.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 25 Sep 2004 07:18:08 +0000 |
parents | ce88ee86e383 |
children | 27349bd528f6 0b158db81c28 |
comparison
equal
deleted
inserted
replaced
57220:f041483364c1 | 57221:18bdf278f148 |
---|---|
23 * Overlays:: Use overlays to highlight parts of the buffer. | 23 * Overlays:: Use overlays to highlight parts of the buffer. |
24 * Width:: How wide a character or string is on the screen. | 24 * Width:: How wide a character or string is on the screen. |
25 * Faces:: A face defines a graphics style for text characters: | 25 * Faces:: A face defines a graphics style for text characters: |
26 font, colors, etc. | 26 font, colors, etc. |
27 * Fringes:: Controlling window fringes. | 27 * Fringes:: Controlling window fringes. |
28 * Fringe Bitmaps:: Customizing fringe bitmaps. | 28 * Fringe Bitmaps:: Displaying bitmaps in the window fringes. |
29 * Customizing Bitmaps:: Specifying your own bitmaps to use in the fringes. | |
29 * Scroll Bars:: Controlling vertical scroll bars. | 30 * Scroll Bars:: Controlling vertical scroll bars. |
30 * Pointer Shape:: Controlling the mouse pointer shape. | 31 * Pointer Shape:: Controlling the mouse pointer shape. |
31 * Display Property:: Enabling special display features. | 32 * Display Property:: Enabling special display features. |
32 * Images:: Displaying images in Emacs buffers. | 33 * Images:: Displaying images in Emacs buffers. |
33 * Buttons:: Adding clickable buttons to Emacs buffers. | 34 * Buttons:: Adding clickable buttons to Emacs buffers. |
2597 window is used. The value has the form @code{(@var{left-width} | 2598 window is used. The value has the form @code{(@var{left-width} |
2598 @var{right-width} @var{frames-outside-margins})}. | 2599 @var{right-width} @var{frames-outside-margins})}. |
2599 @end defun | 2600 @end defun |
2600 | 2601 |
2601 @defvar overflow-newline-into-fringe | 2602 @defvar overflow-newline-into-fringe |
2602 This variable, if non-@code{nil}, specifies that lines which are | 2603 If this is non-@code{nil}, lines exactly as wide as the window (not |
2603 exactly as wide as the window (not counting the final newline | 2604 counting the final newline character) are not continued. Instead, |
2604 character) shall not be broken into two lines on the display (with | 2605 when point is at the end of the line, the cursor appears in the right |
2605 just the newline on the second line). Instead, the newline now | 2606 fringe. |
2606 overflows into the right fringe, and the cursor will be displayed in | |
2607 the fringe when positioned on that newline. | |
2608 @end defvar | |
2609 | |
2610 @defvar indicate-buffer-boundaries | |
2611 This buffer-local variable controls how the buffer boundaries and | |
2612 window scrolling is indicated in the fringes. | |
2613 | |
2614 The buffer boundaries, i.e. first and last line in the buffer, can be | |
2615 marked with angle bitmaps in the left or right fringe. This can be | |
2616 combined with up and down arrow bitmaps shown at the top and bottom of | |
2617 the left or right fringe if the window can be scrolled in either | |
2618 direction. | |
2619 | |
2620 If the value is @code{left} or @code{right}, both angle and arrow | |
2621 bitmaps are displayed in the left or right fringe, respectively. | |
2622 Any other non-@code{nil} value causes the bitmap on the top line to be | |
2623 displayed in the left fringe, and the bitmap on the bottom line in the | |
2624 right fringe. | |
2625 | |
2626 If value is a cons @code{(angles . arrows)}, the car specifies the | |
2627 position of the angle bitmaps, and the cdr specifies the position of | |
2628 the arrow bitmaps. For example, @code{(t . right)} places the top | |
2629 angle bitmap in left fringe, the bottom angle bitmap in right fringe, | |
2630 and both arrow bitmaps in right fringe. To show just the angle | |
2631 bitmaps in the left fringe, but no arrow bitmaps, use @code{(left . nil)}. | |
2632 @end defvar | |
2633 | |
2634 @defvar default-indicate-buffer-boundaries | |
2635 The value of this variable is the default value for | |
2636 @code{indicate-buffer-boundaries} in buffers that do not override it. | |
2637 @end defvar | 2607 @end defvar |
2638 | 2608 |
2639 @node Fringe Bitmaps | 2609 @node Fringe Bitmaps |
2640 @section Fringe Bitmaps | 2610 @section Fringe Bitmaps |
2641 @cindex Fringe Bitmaps | 2611 @cindex fringe bitmaps |
2642 | 2612 @cindex bitmaps, fringe |
2643 The @dfn{fringe bitmaps} are tiny icons Emacs displays in the fringe | 2613 |
2644 on a window system to indicate truncated or continued lines, buffer | 2614 The @dfn{fringe bitmaps} are tiny icons Emacs displays in the window |
2645 boundaries, overlay arrow, etc. The fringe bitmaps are shared by all | 2615 fringe (on a graphic display) to indicate truncated or continued |
2646 frames and windows. | 2616 lines, buffer boundaries, overlay arrow, etc. The fringe bitmaps are |
2647 | 2617 shared by all frames and windows. You can redefine the built-in |
2648 You can redefine the built-in fringe bitmaps, and you can define new | 2618 fringe bitmaps, and you can define new fringe bitmaps. However, Emacs |
2649 fringe bitmaps. Emacs can handle a maximum of 255 different fringe | 2619 can handle only 255 different fringe bitmaps. |
2650 bitmaps. | 2620 |
2651 | 2621 The way to display a bitmap in the left or right fringes for a given |
2652 A fringe bitmap is identified by an opaque integer, but Lisp code | 2622 line in a window is by specifying the @code{display} property for one |
2653 should use the following names defined by @code{(require 'fringe)}: | 2623 of the characters that appears in it. Use a display specification of |
2654 | 2624 the form @code{(left-fringe @var{bitmap} [@var{face}])} or |
2655 Truncation and continuation line bitmaps: | 2625 @code{(right-fringe @var{bitmap} [@var{face}])} (@pxref{Display |
2626 Property}). Here, @var{bitmap} is an integer identifying the bitmap | |
2627 you want, and @var{face} (which is optional) is the name of the face | |
2628 whose colors should be used for displaying the bitmap. | |
2629 @c ??? Shouldn't the symbol name be used? | |
2630 | |
2631 These are the symbols identify the standard fringe bitmaps. | |
2632 Evaluate @code{(require 'fringe)} to define them. Each symbol's | |
2633 value is an integer that identifies the corresponding bitmap. | |
2634 | |
2635 @table @asis | |
2636 @item Truncation and continuation line bitmaps: | |
2656 @code{left-truncation-fringe-bitmap}, | 2637 @code{left-truncation-fringe-bitmap}, |
2657 @code{right-truncation-fringe-bitmap}, | 2638 @code{right-truncation-fringe-bitmap}, |
2658 @code{continued-line-fringe-bitmap}, | 2639 @code{continued-line-fringe-bitmap}, |
2659 @code{continuation-line-fringe-bitmap}. | 2640 @code{continuation-line-fringe-bitmap}. |
2660 | 2641 |
2661 Buffer indication bitmaps: | 2642 @item Buffer indication bitmaps: |
2662 @code{up-arrow-fringe-bitmap}, | 2643 @code{up-arrow-fringe-bitmap}, |
2663 @code{down-arrow-fringe-bitmap}, | 2644 @code{down-arrow-fringe-bitmap}, |
2664 @code{top-left-angle-fringe-bitmap}, | 2645 @code{top-left-angle-fringe-bitmap}, |
2665 @code{top-right-angle-fringe-bitmap}, | 2646 @code{top-right-angle-fringe-bitmap}, |
2666 @code{bottom-left-angle-fringe-bitmap}, | 2647 @code{bottom-left-angle-fringe-bitmap}, |
2667 @code{bottom-right-angle-fringe-bitmap}, | 2648 @code{bottom-right-angle-fringe-bitmap}, |
2668 @code{left-bracket-fringe-bitmap}, | 2649 @code{left-bracket-fringe-bitmap}, |
2669 @code{right-bracket-fringe-bitmap}. | 2650 @code{right-bracket-fringe-bitmap}. |
2670 | 2651 |
2671 Empty line indication bitmap: | 2652 @item Empty line indication bitmap: |
2672 @code{empty-line-fringe-bitmap}. | 2653 @code{empty-line-fringe-bitmap}. |
2673 | 2654 |
2674 Overlay arrow bitmap: | 2655 @item Overlay arrow bitmap: |
2675 @code{overlay-arrow-fringe-bitmap}. | 2656 @code{overlay-arrow-fringe-bitmap}. |
2676 | 2657 |
2677 Bitmaps for displaying the cursor in right fringe: | 2658 @item Bitmaps for displaying the cursor in right fringe: |
2678 @code{filled-box-cursor-fringe-bitmap}, | 2659 @code{filled-box-cursor-fringe-bitmap}, |
2679 @code{hollow-box-cursor-fringe-bitmap}, | 2660 @code{hollow-box-cursor-fringe-bitmap}, |
2680 @code{hollow-square-fringe-bitmap}, @code{bar-cursor-fringe-bitmap}, | 2661 @code{hollow-square-fringe-bitmap}, @code{bar-cursor-fringe-bitmap}, |
2681 @code{hbar-cursor-fringe-bitmap}. | 2662 @code{hbar-cursor-fringe-bitmap}. |
2682 | 2663 |
2683 Fringe bitmap opaque value indicating that no fringe bitmap is present: | 2664 @item Value indicating that no fringe bitmap is present: |
2684 @code{no-fringe-bitmap}. | 2665 @code{no-fringe-bitmap}. |
2685 | 2666 @c ??? I don't understand what that means. |
2686 Fringe bitmap opaque value indicating a reference to an undefined bitmap: | 2667 @c ??? Where would you find that value? |
2668 | |
2669 @item Value indicating a reference to an undefined bitmap: | |
2687 @code{undef-fringe-bitmap}. | 2670 @code{undef-fringe-bitmap}. |
2688 | 2671 @c ??? I don't understand what that means. |
2689 To display an specific fringe bitmap on a line in an Emacs window, | 2672 @c ??? Where would you find that value? |
2690 use it as a @code{left-fringe} or @code{right-fringe} specifier in the | 2673 @end table |
2691 @code{display} property of some text that is displayed on that line | 2674 |
2692 (@pxref{Display Property}). | 2675 @defun fringe-bitmaps-at-pos &optional pos window |
2676 This function returns the fringe bitmaps of the display line | |
2677 containing position @var{pos} in window @var{window}. The return | |
2678 value has the form @code{(@var{left} . @var{right})}, where @var{left} | |
2679 is a list of fringe bitmap numbers for left fringe, and @var{right} is | |
2680 similar for the right fringe. These bitmap numbers are usually values | |
2681 of symbols such as the ones listed above. | |
2682 | |
2683 @c ??? Why not return a list of symbols that identify the bitmaps? | |
2684 @c ??? This is Lisp, not C. | |
2685 | |
2686 The value is @code{nil} if @var{pos} is not visible in @var{window}. | |
2687 If @var{window} is @code{nil}, that stands for the selected window. | |
2688 If @var{pos} is @code{nil}, that stands for the value of point in | |
2689 @var{window}. | |
2690 @end defun | |
2691 | |
2692 @node Customizing Bitmaps | |
2693 @section Customizing Fringe Bitmaps | |
2694 | |
2695 @c ??? Why not pass a symbol as the first argument | |
2696 @c ??? and define that symbol. It would be cleaner. | |
2693 | 2697 |
2694 @defun define-fringe-bitmap bits &optional height width align bitmap | 2698 @defun define-fringe-bitmap bits &optional height width align bitmap |
2695 Define a new fringe bitmap, or change an existing bitmap. | 2699 This function defines a new fringe bitmap, or replaces an existing |
2696 | 2700 bitmap. |
2697 The argument @code{bits} is either a string or a vector of integers, | 2701 |
2698 where each element (typically) corresponds to one row of the bitmap, | 2702 The argument @var{bits} specifies the image to use. It should be |
2699 and each bit of an integer corresponds to one pixel of the bitmap. | 2703 either a string or a vector of integers, where each element (an |
2700 | 2704 integer) corresponds to one row of the bitmap. Each bit of an integer |
2701 The optional argument @code{height} specifies the height of the bitmap. | 2705 corresponds to one pixel of the bitmap. |
2702 If @code{height} is @code{nil}, the length of @code{bits} is used. | 2706 @c ??? Is the low bit the leftmost or the rightmost bit? |
2703 | 2707 |
2704 The optional argument @code{width} specifies the width of the bitmap; | 2708 The height is normally the length of @var{bits}. However, you |
2705 it must be an integer between 1 and 16, or @code{nil} which defaults | 2709 can specify a different height with non-@code{nil} @var{height}. The width |
2706 to a width of 8 pixels. | 2710 is normally 8, but you can specify a different width with non-@code{nil} |
2707 | 2711 @var{width}. The width must be an integer between 1 and 16. |
2708 The optional argument @code{align} may be one of @code{top}, | 2712 |
2709 @code{center}, or @code{bottom}, indicating the positioning of the | 2713 The argument @var{align} specifies the positioning of the bitmap |
2710 bitmap relative to the rows where it is used; the default is to center | 2714 relative to the range of rows where it is used; the default is to |
2711 the bitmap. | 2715 center the bitmap. The allowed values are @code{top}, @code{center}, |
2712 | 2716 or @code{bottom}. |
2713 The @code{align} argument may also be a list @code{(ALIGN PERIODIC)} | 2717 |
2714 where @code{ALIGN} is intepreted as described above, and if | 2718 The @var{align} argument may also be a list @code{(@var{align} |
2715 @code{PERIODIC} is non-@code{nil} it specifies that the @code{bits} should | 2719 @var{periodic})} where @var{align} is intepreted as described above. |
2716 be repeated until a bitmap of the specified @code{height} is created. | 2720 If @var{periodic} is non-@code{nil}, it specifies that the rows in |
2717 | 2721 @code{bits} should be repeated enough times to reach the specified |
2718 The optional argument @code{bitmap} specifies the opaque integer that | 2722 height. |
2719 identifies an existing bitmap to redefine. | 2723 |
2720 | 2724 The argument @var{bitmap} specifies an existing bitmap to redefine. |
2721 The return value is a new opaque integer identifying the new bitmap number, | 2725 You should pass the value of the symbol that identifies the bitmap. |
2722 or @code{nil} of there are no more free bitmap slots. | 2726 |
2727 The return value on success is an integer identifying the new bitmap. | |
2728 You should save that integer in a variable so it can be used to select | |
2729 this bitmap. The value can also be @code{nil} of there are no more | |
2730 free bitmap slots. | |
2731 @c ??? Why not signal an error? That would be cleaner. | |
2723 @end defun | 2732 @end defun |
2724 | 2733 |
2725 @defun destroy-fringe-bitmap bitmap | 2734 @defun destroy-fringe-bitmap bitmap |
2726 Destroy the fringe bitmap identified by the opaque integer | 2735 This function destroy the fringe bitmap identified by @var{bitmap}. |
2727 @code{bitmap}. If @code{bitmap} identifies a standard fringe bitmap, | 2736 If @var{bitmap} identifies a standard fringe bitmap, it actually |
2728 the original built-in bitmap is restored. | 2737 restores the standard definition of that bitmap, instead of |
2738 eliminating it entirely. | |
2729 @end defun | 2739 @end defun |
2730 | 2740 |
2731 @defun set-fringe-bitmap-face bitmap &optional face | 2741 @defun set-fringe-bitmap-face bitmap &optional face |
2732 Set face for a specific fringe bitmap @code{bitmap} to the face | 2742 This sets the face for the fringe bitmap @var{bitmap} to @var{face}. |
2733 specified by the argument @code{face}. | 2743 If @var{face} is @code{nil}, it selects the @code{fringe} face. The |
2734 If @code{face} is @code{nil}, reset face to default @code{fringe} face. | 2744 bitmap's face controls the color to draw it in. |
2735 | 2745 |
2736 Normally, the specified face should be a face derived from the | 2746 The face you use here should be derived from @code{fringe}, and should |
2737 @code{fringe} face, only specifying the foreground color as the | 2747 specify only the foreground color. |
2738 desired color of the fringe bitmap. | 2748 @end defun |
2739 @end defun | 2749 |
2750 @defvar indicate-buffer-boundaries | |
2751 This buffer-local variable controls how the buffer boundaries and | |
2752 window scrolling are indicated in the window fringes. | |
2753 | |
2754 Emacs can indicate the buffer boundaries---that is, the first and last | |
2755 line in the buffer---with angle icons when they appear on the screen. | |
2756 In addition, Emacs can display an up-arrow in the fringe to show | |
2757 that there is text above the screen, and a down-arrow to show | |
2758 there is text below the screen. | |
2759 | |
2760 There are four kinds of basic values: | |
2761 | |
2762 @table @asis | |
2763 @item @code{nil} | |
2764 Don't display the icons. | |
2765 @item @code{left} | |
2766 Display them in the left fringe. | |
2767 @item @code{right} | |
2768 Display them in the right fringe. | |
2769 @item @var{anything-else} | |
2770 Display the icon at the top of the window top in the left fringe, and other | |
2771 in the right fringe. | |
2772 @end table | |
2773 | |
2774 If value is a cons @code{(@var{angles} . @var{arrows})}, @var{angles} | |
2775 controls the angle icons, and @var{arrows} controls the arrows. Both | |
2776 @var{angles} and @var{arrows} work according to the table above. | |
2777 Thus, @code{(t . right)} places the top angle icon in the left | |
2778 fringe, the bottom angle icon in the right fringe, and both arrows in | |
2779 the right fringe. | |
2780 @end defvar | |
2781 | |
2782 @defvar default-indicate-buffer-boundaries | |
2783 The value of this variable is the default value for | |
2784 @code{indicate-buffer-boundaries} in buffers that do not override it. | |
2785 @end defvar | |
2740 | 2786 |
2741 @node Scroll Bars | 2787 @node Scroll Bars |
2742 @section Scroll Bars | 2788 @section Scroll Bars |
2743 | 2789 |
2744 Normally the frame parameter @code{vertical-scroll-bars} controls | 2790 Normally the frame parameter @code{vertical-scroll-bars} controls |
2749 | 2795 |
2750 You can also control this for individual windows. Call the function | 2796 You can also control this for individual windows. Call the function |
2751 @code{set-window-scroll-bars} to specify what to do for a specific window: | 2797 @code{set-window-scroll-bars} to specify what to do for a specific window: |
2752 | 2798 |
2753 @defun set-window-scroll-bars window width &optional vertical-type horizontal-type | 2799 @defun set-window-scroll-bars window width &optional vertical-type horizontal-type |
2754 Set width and type of scroll bars of window @var{window}. | 2800 This function sets the width and type of scroll bars for window |
2755 If @var{window} is @code{nil}, the selected window is used. | 2801 @var{window}. |
2802 | |
2756 @var{width} specifies the scroll bar width in pixels (@code{nil} means | 2803 @var{width} specifies the scroll bar width in pixels (@code{nil} means |
2757 use whatever is specified for width for the frame). | 2804 use the width specified for the frame). @var{vertical-type} specifies |
2758 @var{vertical-type} specifies whether to have a vertical scroll bar | 2805 whether to have a vertical scroll bar and, if so, where. The possible |
2759 and, if so, where. The possible values are @code{left}, @code{right} | 2806 values are @code{left}, @code{right} and @code{nil}, just like the |
2760 and @code{nil}, just like the values of the | 2807 values of the @code{vertical-scroll-bars} frame parameter. |
2761 @code{vertical-scroll-bars} frame parameter. | |
2762 | 2808 |
2763 The argument @var{horizontal-type} is meant to specify whether and | 2809 The argument @var{horizontal-type} is meant to specify whether and |
2764 where to have horizontal scroll bars, but since they are not | 2810 where to have horizontal scroll bars, but since they are not |
2765 implemented, it has no effect. | 2811 implemented, it has no effect. If @var{window} is @code{nil}, the |
2812 selected window is used. | |
2766 @end defun | 2813 @end defun |
2767 | 2814 |
2768 @defun window-scroll-bars &optional window | 2815 @defun window-scroll-bars &optional window |
2769 Report the width and type of scroll bars specified for @var{window}. | 2816 Report the width and type of scroll bars specified for @var{window}. |
2770 If @var{window} is omitted or @code{nil}, the selected window is used. | 2817 If @var{window} is omitted or @code{nil}, the selected window is used. |
2787 specifying the same buffer that is already displayed. | 2834 specifying the same buffer that is already displayed. |
2788 | 2835 |
2789 @node Pointer Shape | 2836 @node Pointer Shape |
2790 @section Pointer Shape | 2837 @section Pointer Shape |
2791 | 2838 |
2792 Normally, the mouse pointer has the @code{text} shape over text and | 2839 Normally, the mouse pointer has the @code{text} shape over text and |
2793 the @code{arrow} shape over window areas which do not correspond to | 2840 the @code{arrow} shape over window areas which do not correspond to |
2794 any buffer text. | 2841 any buffer text. You can specify the mouse pointer shape over text or |
2795 | 2842 images via the @code{pointer} text property, and for images with the |
2796 The available pointer shapes are: @code{text} (or @code{nil}), | 2843 @code{:pointer} and @code{:map} image properties. |
2844 | |
2845 The available pointer shapes are: @code{text} (or @code{nil}), | |
2797 @code{arrow}, @code{hand}, @code{vdrag}, @code{hdrag}, | 2846 @code{arrow}, @code{hand}, @code{vdrag}, @code{hdrag}, |
2798 @code{modeline}, and @code{hourglass}. | 2847 @code{modeline}, and @code{hourglass}. |
2799 | |
2800 The mouse pointer shape over text or images can be changed via the | |
2801 @code{pointer} text property, and for image with the @code{:pointer} | |
2802 and @code{:map} image properties. | |
2803 | 2848 |
2804 @defvar void-text-area-pointer | 2849 @defvar void-text-area-pointer |
2805 @tindex void-text-area-pointer | 2850 @tindex void-text-area-pointer |
2806 This variable specifies the mouse pointer shape in void text areas, | 2851 This variable specifies the mouse pointer shape in void text areas, |
2807 i.e. the areas after the end of a line or below the last line in the | 2852 i.e. the areas after the end of a line or below the last line in the |
2826 * Pixel Specification:: Specifying space width or height in pixels. | 2871 * Pixel Specification:: Specifying space width or height in pixels. |
2827 * Other Display Specs:: Displaying an image; magnifying text; moving it | 2872 * Other Display Specs:: Displaying an image; magnifying text; moving it |
2828 up or down on the page; adjusting the width | 2873 up or down on the page; adjusting the width |
2829 of spaces within text. | 2874 of spaces within text. |
2830 * Display Margins:: Displaying text or images to the side of the main text. | 2875 * Display Margins:: Displaying text or images to the side of the main text. |
2831 * Display Fringe Bitmaps:: Displaying a fringe bitmap in a specific line. | |
2832 * Conditional Display:: Making any of the above features conditional | 2876 * Conditional Display:: Making any of the above features conditional |
2833 depending on some Lisp expression. | 2877 depending on some Lisp expression. |
2834 @end menu | 2878 @end menu |
2835 | 2879 |
2836 @node Specified Space | 2880 @node Specified Space |
2849 | 2893 |
2850 @table @code | 2894 @table @code |
2851 @item :width @var{width} | 2895 @item :width @var{width} |
2852 If @var{width} is an integer or floating point number, it specifies | 2896 If @var{width} is an integer or floating point number, it specifies |
2853 that the space width should be @var{width} times the normal character | 2897 that the space width should be @var{width} times the normal character |
2854 width. The @var{width} may also be a @dfn{pixel width} specification | 2898 width. @var{width} can also be a @dfn{pixel width} specification |
2855 (@pxref{Pixel Specification}). | 2899 (@pxref{Pixel Specification}). |
2856 | 2900 |
2857 @item :relative-width @var{factor} | 2901 @item :relative-width @var{factor} |
2858 Specifies that the width of the stretch should be computed from the | 2902 Specifies that the width of the stretch should be computed from the |
2859 first character in the group of consecutive characters that have the | 2903 first character in the group of consecutive characters that have the |
2860 same @code{display} property. The space width is the width of that | 2904 same @code{display} property. The space width is the width of that |
2861 character, multiplied by @var{factor}. | 2905 character, multiplied by @var{factor}. |
2862 | 2906 |
2863 @item :align-to @var{hpos} | 2907 @item :align-to @var{hpos} |
2864 Specifies that the space should be wide enough to reach @var{hpos}. | 2908 Specifies that the space should be wide enough to reach @var{hpos}. |
2865 If the value @var{hpos} is an integer or a floating point number, it | 2909 If @var{hpos} is a number, it is measured in units of the normal |
2866 is measured in units of the normal character width. The @var{hpos} | 2910 character width. @var{hpos} can also be a @dfn{pixel width} |
2867 may also be a @dfn{pixel width} specification (@pxref{Pixel Specification}). | 2911 specification (@pxref{Pixel Specification}). |
2868 @end table | 2912 @end table |
2869 | 2913 |
2870 The @code{:height} and @code{:align-to} properties are also supported | |
2871 on non-window systems. | |
2872 | |
2873 You should use one and only one of the above properties. You can | 2914 You should use one and only one of the above properties. You can |
2874 also specify the height of the space, with other properties: | 2915 also specify the height of the space, with these properties: |
2875 | 2916 |
2876 @table @code | 2917 @table @code |
2877 @item :height @var{height} | 2918 @item :height @var{height} |
2878 Specifies the height of the space. | 2919 Specifies the height of the space. |
2879 If @var{height} is an integer or floating point number, it specifies | 2920 If @var{height} is an integer or floating point number, it specifies |
2894 | 2935 |
2895 @end table | 2936 @end table |
2896 | 2937 |
2897 Don't use both @code{:height} and @code{:relative-height} together. | 2938 Don't use both @code{:height} and @code{:relative-height} together. |
2898 | 2939 |
2940 The @code{:height} and @code{:align-to} properties are supported on | |
2941 non-graphic terminals, but the other space properties in this section | |
2942 are not. | |
2943 | |
2899 @node Pixel Specification | 2944 @node Pixel Specification |
2900 @subsection Pixel Specification for Spaces | 2945 @subsection Pixel Specification for Spaces |
2901 @cindex spaces, pixel specification | 2946 @cindex spaces, pixel specification |
2902 | 2947 |
2903 The value of the @code{:width}, @code{:align-to}, @code{:height}, | 2948 The value of the @code{:width}, @code{:align-to}, @code{:height}, |
2904 and @code{:ascent} properties can be a (trivial) expression | 2949 and @code{:ascent} properties can be a special kind of expression that |
2905 which is evaluated during redisplay. The result of the evaluation is | 2950 is evaluated during redisplay. The result of the evaluation is used |
2906 used as an absolute number of pixels. | 2951 as an absolute number of pixels. |
2907 | 2952 |
2908 The following expressions are supported: | 2953 The following expressions are supported: |
2909 | 2954 |
2910 @example | 2955 @example |
2911 @group | 2956 @group |
2912 EXPR ::= NUM | (NUM) | UNIT | ELEM | POS | IMAGE | FORM | 2957 @var{expr} ::= @var{num} | (@var{num}) | @var{unit} | @var{elem} | @var{pos} | IMAGE | @var{form} |
2913 NUM ::= INTEGER | FLOAT | SYMBOL | 2958 @var{num} ::= @var{integer} | @var{float} | @var{symbol} |
2914 UNIT ::= in | mm | cm | width | height | 2959 @var{unit} ::= in | mm | cm | width | height |
2915 ELEM ::= left-fringe | right-fringe | left-margin | right-margin | 2960 @var{elem} ::= left-fringe | right-fringe | left-margin | right-margin |
2916 | scroll-bar | text | 2961 | scroll-bar | text |
2917 POS ::= left | center | right | 2962 @var{pos} ::= left | center | right |
2918 FORM ::= (NUM . EXPR) | (OP EXPR ...) | 2963 @var{form} ::= (@var{num} . @var{expr}) | (@var{op} @var{expr} ...) |
2919 OP ::= + | - | 2964 @var{op} ::= + | - |
2920 @end group | 2965 @end group |
2921 @end example | 2966 @end example |
2922 | 2967 |
2923 The form @var{NUM} specifies a fractional width or height of the | 2968 The form @var{num} specifies a fraction of the default frame font |
2924 default frame font size. The form @code{(@var{NUM})} specifies an | 2969 height or width. The form @code{(@var{num})} specifies an absolute |
2925 absolute number of pixels. If a symbol @var{SYMBOL} is specified, its | 2970 number of pixels. If @var{num} is a symbol, @var{symbol}, its |
2926 buffer-local variable binding is used. | 2971 buffer-local variable binding is used. |
2927 | 2972 |
2928 The @code{in}, @code{mm}, and @code{cm} units specifies the number | 2973 The @code{in}, @code{mm}, and @code{cm} units specify the number of |
2929 of pixels per inch, milli-meter, and centi-meter, resp. The | 2974 pixels per inch, millimeter, and centimeter, respectively. The |
2930 @code{width} and @code{height} units correspond to the width and | 2975 @code{width} and @code{height} units correspond to the default width |
2931 height of the current face font. An image specification @var{IMAGE} | 2976 and height of the current face. An image specification @code{IMAGE} |
2932 corresponds to the width or height of the image. | 2977 corresponds to the width or height of the image. |
2933 | 2978 |
2934 The @code{left-fringe}, @code{right-fringe}, @code{left-margin}, | 2979 The @code{left-fringe}, @code{right-fringe}, @code{left-margin}, |
2935 @code{right-margin}, @code{scroll-bar}, and @code{text} elements | 2980 @code{right-margin}, @code{scroll-bar}, and @code{text} elements |
2936 specify to the width of the corresponding area of the window. | 2981 specify to the width of the corresponding area of the window. |
2937 | 2982 |
2938 The @code{left}, @code{center}, and @code{right} positions can be | 2983 The @code{left}, @code{center}, and @code{right} positions can be |
2939 used with @code{:align-to} to specify a position relative to the left | 2984 used with @code{:align-to} to specify a position relative to the left |
2940 edge, center, or right edge of the text area. | 2985 edge, center, or right edge of the text area. |
2941 | 2986 |
2942 One of the above window elements (except @code{text}) can also be | 2987 Any of the above window elements (except @code{text}) can also be |
2943 used with @code{:align-to} to specify that the position is relative to | 2988 used with @code{:align-to} to specify that the position is relative to |
2944 the left edge of the given area. Once the base offset for a relative | 2989 the left edge of the given area. Once the base offset for a relative |
2945 position has been set (by the first occurrence of one of these | 2990 position has been set (by the first occurrence of one of these |
2946 symbols), further occurences of these symbols are interpreted as the | 2991 symbols), further occurences of these symbols are interpreted as the |
2947 width of the specified area. For example, to align to the center of | 2992 width of the specified area. For example, to align to the center of |
2953 | 2998 |
2954 If no specific base offset is set for alignment, it is always relative | 2999 If no specific base offset is set for alignment, it is always relative |
2955 to the left edge of the text area. For example, @samp{:align-to 0} in a | 3000 to the left edge of the text area. For example, @samp{:align-to 0} in a |
2956 header-line aligns with the first text column in the text area. | 3001 header-line aligns with the first text column in the text area. |
2957 | 3002 |
2958 The value of the form @code{(@var{NUM} . @var{EXPR})} is the value of | 3003 A value of the form @code{(@var{num} . @var{expr})} stands |
2959 @var{NUM} multiplied by the value of the expression @var{EXPR}. For | 3004 multiplying the values of @var{num} and @var{expr}. For example, |
2960 example, @samp{(2 . in)} specifies a width of 2 inches, while | 3005 @code{(2 . in)} specifies a width of 2 inches, while @code{(0.5 . |
2961 @samp{(0.5 . IMAGE)} specifies half the width (or height) of the | 3006 IMAGE)} specifies half the width (or height) of the specified image. |
2962 specified image. | 3007 |
2963 | 3008 The form @code{(+ @var{expr} ...)} adds up the value of the |
2964 The form @code{(+ @var{EXPR} ...)} adds up the value of the | 3009 expressions. The form @code{(- @var{expr} ...)} negates or subtracts |
2965 expressions. The form @code{(- @var{EXPR} ...)} negates or subtracts | |
2966 the value of the expressions. | 3010 the value of the expressions. |
2967 | |
2968 | 3011 |
2969 @node Other Display Specs | 3012 @node Other Display Specs |
2970 @subsection Other Display Specifications | 3013 @subsection Other Display Specifications |
3014 | |
3015 Here are the other sorts of display specifications that you can use | |
3016 in the @code{display} text property. | |
2971 | 3017 |
2972 @table @code | 3018 @table @code |
2973 @item (image . @var{image-props}) | 3019 @item (image . @var{image-props}) |
2974 This is in fact an image descriptor (@pxref{Images}). When used as a | 3020 This is in fact an image descriptor (@pxref{Images}). When used as a |
2975 display specification, it means to display the image instead of the text | 3021 display specification, it means to display the image instead of the text |
2976 that has the display specification. | 3022 that has the display specification. |
2977 | 3023 |
2978 @item (slice @var{x} @var{y} @var{width} @var{height}) | 3024 @item (slice @var{x} @var{y} @var{width} @var{height}) |
2979 This property is used with an @code{image} property to specify a | 3025 This specification together with @code{image} specifies a @dfn{slice} |
2980 @dfn{slice} (a partial area) of the image to display. The top left | 3026 (a partial area) of the image to display. The elements @var{y} and |
2981 corner of the slice is specified by @var{y} and @var{x} and the width | 3027 @var{x} specify the top left corner of the slice, within the image; |
2982 and height of the slice is specified by @var{width} and @var{height}. | 3028 @var{width} and @var{height} specify the width and height of the |
2983 Integer values are taken as pixel values. A floating point number in | 3029 slice. Integer values are numbers of pixels. A floating point number |
2984 the range 0.0 - 1.0 is relative to the width or height of the whole | 3030 in the range 0.0--1.0 stands for that fraction of the width or height |
2985 image. | 3031 of the entire image. |
2986 | 3032 |
2987 @item ((margin nil) @var{string}) | 3033 @item ((margin nil) @var{string}) |
2988 @itemx @var{string} | 3034 @itemx @var{string} |
2989 A display specification of this form means to display @var{string} | 3035 A display specification of this form means to display @var{string} |
2990 instead of the text that has the display specification, at the same | 3036 instead of the text that has the display specification, at the same |
3102 @defun window-margins &optional window | 3148 @defun window-margins &optional window |
3103 @tindex window-margins | 3149 @tindex window-margins |
3104 This function returns the left and right margins of @var{window} | 3150 This function returns the left and right margins of @var{window} |
3105 as a cons cell of the form @code{(@var{left} . @var{right})}. | 3151 as a cons cell of the form @code{(@var{left} . @var{right})}. |
3106 If @var{window} is @code{nil}, the selected window is used. | 3152 If @var{window} is @code{nil}, the selected window is used. |
3107 @end defun | |
3108 | |
3109 @node Display Fringe Bitmaps | |
3110 @subsection Displaying Bitmaps in the Fringes | |
3111 @cindex display fringes | |
3112 @cindex margins, fringes | |
3113 | |
3114 You can display a bitmap in the left or right fringes for a given | |
3115 line in a window using the @code{display} property. | |
3116 | |
3117 To put text in the left or right fringe of the window, use a | |
3118 display specification of the form @code{(left-fringe @var{bitmap} [@var{face}])} | |
3119 or @code{(right-fringe @var{bitmap} [@var{face}])} on one of the | |
3120 characters on the corresponding text line. | |
3121 | |
3122 The @var{bitmap} is an opaque integer identifying the bitmap, and the | |
3123 optional @var{face} is the name of the face whose foreground and | |
3124 background color is to be used for displaying the bitmap. | |
3125 | |
3126 @defun fringe-bitmaps-at-pos &optional pos window | |
3127 This function returns the fringe bitmaps of the display row containing | |
3128 position @var{pos} in window @var{window}. The return value is a cons | |
3129 @code{(@var{left} . @var{right})} where @var{left} and @var{right} | |
3130 are the fringe bitmap numbers for the bitmaps in the left and right | |
3131 fringe, resp. | |
3132 | |
3133 Returns @code{nil} if @var{pos} is not visible in window | |
3134 @var{window}. If @var{window} is @code{nil}, use the selected window. | |
3135 If @var{pos} is @code{nil}, use value of point in that window. | |
3136 @end defun | 3153 @end defun |
3137 | 3154 |
3138 @node Conditional Display | 3155 @node Conditional Display |
3139 @subsection Conditional Display Specifications | 3156 @subsection Conditional Display Specifications |
3140 @cindex conditional display specifications | 3157 @cindex conditional display specifications |
3422 it is over the hot-spot. | 3439 it is over the hot-spot. |
3423 @xref{Pointer Shapes}, for available pointer shapes. | 3440 @xref{Pointer Shapes}, for available pointer shapes. |
3424 | 3441 |
3425 When you click the mouse when the mouse pointer is over a hot-spot, an | 3442 When you click the mouse when the mouse pointer is over a hot-spot, an |
3426 event is composed by combining the @var{id} of the hot-spot with the | 3443 event is composed by combining the @var{id} of the hot-spot with the |
3427 mouse event, e.g. @samp{[area4 mouse-1]} if the hot-spot's @var{id} is | 3444 mouse event; for instance, @code{[area4 mouse-1]} if the hot-spot's |
3428 @samp{area4}. | 3445 @var{id} is @code{area4}. |
3429 | |
3430 @end table | 3446 @end table |
3431 | 3447 |
3432 @defun image-mask-p spec &optional frame | 3448 @defun image-mask-p spec &optional frame |
3433 @tindex image-mask-p | 3449 @tindex image-mask-p |
3434 This function returns @code{t} if image @var{spec} has a mask bitmap. | 3450 This function returns @code{t} if image @var{spec} has a mask bitmap. |
3707 @code{nil} or omitted, the image is displayed at point within the | 3723 @code{nil} or omitted, the image is displayed at point within the |
3708 buffer's text. | 3724 buffer's text. |
3709 | 3725 |
3710 The argument @var{slice} specifies a slice of the image to insert. If | 3726 The argument @var{slice} specifies a slice of the image to insert. If |
3711 @var{slice} is @code{nil} or omitted the whole image is inserted. | 3727 @var{slice} is @code{nil} or omitted the whole image is inserted. |
3712 Otherwise, @var{slice} is a list | 3728 Otherwise, @var{slice} is a list @code{(@var{x} @var{y} @var{width} |
3713 @code{(@var{x} @var{y} @var{width} @var{height})} | 3729 @var{height})} which specifies the @var{x} and @var{y} positions and |
3714 which specifies the @var{x} and @var{y} positions and | |
3715 @var{width} and @var{height} of the image area to insert. Integer | 3730 @var{width} and @var{height} of the image area to insert. Integer |
3716 values are taken as pixel values. A floating point number in the | 3731 values are in units of pixels. A floating point number in the range |
3717 range 0.0 - 1.0 is relative to the width or height of the image. | 3732 0.0--1.0 stands for that fraction of the width or height of the entire |
3733 image. | |
3718 | 3734 |
3719 Internally, this function inserts @var{string} in the buffer, and gives | 3735 Internally, this function inserts @var{string} in the buffer, and gives |
3720 it a @code{display} property which specifies @var{image}. @xref{Display | 3736 it a @code{display} property which specifies @var{image}. @xref{Display |
3721 Property}. | 3737 Property}. |
3722 @end defun | 3738 @end defun |
3723 | 3739 |
3724 @defun insert-sliced-image image &optional string area rows cols | 3740 @defun insert-sliced-image image &optional string area rows cols |
3725 This function inserts @var{image} in the current buffer at point like | 3741 This function inserts @var{image} in the current buffer at point, like |
3726 @code{insert-image}, but the image is automatically split into | 3742 @code{insert-image}, but splits the image into @var{rows}x@var{cols} |
3727 @var{rows} x @var{cols} equally sized slices. | 3743 equally sized slices. |
3728 @end defun | 3744 @end defun |
3729 | 3745 |
3730 @defun put-image image pos &optional string area | 3746 @defun put-image image pos &optional string area |
3731 This function puts image @var{image} in front of @var{pos} in the | 3747 This function puts image @var{image} in front of @var{pos} in the |
3732 current buffer. The argument @var{pos} should be an integer or a | 3748 current buffer. The argument @var{pos} should be an integer or a |