Mercurial > emacs
comparison lispref/display.texi @ 57274:271dfa08c2d0
(Fringe Bitmaps): Use symbols rather than numbers
to identify bitmaps. Remove -fringe-bitmap suffix for standard
fringe bitmap symbols, as they now have their own namespace.
(Customizing Bitmaps) <define-fringe-bitmap>: Clarify bit ordering
vs. pixels. Signal error if no free bitmap slots.
(Pixel Specification): Change IMAGE to @var{image}.
author | Kim F. Storm <storm@cua.dk> |
---|---|
date | Wed, 29 Sep 2004 12:39:43 +0000 |
parents | 27349bd528f6 |
children | c02ec4a1158e 6c1af301b455 |
comparison
equal
deleted
inserted
replaced
57273:e267776b7fb2 | 57274:271dfa08c2d0 |
---|---|
2613 | 2613 |
2614 The @dfn{fringe bitmaps} are tiny icons Emacs displays in the window | 2614 The @dfn{fringe bitmaps} are tiny icons Emacs displays in the window |
2615 fringe (on a graphic display) to indicate truncated or continued | 2615 fringe (on a graphic display) to indicate truncated or continued |
2616 lines, buffer boundaries, overlay arrow, etc. The fringe bitmaps are | 2616 lines, buffer boundaries, overlay arrow, etc. The fringe bitmaps are |
2617 shared by all frames and windows. You can redefine the built-in | 2617 shared by all frames and windows. You can redefine the built-in |
2618 fringe bitmaps, and you can define new fringe bitmaps. However, Emacs | 2618 fringe bitmaps, and you can define new fringe bitmaps. |
2619 can handle only 255 different fringe bitmaps. | |
2620 | 2619 |
2621 The way to display a bitmap in the left or right fringes for a given | 2620 The way to display a bitmap in the left or right fringes for a given |
2622 line in a window is by specifying the @code{display} property for one | 2621 line in a window is by specifying the @code{display} property for one |
2623 of the characters that appears in it. Use a display specification of | 2622 of the characters that appears in it. Use a display specification of |
2624 the form @code{(left-fringe @var{bitmap} [@var{face}])} or | 2623 the form @code{(left-fringe @var{bitmap} [@var{face}])} or |
2625 @code{(right-fringe @var{bitmap} [@var{face}])} (@pxref{Display | 2624 @code{(right-fringe @var{bitmap} [@var{face}])} (@pxref{Display |
2626 Property}). Here, @var{bitmap} is an integer identifying the bitmap | 2625 Property}). Here, @var{bitmap} is a symbol identifying the bitmap |
2627 you want, and @var{face} (which is optional) is the name of the face | 2626 you want, and @var{face} (which is optional) is the name of the face |
2628 whose colors should be used for displaying the bitmap. | 2627 whose colors should be used for displaying the bitmap. |
2629 @c ??? Shouldn't the symbol name be used? | |
2630 | 2628 |
2631 These are the symbols identify the standard fringe bitmaps. | 2629 These are the symbols identify the standard fringe bitmaps. |
2632 Evaluate @code{(require 'fringe)} to define them. Each symbol's | 2630 Evaluate @code{(require 'fringe)} to define them. Fringe bitmap |
2633 value is an integer that identifies the corresponding bitmap. | 2631 symbols have their own name space. |
2634 | 2632 |
2635 @table @asis | 2633 @table @asis |
2636 @item Truncation and continuation line bitmaps: | 2634 @item Truncation and continuation line bitmaps: |
2637 @code{left-truncation-fringe-bitmap}, | 2635 @code{left-truncation}, @code{right-truncation}, |
2638 @code{right-truncation-fringe-bitmap}, | 2636 @code{continued-line}, @code{continuation-line}. |
2639 @code{continued-line-fringe-bitmap}, | |
2640 @code{continuation-line-fringe-bitmap}. | |
2641 | 2637 |
2642 @item Buffer indication bitmaps: | 2638 @item Buffer indication bitmaps: |
2643 @code{up-arrow-fringe-bitmap}, | 2639 @code{up-arrow}, @code{down-arrow}, |
2644 @code{down-arrow-fringe-bitmap}, | 2640 @code{top-left-angle}, @code{top-right-angle}, |
2645 @code{top-left-angle-fringe-bitmap}, | 2641 @code{bottom-left-angle}, @code{bottom-right-angle}, |
2646 @code{top-right-angle-fringe-bitmap}, | 2642 @code{left-bracket}, @code{right-bracket}. |
2647 @code{bottom-left-angle-fringe-bitmap}, | |
2648 @code{bottom-right-angle-fringe-bitmap}, | |
2649 @code{left-bracket-fringe-bitmap}, | |
2650 @code{right-bracket-fringe-bitmap}. | |
2651 | 2643 |
2652 @item Empty line indication bitmap: | 2644 @item Empty line indication bitmap: |
2653 @code{empty-line-fringe-bitmap}. | 2645 @code{empty-line}. |
2654 | 2646 |
2655 @item Overlay arrow bitmap: | 2647 @item Overlay arrow bitmap: |
2656 @code{overlay-arrow-fringe-bitmap}. | 2648 @code{overlay-arrow}. |
2657 | 2649 |
2658 @item Bitmaps for displaying the cursor in right fringe: | 2650 @item Bitmaps for displaying the cursor in right fringe: |
2659 @code{filled-box-cursor-fringe-bitmap}, | 2651 @code{filled-box-cursor}, @code{hollow-box-cursor}, @code{hollow-square}, |
2660 @code{hollow-box-cursor-fringe-bitmap}, | 2652 @code{bar-cursor}, @code{hbar-cursor}. |
2661 @code{hollow-square-fringe-bitmap}, @code{bar-cursor-fringe-bitmap}, | |
2662 @code{hbar-cursor-fringe-bitmap}. | |
2663 | |
2664 @item Value indicating that no fringe bitmap is present: | |
2665 @code{no-fringe-bitmap}. | |
2666 @c ??? I don't understand what that means. | |
2667 @c ??? Where would you find that value? | |
2668 | |
2669 @item Value indicating a reference to an undefined bitmap: | |
2670 @code{undef-fringe-bitmap}. | |
2671 @c ??? I don't understand what that means. | |
2672 @c ??? Where would you find that value? | |
2673 @end table | 2653 @end table |
2674 | 2654 |
2675 @defun fringe-bitmaps-at-pos &optional pos window | 2655 @defun fringe-bitmaps-at-pos &optional pos window |
2676 This function returns the fringe bitmaps of the display line | 2656 This function returns the fringe bitmaps of the display line |
2677 containing position @var{pos} in window @var{window}. The return | 2657 containing position @var{pos} in window @var{window}. The return |
2678 value has the form @code{(@var{left} . @var{right})}, where @var{left} | 2658 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 | 2659 is the symbol for the fringe bitmap in the left fringe (or @code{nil} |
2680 similar for the right fringe. These bitmap numbers are usually values | 2660 if no bitmap), and @var{right} is similar for the right fringe. |
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 | 2661 |
2686 The value is @code{nil} if @var{pos} is not visible in @var{window}. | 2662 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. | 2663 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 | 2664 If @var{pos} is @code{nil}, that stands for the value of point in |
2689 @var{window}. | 2665 @var{window}. |
2690 @end defun | 2666 @end defun |
2691 | 2667 |
2692 @node Customizing Bitmaps | 2668 @node Customizing Bitmaps |
2693 @section Customizing Fringe Bitmaps | 2669 @section Customizing Fringe Bitmaps |
2694 | 2670 |
2695 @c ??? Why not pass a symbol as the first argument | 2671 @defun define-fringe-bitmap bitmap bits &optional height width align |
2696 @c ??? and define that symbol. It would be cleaner. | 2672 This function defines the symbol @var{bitmap} as a new fringe bitmap, |
2697 | 2673 or replaces an existing bitmap with that name. |
2698 @defun define-fringe-bitmap bits &optional height width align bitmap | |
2699 This function defines a new fringe bitmap, or replaces an existing | |
2700 bitmap. | |
2701 | 2674 |
2702 The argument @var{bits} specifies the image to use. It should be | 2675 The argument @var{bits} specifies the image to use. It should be |
2703 either a string or a vector of integers, where each element (an | 2676 either a string or a vector of integers, where each element (an |
2704 integer) corresponds to one row of the bitmap. Each bit of an integer | 2677 integer) corresponds to one row of the bitmap. Each bit of an integer |
2705 corresponds to one pixel of the bitmap. | 2678 corresponds to one pixel of the bitmap, where the low bit corresponds |
2706 @c ??? Is the low bit the leftmost or the rightmost bit? | 2679 to the rightmost pixel of the bitmap. |
2707 | 2680 |
2708 The height is normally the length of @var{bits}. However, you | 2681 The height is normally the length of @var{bits}. However, you |
2709 can specify a different height with non-@code{nil} @var{height}. The width | 2682 can specify a different height with non-@code{nil} @var{height}. The width |
2710 is normally 8, but you can specify a different width with non-@code{nil} | 2683 is normally 8, but you can specify a different width with non-@code{nil} |
2711 @var{width}. The width must be an integer between 1 and 16. | 2684 @var{width}. The width must be an integer between 1 and 16. |
2719 @var{periodic})} where @var{align} is interpreted as described above. | 2692 @var{periodic})} where @var{align} is interpreted as described above. |
2720 If @var{periodic} is non-@code{nil}, it specifies that the rows in | 2693 If @var{periodic} is non-@code{nil}, it specifies that the rows in |
2721 @code{bits} should be repeated enough times to reach the specified | 2694 @code{bits} should be repeated enough times to reach the specified |
2722 height. | 2695 height. |
2723 | 2696 |
2724 The argument @var{bitmap} specifies an existing bitmap to redefine. | |
2725 You should pass the value of the symbol that identifies the bitmap. | |
2726 | |
2727 The return value on success is an integer identifying the new bitmap. | 2697 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 | 2698 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 | 2699 this bitmap. |
2730 free bitmap slots. | 2700 |
2731 @c ??? Why not signal an error? That would be cleaner. | 2701 This function signals an error if there are no more free bitmap slots. |
2732 @end defun | 2702 @end defun |
2733 | 2703 |
2734 @defun destroy-fringe-bitmap bitmap | 2704 @defun destroy-fringe-bitmap bitmap |
2735 This function destroy the fringe bitmap identified by @var{bitmap}. | 2705 This function destroy the fringe bitmap identified by @var{bitmap}. |
2736 If @var{bitmap} identifies a standard fringe bitmap, it actually | 2706 If @var{bitmap} identifies a standard fringe bitmap, it actually |
2952 | 2922 |
2953 The following expressions are supported: | 2923 The following expressions are supported: |
2954 | 2924 |
2955 @example | 2925 @example |
2956 @group | 2926 @group |
2957 @var{expr} ::= @var{num} | (@var{num}) | @var{unit} | @var{elem} | @var{pos} | IMAGE | @var{form} | 2927 @var{expr} ::= @var{num} | (@var{num}) | @var{unit} | @var{elem} | @var{pos} | @var{image} | @var{form} |
2958 @var{num} ::= @var{integer} | @var{float} | @var{symbol} | 2928 @var{num} ::= @var{integer} | @var{float} | @var{symbol} |
2959 @var{unit} ::= in | mm | cm | width | height | 2929 @var{unit} ::= in | mm | cm | width | height |
2960 @var{elem} ::= left-fringe | right-fringe | left-margin | right-margin | 2930 @var{elem} ::= left-fringe | right-fringe | left-margin | right-margin |
2961 | scroll-bar | text | 2931 | scroll-bar | text |
2962 @var{pos} ::= left | center | right | 2932 @var{pos} ::= left | center | right |
2971 buffer-local variable binding is used. | 2941 buffer-local variable binding is used. |
2972 | 2942 |
2973 The @code{in}, @code{mm}, and @code{cm} units specify the number of | 2943 The @code{in}, @code{mm}, and @code{cm} units specify the number of |
2974 pixels per inch, millimeter, and centimeter, respectively. The | 2944 pixels per inch, millimeter, and centimeter, respectively. The |
2975 @code{width} and @code{height} units correspond to the default width | 2945 @code{width} and @code{height} units correspond to the default width |
2976 and height of the current face. An image specification @code{IMAGE} | 2946 and height of the current face. An image specification @code{image} |
2977 corresponds to the width or height of the image. | 2947 corresponds to the width or height of the image. |
2978 | 2948 |
2979 The @code{left-fringe}, @code{right-fringe}, @code{left-margin}, | 2949 The @code{left-fringe}, @code{right-fringe}, @code{left-margin}, |
2980 @code{right-margin}, @code{scroll-bar}, and @code{text} elements | 2950 @code{right-margin}, @code{scroll-bar}, and @code{text} elements |
2981 specify to the width of the corresponding area of the window. | 2951 specify to the width of the corresponding area of the window. |
3001 header-line aligns with the first text column in the text area. | 2971 header-line aligns with the first text column in the text area. |
3002 | 2972 |
3003 A value of the form @code{(@var{num} . @var{expr})} stands | 2973 A value of the form @code{(@var{num} . @var{expr})} stands |
3004 multiplying the values of @var{num} and @var{expr}. For example, | 2974 multiplying the values of @var{num} and @var{expr}. For example, |
3005 @code{(2 . in)} specifies a width of 2 inches, while @code{(0.5 . | 2975 @code{(2 . in)} specifies a width of 2 inches, while @code{(0.5 . |
3006 IMAGE)} specifies half the width (or height) of the specified image. | 2976 @var{image})} specifies half the width (or height) of the specified image. |
3007 | 2977 |
3008 The form @code{(+ @var{expr} ...)} adds up the value of the | 2978 The form @code{(+ @var{expr} ...)} adds up the value of the |
3009 expressions. The form @code{(- @var{expr} ...)} negates or subtracts | 2979 expressions. The form @code{(- @var{expr} ...)} negates or subtracts |
3010 the value of the expressions. | 2980 the value of the expressions. |
3011 | 2981 |