aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim F. Storm2004-09-22 23:06:58 +0000
committerKim F. Storm2004-09-22 23:06:58 +0000
commit9b6e4bc3d990b77a742821fb5fd8a0c1c07c85f2 (patch)
treee167796e62e19e61c9185597dd7f78a5fa131f6b
parenta10db310a684f86ec99503a74e20cffea5675f6c (diff)
downloademacs-9b6e4bc3d990b77a742821fb5fd8a0c1c07c85f2.tar.gz
emacs-9b6e4bc3d990b77a742821fb5fd8a0c1c07c85f2.zip
(Display): Add 'Fringe Bitmaps' and 'Pointer
Shapes' to menu. (Standard Faces): Doc fix for fringe face. (Fringes): Add `overflow-newline-into-fringe' and 'indicate-buffer-boundaries'. (Fringe Bitmaps, Pointer Shapes): New nodes. (Display Property): Add 'Pixel Specification' and 'Display Fringe Bitmaps' to menu. (Specified Space): Describe pixel width and height. (Pixel Specification): New node. (Other Display Specs): Add `slice' property. (Display Fringe Bitmaps): New node. (Images): Add 'Image Slices' to menu. (Image Descriptors): Add `:pointer' and `:map' properties. (Showing Images): Add slice arg to `insert-image'. Add 'insert-sliced-image'.
-rw-r--r--lispref/display.texi372
1 files changed, 355 insertions, 17 deletions
diff --git a/lispref/display.texi b/lispref/display.texi
index fb9d7c79e0e..f5923acd3f5 100644
--- a/lispref/display.texi
+++ b/lispref/display.texi
@@ -25,7 +25,9 @@ that Emacs presents to the user.
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* Scroll Bars:: Controlling vertical scroll bars. 29* Scroll Bars:: Controlling vertical scroll bars.
30* Pointer Shapes:: Controlling the mouse pointer shape.
29* Display Property:: Enabling special display features. 31* Display Property:: Enabling special display features.
30* Images:: Displaying images in Emacs buffers. 32* Images:: Displaying images in Emacs buffers.
31* Buttons:: Adding clickable buttons to Emacs buffers. 33* Buttons:: Adding clickable buttons to Emacs buffers.
@@ -1486,7 +1488,7 @@ font. (This works only on certain systems.)
1486 1488
1487@item fringe 1489@item fringe
1488@kindex fringe @r{(face name)} 1490@kindex fringe @r{(face name)}
1489This face controls the colors of window fringes, the thin areas on 1491This face controls the default colors of window fringes, the thin areas on
1490either side that are used to display continuation and truncation glyphs. 1492either side that are used to display continuation and truncation glyphs.
1491 1493
1492@item minibuffer-prompt 1494@item minibuffer-prompt
@@ -2560,7 +2562,7 @@ non-@code{nil} value.
2560 2562
2561@defvar fringes-outside-margins 2563@defvar fringes-outside-margins
2562If the value is non-@code{nil}, the frames appear outside 2564If the value is non-@code{nil}, the frames appear outside
2563the display margins. 2565the display margins.
2564@end defvar 2566@end defvar
2565 2567
2566@defvar left-fringe-width 2568@defvar left-fringe-width
@@ -2596,6 +2598,146 @@ window is used. The value has the form @code{(@var{left-width}
2596@var{right-width} @var{frames-outside-margins})}. 2598@var{right-width} @var{frames-outside-margins})}.
2597@end defun 2599@end defun
2598 2600
2601@defvar overflow-newline-into-fringe
2602This variable, if non-@code{nil}, specifies that lines which are
2603exactly as wide as the window (not counting the final newline
2604character) shall not be broken into two lines on the display (with
2605just the newline on the second line). Instead, the newline now
2606overflows into the right fringe, and the cursor will be displayed in
2607the fringe when positioned on that newline.
2608@end defvar
2609
2610@defvar indicate-buffer-boundaries
2611This buffer-local variable controls how the buffer boundaries and
2612window scrolling is indicated in the fringes.
2613
2614 The buffer boundaries, i.e. first and last line in the buffer, can be
2615marked with angle bitmaps in the left or right fringe. This can be
2616combined with up and down arrow bitmaps shown at the top and bottom of
2617the left or right fringe if the window can be scrolled in either
2618direction.
2619
2620 If the value is @code{left} or @code{right}, both angle and arrow
2621bitmaps are displayed in the left or right fringe, respectively.
2622Any other non-@code{nil} value causes the bitmap on the top line to be
2623displayed in the left fringe, and the bitmap on the bottom line in the
2624right fringe.
2625
2626 If value is a cons @code{(angles . arrows)}, the car specifies the
2627position of the angle bitmaps, and the cdr specifies the position of
2628the arrow bitmaps. For example, @code{(t . right)} places the top
2629angle bitmap in left fringe, the bottom angle bitmap in right fringe,
2630and both arrow bitmaps in right fringe. To show just the angle
2631bitmaps in the left fringe, but no arrow bitmaps, use @code{(left . nil)}.
2632@end defvar
2633
2634@defvar default-indicate-buffer-boundaries
2635The value of this variable is the default value for
2636@code{indicate-buffer-boundaries} in buffers that do not override it.
2637@end defvar
2638
2639@node Fringe Bitmaps
2640@section Fringe Bitmaps
2641@cindex Fringe Bitmaps
2642
2643 The @dfn{fringe bitmaps} are tiny icons Emacs displays in the fringe
2644on a window system to indicate truncated or continued lines, buffer
2645boundaries, overlay arrow, etc. The fringe bitmaps are shared by all
2646frames and windows.
2647
2648 You can redefine the built-in fringe bitmaps, and you can define new
2649fringe bitmaps. Emacs can handle a maximum of 255 different fringe
2650bitmaps.
2651
2652A fringe bitmap is identified by an opaque integer, but Lisp code
2653should use the following names defined by @code{(require 'fringe)}:
2654
2655Truncation and continuation line bitmaps:
2656@code{left-truncation-fringe-bitmap},
2657@code{right-truncation-fringe-bitmap},
2658@code{continued-line-fringe-bitmap},
2659@code{continuation-line-fringe-bitmap}.
2660
2661Buffer indication bitmaps:
2662@code{up-arrow-fringe-bitmap},
2663@code{down-arrow-fringe-bitmap},
2664@code{top-left-angle-fringe-bitmap},
2665@code{top-right-angle-fringe-bitmap},
2666@code{bottom-left-angle-fringe-bitmap},
2667@code{bottom-right-angle-fringe-bitmap},
2668@code{left-bracket-fringe-bitmap},
2669@code{right-bracket-fringe-bitmap}.
2670
2671Empty line indication bitmap:
2672@code{empty-line-fringe-bitmap}.
2673
2674Overlay arrow bitmap:
2675@code{overlay-arrow-fringe-bitmap}.
2676
2677Bitmaps for displaying the cursor in right fringe:
2678@code{filled-box-cursor-fringe-bitmap},
2679@code{hollow-box-cursor-fringe-bitmap},
2680@code{hollow-square-fringe-bitmap}, @code{bar-cursor-fringe-bitmap},
2681@code{hbar-cursor-fringe-bitmap}.
2682
2683Fringe bitmap opaque value indicating that no fringe bitmap is present:
2684@code{no-fringe-bitmap}.
2685
2686Fringe bitmap opaque value indicating a reference to an undefined bitmap:
2687@code{undef-fringe-bitmap}.
2688
2689 To display an specific fringe bitmap on a line in an Emacs window,
2690use it as a @code{left-fringe} or @code{right-fringe} specifier in the
2691@code{display} property of some text that is displayed on that line
2692(@pxref{Display Property}).
2693
2694@defun define-fringe-bitmap bits &optional height width align bitmap
2695Define a new fringe bitmap, or change an existing bitmap.
2696
2697The argument @code{bits} is either a string or a vector of integers,
2698where each element (typically) corresponds to one row of the bitmap,
2699and each bit of an integer corresponds to one pixel of the bitmap.
2700
2701The optional argument @code{height} specifies the height of the bitmap.
2702If @code{height} is @code{nil}, the length of @code{bits} is used.
2703
2704The optional argument @code{width} specifies the width of the bitmap;
2705it must be an integer between 1 and 16, or @code{nil} which defaults
2706to a width of 8 pixels.
2707
2708The optional argument @code{align} may be one of @code{top},
2709@code{center}, or @code{bottom}, indicating the positioning of the
2710bitmap relative to the rows where it is used; the default is to center
2711the bitmap.
2712
2713The @code{align} argument may also be a list @code{(ALIGN PERIODIC)}
2714where @code{ALIGN} is intepreted as described above, and if
2715@code{PERIODIC} is non-@code{nil} it specifies that the @code{bits} should
2716be repeated until a bitmap of the specified @code{height} is created.
2717
2718The optional argument @code{bitmap} specifies the opaque integer that
2719identifies an existing bitmap to redefine.
2720
2721The return value is a new opaque integer identifying the new bitmap number,
2722or @code{nil} of there are no more free bitmap slots.
2723@end defun
2724
2725@defun destroy-fringe-bitmap bitmap
2726Destroy the fringe bitmap identified by the opaque integer
2727@code{bitmap}. If @code{bitmap} identifies a standard fringe bitmap,
2728the original built-in bitmap is restored.
2729@end defun
2730
2731@defun set-fringe-bitmap-face bitmap &optional face
2732Set face for a specific fringe bitmap @code{bitmap} to the face
2733specified by the argument @code{face}.
2734If @code{face} is @code{nil}, reset face to default @code{fringe} face.
2735
2736Normally, the specified face should be a face derived from the
2737@code{fringe} face, only specifying the foreground color as the
2738desired color of the fringe bitmap.
2739@end defun
2740
2599@node Scroll Bars 2741@node Scroll Bars
2600@section Scroll Bars 2742@section Scroll Bars
2601 2743
@@ -2609,7 +2751,7 @@ You can also control this for individual windows. Call the function
2609@code{set-window-scroll-bars} to specify what to do for a specific window: 2751@code{set-window-scroll-bars} to specify what to do for a specific window:
2610 2752
2611@defun set-window-scroll-bars window width &optional vertical-type horizontal-type 2753@defun set-window-scroll-bars window width &optional vertical-type horizontal-type
2612Set width and type of scroll bars of window @var{window}. 2754Set width and type of scroll bars of window @var{window}.
2613If @var{window} is @code{nil}, the selected window is used. 2755If @var{window} is @code{nil}, the selected window is used.
2614@var{width} specifies the scroll bar width in pixels (@code{nil} means 2756@var{width} specifies the scroll bar width in pixels (@code{nil} means
2615use whatever is specified for width for the frame). 2757use whatever is specified for width for the frame).
@@ -2644,6 +2786,28 @@ in a buffer that is already visible in a window, you can make the
2644window take note of the new values by calling @code{set-window-buffer} 2786window take note of the new values by calling @code{set-window-buffer}
2645specifying the same buffer that is already displayed. 2787specifying the same buffer that is already displayed.
2646 2788
2789@node Pointer Shapes
2790@section Pointer Shapes
2791
2792Normally, the mouse pointer has the @code{text} shape over text and
2793the @code{arrow} shape over window areas which do not correspond to
2794any buffer text.
2795
2796The available pointer shapes are: @code{text} (or @code{nil}),
2797@code{arrow}, @code{hand}, @code{vdrag}, @code{hdrag},
2798@code{modeline}, and @code{hourglass}.
2799
2800The mouse pointer shape over text or images can be changed via the
2801@code{pointer} text property, and for image with the @code{:pointer}
2802and @code{:map} image properties.
2803
2804@defvar void-text-area-pointer
2805@tindex void-text-area-pointer
2806This variable specifies the mouse pointer shape in void text areas,
2807i.e. the areas after the end of a line or below the last line in the
2808buffer. The default is to use the @code{arrow} (non-text) pointer.
2809@end defvar
2810
2647@node Display Property 2811@node Display Property
2648@section The @code{display} Property 2812@section The @code{display} Property
2649@cindex display specification 2813@cindex display specification
@@ -2659,10 +2823,12 @@ they mean.
2659 2823
2660@menu 2824@menu
2661* Specified Space:: Displaying one space with a specified width. 2825* Specified Space:: Displaying one space with a specified width.
2826* Pixel Specification:: Specifying space width or height in pixels.
2662* Other Display Specs:: Displaying an image; magnifying text; moving it 2827* Other Display Specs:: Displaying an image; magnifying text; moving it
2663 up or down on the page; adjusting the width 2828 up or down on the page; adjusting the width
2664 of spaces within text. 2829 of spaces within text.
2665* Display Margins:: Displaying text or images to the side of the main text. 2830* 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.
2666* Conditional Display:: Making any of the above features conditional 2832* Conditional Display:: Making any of the above features conditional
2667 depending on some Lisp expression. 2833 depending on some Lisp expression.
2668@end menu 2834@end menu
@@ -2683,9 +2849,10 @@ can use in @var{props} to specify the weight of the space:
2683 2849
2684@table @code 2850@table @code
2685@item :width @var{width} 2851@item :width @var{width}
2686Specifies that the space width should be @var{width} times the normal 2852If @var{width} is an integer or floating point number, it specifies
2687character width. @var{width} can be an integer or floating point 2853that the space width should be @var{width} times the normal character
2688number. 2854width. The @var{width} may also be a @dfn{pixel width} specification
2855(@pxref{Pixel Specification}).
2689 2856
2690@item :relative-width @var{factor} 2857@item :relative-width @var{factor}
2691Specifies that the width of the stretch should be computed from the 2858Specifies that the width of the stretch should be computed from the
@@ -2694,32 +2861,111 @@ same @code{display} property. The space width is the width of that
2694character, multiplied by @var{factor}. 2861character, multiplied by @var{factor}.
2695 2862
2696@item :align-to @var{hpos} 2863@item :align-to @var{hpos}
2697Specifies that the space should be wide enough to reach @var{hpos}. The 2864Specifies that the space should be wide enough to reach @var{hpos}.
2698value @var{hpos} is measured in units of the normal character width. It 2865If the value @var{hpos} is an integer or a floating point number, it
2699may be an integer or a floating point number. 2866is measured in units of the normal character width. The @var{hpos}
2867may also be a @dfn{pixel width} specification (@pxref{Pixel Specification}).
2700@end table 2868@end table
2701 2869
2870 The @code{:height} and @code{:align-to} properties are also supported
2871on non-window systems.
2872
2702 You should use one and only one of the above properties. You can 2873 You should use one and only one of the above properties. You can
2703also specify the height of the space, with other properties: 2874also specify the height of the space, with other properties:
2704 2875
2705@table @code 2876@table @code
2706@item :height @var{height} 2877@item :height @var{height}
2707Specifies the height of the space, as @var{height}, 2878Specifies the height of the space.
2708measured in terms of the normal line height. 2879If @var{height} is an integer or floating point number, it specifies
2880that the space height should be @var{height} times the normal character
2881height. The @var{height} may also be a @dfn{pixel height} specification
2882(@pxref{Pixel Specification}).
2709 2883
2710@item :relative-height @var{factor} 2884@item :relative-height @var{factor}
2711Specifies the height of the space, multiplying the ordinary height 2885Specifies the height of the space, multiplying the ordinary height
2712of the text having this display specification by @var{factor}. 2886of the text having this display specification by @var{factor}.
2713 2887
2714@item :ascent @var{ascent} 2888@item :ascent @var{ascent}
2715Specifies that @var{ascent} percent of the height of the space should be 2889If the value of @var{ascent} is a non-negative number no greater than
2716considered as the ascent of the space---that is, the part above the 2890100, it specifies that @var{ascent} percent of the height of the space
2717baseline. The value of @var{ascent} must be a non-negative number no 2891should be considered as the ascent of the space---that is, the part
2718greater than 100. 2892above the baseline. The ascent may also be specified in pixel units
2893with a @dfn{pixel ascent} specification (@pxref{Pixel Specification}).
2894
2719@end table 2895@end table
2720 2896
2721 Don't use both @code{:height} and @code{:relative-height} together. 2897 Don't use both @code{:height} and @code{:relative-height} together.
2722 2898
2899@node Pixel Specification
2900@subsection Pixel Specification for Spaces
2901@cindex spaces, pixel specification
2902
2903 The value of the @code{:width}, @code{:align-to}, @code{:height},
2904and @code{:ascent} properties can be a (trivial) expression
2905which is evaluated during redisplay. The result of the evaluation is
2906used as an absolute number of pixels.
2907
2908 The following expressions are supported:
2909
2910@example
2911@group
2912 EXPR ::= NUM | (NUM) | UNIT | ELEM | POS | IMAGE | FORM
2913 NUM ::= INTEGER | FLOAT | SYMBOL
2914 UNIT ::= in | mm | cm | width | height
2915 ELEM ::= left-fringe | right-fringe | left-margin | right-margin
2916 | scroll-bar | text
2917 POS ::= left | center | right
2918 FORM ::= (NUM . EXPR) | (OP EXPR ...)
2919 OP ::= + | -
2920@end group
2921@end example
2922
2923 The form @var{NUM} specifies a fractional width or height of the
2924default frame font size. The form @code(@var{NUM})} specifies an
2925absolute number of pixels. If a symbol @var{SYMBOL} is specified, its
2926buffer-local variable binding is used.
2927
2928 The @code{in}, @code{mm}, and @code{cm} units specifies the number
2929of pixels per inch, milli-meter, and centi-meter, resp. The
2930@code{width} and @code{height} units correspond to the width and
2931height of the current face font. An image specification @var{IMAGE}
2932corresponds to the width or height of the image.
2933
2934 The @code{left-fringe}, @code{right-fringe}, @code{left-margin},
2935@code{right-margin}, @code{scroll-bar}, and @code{text} elements
2936specify to the width of the corresponding area of the window.
2937
2938 The @code{left}, @code{center}, and @code{right} positions can be
2939used with @code{:align-to} to specify a position relative to the left
2940edge, center, or right edge of the text area.
2941
2942 One of the above window elements (except @code{text}) can also be
2943used with @code{:align-to} to specify that the position is relative to
2944the left edge of the given area. Once the base offset for a relative
2945position has been set (by the first occurrence of one of these
2946symbols), further occurences of these symbols are interpreted as the
2947width of the specified area. For example, to align to the center of
2948the left-margin, use
2949
2950@example
2951:align-to (+ left-margin (0.5 . left-margin))
2952@end example
2953
2954 If no specific base offset is set for alignment, it is always relative
2955to the left edge of the text area. For example, @samp{:align-to 0} in a
2956header-line aligns with the first text column in the text area.
2957
2958 The value of the form @code(@var{NUM} . @var{EXPR})} is the value of
2959@var{NUM} multiplied by the value of the expression @var{EXPR}. For
2960example, @samp{(2 . in)} specifies a width of 2 inches, while
2961@samp{(0.5 . IMAGE)} specifies half the width (or height) of the
2962specified image.
2963
2964 The form @code{(+ @var{EXPR} ...)} adds up the value of the
2965expressions. The form @code{(- @var{EXPR} ...)} negates or subtracts
2966the value of the expressions.
2967
2968
2723@node Other Display Specs 2969@node Other Display Specs
2724@subsection Other Display Specifications 2970@subsection Other Display Specifications
2725 2971
@@ -2729,6 +2975,15 @@ This is in fact an image descriptor (@pxref{Images}). When used as a
2729display specification, it means to display the image instead of the text 2975display specification, it means to display the image instead of the text
2730that has the display specification. 2976that has the display specification.
2731 2977
2978@item (slice @var{x} @var{y} @var{width} @var{height})
2979This property is used with an @code{image} property to specify a
2980@dfn{slice} (a partial area) of the image to display. The top left
2981corner of the slice is specified by @var{y} and @var{x} and the width
2982and height of the slice is specified by @var{width} and @var{height}.
2983Integer values are taken as pixel values. A floating point number in
2984the range 0.0 - 1.0 is relative to the width or height of the whole
2985image.
2986
2732@item ((margin nil) @var{string}) 2987@item ((margin nil) @var{string})
2733@itemx @var{string} 2988@itemx @var{string}
2734A display specification of this form means to display @var{string} 2989A display specification of this form means to display @var{string}
@@ -2851,6 +3106,35 @@ as a cons cell of the form @code{(@var{left} . @var{right})}.
2851If @var{window} is @code{nil}, the selected window is used. 3106If @var{window} is @code{nil}, the selected window is used.
2852@end defun 3107@end defun
2853 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
3115line in a window using the @code{display} property.
3116
3117 To put text in the left or right fringe of the window, use a
3118display specification of the form @code{(left-fringe @var{bitmap} [@var{face}])}
3119or @code{(right-fringe @var{bitmap} [@var{face}])} on one of the
3120characters on the corresponding text line.
3121
3122 The @var{bitmap} is an opaque integer identifying the bitmap, and the
3123optional @var{face} is the name of the face whose foreground and
3124background color is to be used for displaying the bitmap.
3125
3126@defun fringe-bitmaps-at-pos &optional pos window
3127This function returns the fringe bitmaps of the display row containing
3128position @var{pos} in window @var{window}. The return value is a cons
3129@code{(@var{left} . @var{right})} where @var{left} and @var{right}
3130are the fringe bitmap numbers for the bitmaps in the left and right
3131fringe, 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.
3135If @var{pos} is @code{nil}, use value of point in that window.
3136@end defun
3137
2854@node Conditional Display 3138@node Conditional Display
2855@subsection Conditional Display Specifications 3139@subsection Conditional Display Specifications
2856@cindex conditional display specifications 3140@cindex conditional display specifications
@@ -2943,6 +3227,7 @@ function always returns @code{t}; for other image types, it returns
2943* Other Image Types:: Various other formats are supported. 3227* Other Image Types:: Various other formats are supported.
2944* Defining Images:: Convenient ways to define an image for later use. 3228* Defining Images:: Convenient ways to define an image for later use.
2945* Showing Images:: Convenient ways to display an image once it is defined. 3229* Showing Images:: Convenient ways to display an image once it is defined.
3230* Image Slices:: Displaying image slices.
2946* Image Cache:: Internal mechanisms of image display. 3231* Image Cache:: Internal mechanisms of image display.
2947@end menu 3232@end menu
2948 3233
@@ -3105,6 +3390,44 @@ specifying the color to assume for the background of the image.
3105If @var{mask} is @code{nil}, remove a mask from the image, if it has 3390If @var{mask} is @code{nil}, remove a mask from the image, if it has
3106one. Images in some formats include a mask which can be removed by 3391one. Images in some formats include a mask which can be removed by
3107specifying @code{:mask nil}. 3392specifying @code{:mask nil}.
3393
3394@item :pointer @var{shape}
3395This specifies the pointer shape when the mouse pointer is over this
3396image. @xref{Pointer Shapes}, for available pointer shapes.
3397
3398@item :map @var{map}
3399This associates an image map of @dfn{hot spots} with this image.
3400
3401An image map is an alist where each element has the format
3402@code{(@var{area} @var{id} @var{plist})}. An @var{area} is specified
3403as either a rectangle, a circle, or a polygon.
3404
3405A rectangle is a cons
3406@code{(rect . ((@var{x0} . @var{y0}) . (@var{x1} . @var{y1})))}
3407which specifies the pixel coordinates of the upper left and bottom right
3408corners of the rectangle area.
3409
3410A circle is a cons
3411@code{(circle . ((@var{x0} . @var{y0}) . @var{r}))}
3412which specifies the center and the radius of the circle; @var{r} may
3413be a float or integer.
3414
3415A polygon is a cons
3416@code(poly . [@var{x0} @var{y0} @var{x1} @var{y1} ...])}
3417where each pair in the vector describes one corner in the polygon.
3418
3419When the mouse pointer is above a hot-spot area of an image, the
3420@var{plist} of that hot-spot is consulted; if it contains a @code{help-echo}
3421property it defines a tool-tip for the hot-spot, and if it contains
3422a @code{pointer} property, it defines the shape of the mouse cursor when
3423it is over the hot-spot.
3424@xref{Pointer Shapes}, for available pointer shapes.
3425
3426When you click the mouse when the mouse pointer is over a hot-spot, an
3427event is composed by combining the @var{id} of the hot-spot with the
3428mouse event, e.g. @samp{[area4 mouse-1]} if the hot-spot's @var{id} is
3429@samp{area4}.
3430
3108@end table 3431@end table
3109 3432
3110@defun image-mask-p spec &optional frame 3433@defun image-mask-p spec &optional frame
@@ -3372,7 +3695,7 @@ The image is looked for first on @code{load-path} and then in
3372property yourself, but it is easier to use the functions in this 3695property yourself, but it is easier to use the functions in this
3373section. 3696section.
3374 3697
3375@defun insert-image image &optional string area 3698@defun insert-image image &optional string area slice
3376This function inserts @var{image} in the current buffer at point. The 3699This function inserts @var{image} in the current buffer at point. The
3377value @var{image} should be an image descriptor; it could be a value 3700value @var{image} should be an image descriptor; it could be a value
3378returned by @code{create-image}, or the value of a symbol defined with 3701returned by @code{create-image}, or the value of a symbol defined with
@@ -3385,11 +3708,26 @@ If it is @code{left-margin}, the image appears in the left margin;
3385@code{nil} or omitted, the image is displayed at point within the 3708@code{nil} or omitted, the image is displayed at point within the
3386buffer's text. 3709buffer's text.
3387 3710
3711The argument @var{slice} specifies a slice of the image to insert. If
3712@var{slice} is @code{nil} or omitted the whole image is inserted.
3713Otherwise, @var{slice} is a list
3714@code{(@var{x} @var{y} @var{width} @var{height})}
3715which specifies the @var{x} and @var{y} positions and
3716@var{width} and @var{height} of the image area to insert. Integer
3717values are taken as pixel values. A floating point number in the
3718range 0.0 - 1.0 is relative to the width or height of the image.
3719
3388Internally, this function inserts @var{string} in the buffer, and gives 3720Internally, this function inserts @var{string} in the buffer, and gives
3389it a @code{display} property which specifies @var{image}. @xref{Display 3721it a @code{display} property which specifies @var{image}. @xref{Display
3390Property}. 3722Property}.
3391@end defun 3723@end defun
3392 3724
3725@defun insert-sliced-image image &optional string area rows cols
3726This function inserts @var{image} in the current buffer at point like
3727@code{insert-image}, but the image is automatically split into
3728@var{rows} x @var{cols} equally sized slices.
3729@end defun
3730
3393@defun put-image image pos &optional string area 3731@defun put-image image pos &optional string area
3394This function puts image @var{image} in front of @var{pos} in the 3732This function puts image @var{image} in front of @var{pos} in the
3395current buffer. The argument @var{pos} should be an integer or a 3733current buffer. The argument @var{pos} should be an integer or a
@@ -3498,7 +3836,7 @@ entries).
3498* Making Buttons:: Adding buttons to Emacs buffers. 3836* Making Buttons:: Adding buttons to Emacs buffers.
3499* Manipulating Buttons:: Getting and setting properties of buttons. 3837* Manipulating Buttons:: Getting and setting properties of buttons.
3500* Button Buffer Commands:: Buffer-wide commands and bindings for buttons. 3838* Button Buffer Commands:: Buffer-wide commands and bindings for buttons.
3501* Manipulating Button Types:: 3839* Manipulating Button Types::
3502@end menu 3840@end menu
3503 3841
3504@node Button Properties 3842@node Button Properties