aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2007-10-09 01:24:28 +0000
committerRichard M. Stallman2007-10-09 01:24:28 +0000
commitfb33e6a9a6bf86ac11c0a0c0eba8317f8dace874 (patch)
tree02382dd0b02162d436dc45227329929030f8a099
parentd1d80b8056718f212074c9a82d1469876ea9aaf5 (diff)
downloademacs-fb33e6a9a6bf86ac11c0a0c0eba8317f8dace874.tar.gz
emacs-fb33e6a9a6bf86ac11c0a0c0eba8317f8dace874.zip
(Display Margins): Correct the description of margin display specifications.
(Replacing Specs): New subnode broken out of Display Property.
-rw-r--r--lispref/display.texi105
1 files changed, 61 insertions, 44 deletions
diff --git a/lispref/display.texi b/lispref/display.texi
index a5379847741..58b2ef11e72 100644
--- a/lispref/display.texi
+++ b/lispref/display.texi
@@ -3237,21 +3237,47 @@ to use the value specified by the frame.
3237insert images into text, and also control other aspects of how text 3237insert images into text, and also control other aspects of how text
3238displays. The value of the @code{display} property should be a 3238displays. The value of the @code{display} property should be a
3239display specification, or a list or vector containing several display 3239display specification, or a list or vector containing several display
3240specifications. Display specifications generally apply in parallel to 3240specifications. Display specifications in the same @code{display}
3241the text they cover. 3241property value generally apply in parallel to the text they cover.
3242
3243 If several sources (overlays and/or a text property) specify values
3244for the @code{display} property, only one of the values takes effect,
3245following the rules of @code{get-char-property}. @xref{Examining
3246Properties}.
3247
3248 The rest of this section describes several kinds of
3249display specifications and what they mean.
3250
3251@menu
3252* Replacing Specs:: Display specs that replace the text.
3253* Specified Space:: Displaying one space with a specified width.
3254* Pixel Specification:: Specifying space width or height in pixels.
3255* Other Display Specs:: Displaying an image; magnifying text; moving it
3256 up or down on the page; adjusting the width
3257 of spaces within text.
3258* Display Margins:: Displaying text or images to the side of the main text.
3259@end menu
3260
3261@node Replacing Specs
3262@subsection Display Specs That Replace The Text
3242 3263
3243 Some kinds of @code{display} specifications specify something to 3264 Some kinds of @code{display} specifications specify something to
3244display instead of the text that has the property. If a list of 3265display instead of the text that has the property. These are called
3245display specifications includes more than one of this kind, the first 3266@dfn{replacing} display specifications. Emacs does not allow the user
3246is effective and the rest are ignored. You cannot interactively move 3267to interactively move point into the middle of buffer text that is
3247point into the middle of the text that is thus replaced. 3268replaced in this way.
3248 3269
3249 For these specifications, ``the text that has the property'' means 3270 If a list of display specifications includes more than one replacing
3250all the consecutive characters that have the same Lisp object as their 3271display specification, the first overrides the rest. Replacing
3251@code{display} property; these characters are replaced as a single 3272display specifications make most other display specifications
3252unit. By contrast, characters that have similar but distinct Lisp 3273irrelevant, since those don't apply to the replacement.
3253objects as their @code{display} properties are handled separately. 3274
3254Here's a function that illustrates this point: 3275 For replacing display specifications, ``the text that has the
3276property'' means all the consecutive characters that have the same
3277Lisp object as their @code{display} property; these characters are
3278replaced as a single unit. By contrast, characters that have similar
3279but distinct Lisp objects as their @code{display} properties are
3280handled separately. Here's a function that illustrates this point:
3255 3281
3256@smallexample 3282@smallexample
3257(defun foo () 3283(defun foo ()
@@ -3291,18 +3317,6 @@ object as the @code{display} property value, it's irrelevant
3291whether they got this property from a single call to 3317whether they got this property from a single call to
3292@code{put-text-property} or from two different calls. 3318@code{put-text-property} or from two different calls.
3293 3319
3294 The rest of this section describes several kinds of
3295display specifications and what they mean.
3296
3297@menu
3298* Specified Space:: Displaying one space with a specified width.
3299* Pixel Specification:: Specifying space width or height in pixels.
3300* Other Display Specs:: Displaying an image; magnifying text; moving it
3301 up or down on the page; adjusting the width
3302 of spaces within text.
3303* Display Margins:: Displaying text or images to the side of the main text.
3304@end menu
3305
3306@node Specified Space 3320@node Specified Space
3307@subsection Specified Spaces 3321@subsection Specified Spaces
3308@cindex spaces, specified height or width 3322@cindex spaces, specified height or width
@@ -3541,25 +3555,28 @@ string.
3541@cindex display margins 3555@cindex display margins
3542@cindex margins, display 3556@cindex margins, display
3543 3557
3544 A buffer can have blank areas called @dfn{display margins} on the left 3558 A buffer can have blank areas called @dfn{display margins} on the
3545and on the right. Ordinary text never appears in these areas, but you 3559left and on the right. Ordinary text never appears in these areas,
3546can put things into the display margins using the @code{display} 3560but you can put things into the display margins using the
3547property. 3561@code{display} property. There is currently no way to make text or
3548 3562images in the margin mouse-sensitive.
3549 To put text in the left or right display margin of the window, use a 3563
3550display specification of the form @code{(margin right-margin)} or 3564 The way to display something in the margins is to specify it in a
3551@code{(margin left-margin)} on it. To put an image in a display margin, 3565margin display specification in the @code{display} property of some
3552use that display specification along with the display specification for 3566text. This is a replacing display specification, meaning that the
3553the image. Unfortunately, there is currently no way to make 3567text you put it on does not get displayed; the margin display appears,
3554text or images in the margin mouse-sensitive. 3568but that text does not.
3555 3569
3556 If you put such a display specification directly on text in the 3570 A margin display specification looks like @code{((margin
3557buffer, the specified margin display appears @emph{instead of} that 3571right-margin) @var{spec}} or @code{((margin left-margin) @var{spec})}.
3558buffer text itself. To put something in the margin @emph{in 3572Here, @var{spec} is another display specification that says what to
3559association with} certain buffer text without preventing or altering 3573display in the margin. Typically it is a string of text to display,
3560the display of that text, put a @code{before-string} property on the 3574or an image descriptor.
3561text and put the display specification on the contents of the 3575
3562before-string. 3576 To display something in the margin @emph{in association with}
3577certain buffer text, without altering or preventing the display of
3578that text, put a @code{before-string} property on the text and put the
3579margin display specification on the contents of the before-string.
3563 3580
3564 Before the display margins can display anything, you must give 3581 Before the display margins can display anything, you must give
3565them a nonzero width. The usual way to do that is to set these 3582them a nonzero width. The usual way to do that is to set these