Show
Ignore:
Timestamp:
2008年04月04日 22時04分40秒 (8 months ago)
Author:
miyoshi
Message:

Sync up with Emacs22.2.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lispref/display.texi

    r4204 r4220  
    22@c This is part of the GNU Emacs Lisp Reference Manual. 
    33@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 
    4 @c   2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. 
     4@c   2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 
    55@c See the file elisp.texi for copying conditions. 
    66@setfilename ../info/display 
     
    5656@end deffn 
    5757 
    58   This function calls for redisplay of certain windows, the next time 
    59 redisplay is done, but does not clear them first. 
    60  
    61 @defun force-window-update &optional object 
    62 This function forces some or all windows to be updated on next redisplay. 
    63 If @var{object} is a window, it forces redisplay of that window.  If 
    64 @var{object} is a buffer or buffer name, it forces redisplay of all 
    65 windows displaying that buffer.  If @var{object} is @code{nil} (or 
    66 omitted), it forces redisplay of all windows. 
    67 @end defun 
    68  
    69   Processing user input takes absolute priority over redisplay.  If you 
    70 call these functions when input is available, they do nothing 
    71 immediately, but a full redisplay does happen eventually---after all the 
    72 input has been processed. 
     58  In Emacs, processing user input takes priority over redisplay.  If 
     59you call these functions when input is available, they don't redisplay 
     60immediately, but the requested redisplay does happen 
     61eventually---after all the input has been processed. 
    7362 
    7463  Normally, suspending and resuming Emacs also refreshes the screen. 
     
    9079@cindex forcing redisplay 
    9180 
     81  Emacs normally tries to redisplay the screen whenever it waits for 
     82input.  With this function you can request an immediate attempt to 
     83redisplay, in the middle of Lisp code, without actually waiting for 
     84input. 
     85 
     86@defun redisplay &optional force 
     87This function tries immediately to redisplay, provided there are no 
     88pending input events.  It is equivalent to @code{(sit-for 0)}. 
     89 
     90If the optional argument @var{force} is non-@code{nil}, it does all 
     91pending redisplay work even if input is available, with no 
     92pre-emption. 
     93 
     94The function returns @code{t} if it actually tried to redisplay, and 
     95@code{nil} otherwise.  A value of @code{t} does not mean that 
     96redisplay proceeded to completion; it could have been pre-empted by 
     97newly arriving terminal input. 
     98@end defun 
     99 
     100  @code{redisplay} with no argument tries immediately to redisplay, 
     101but has no effect on the usual rules for what parts of the screen to 
     102redisplay.  By contrast, the following function adds certain windows 
     103to the pending redisplay work (as if their contents had completely 
     104changed), but doesn't immediately try to do any redisplay work. 
     105 
     106@defun force-window-update &optional object 
     107This function forces some or all windows to be updated on next 
     108redisplay.  If @var{object} is a window, it requires eventual 
     109redisplay of that window.  If @var{object} is a buffer or buffer name, 
     110it requires eventual redisplay of all windows displaying that buffer. 
     111If @var{object} is @code{nil} (or omitted), it requires eventual 
     112redisplay of all windows. 
     113@end defun 
     114 
     115  @code{force-window-update} does not do a redisplay immediately. 
     116(Emacs will do that when it waits for input.)  Rather, its effect is 
     117to put more work on the queue to be done by redisplay whenever there 
     118is a chance. 
     119 
    92120  Emacs redisplay normally stops if input arrives, and does not happen 
    93121at all if input is available before it starts.  Most of the time, this 
    94122is exactly what you want.  However, you can prevent preemption by 
    95123binding @code{redisplay-dont-pause} to a non-@code{nil} value. 
     124 
     125@defvar redisplay-dont-pause 
     126If this variable is non-@code{nil}, pending input does not 
     127prevent or halt redisplay; redisplay occurs, and finishes, 
     128regardless of whether input is available. 
     129@end defvar 
    96130 
    97131@defvar redisplay-preemption-period 
     
    107141text terminals, see @ref{Terminal Output}. 
    108142@end defvar 
    109  
    110 @defvar redisplay-dont-pause 
    111 If this variable is non-@code{nil}, pending input does not 
    112 prevent or halt redisplay; redisplay occurs, and finishes, 
    113 regardless of whether input is available. 
    114 @end defvar 
    115  
    116 @defun redisplay &optional force 
    117 This function performs an immediate redisplay provided there are no 
    118 pending input events.  This is equivalent to @code{(sit-for 0)}. 
    119  
    120 If the optional argument @var{force} is non-@code{nil}, it forces an 
    121 immediate and complete redisplay even if input is available. 
    122  
    123 Returns @code{t} if redisplay was performed, or @code{nil} otherwise. 
    124 @end defun 
    125143 
    126144@node Truncation 
     
    17191737@defun facep object 
    17201738This function returns @code{t} if @var{object} is a face name string 
    1721 or symbol (or if it is a vector of the kind used internally to record 
    1722 face data).  It returns @code{nil} otherwise. 
     1739or symbol.  It returns @code{nil} otherwise. 
    17231740@end defun 
    17241741 
     
    17601777@var{spec}, then uses any customizations that were read from the 
    17611778init file (@pxref{Init File}) to override that specification. 
     1779 
     1780When you evaluate a @code{defface} form with @kbd{C-M-x} in Emacs 
     1781Lisp mode (@code{eval-defun}), a special feature of @code{eval-defun} 
     1782overrides any customizations of the face.  This way, the face reflects 
     1783exactly what the @code{defface} says. 
    17621784 
    17631785The purpose of @var{spec} is to specify how the face should appear on 
     
    25072529 
    25082530  This hook is used for automatically assigning faces to text in the 
    2509 buffer.  It is part of the implementation of Font-Lock mode. 
     2531buffer.  It is part of the implementation of Jit-Lock mode, used by 
     2532Font-Lock. 
    25102533 
    25112534@defvar fontification-functions 
     
    32323255displays.  The value of the @code{display} property should be a 
    32333256display specification, or a list or vector containing several display 
    3234 specifications. 
    3235  
    3236   Some kinds of @code{display} properties specify something to display 
    3237 instead of the text that has the property.  In this case, ``the text'' 
    3238 means all the consecutive characters that have the same Lisp object as 
    3239 their @code{display} property; these characters are replaced as a 
    3240 single unit.  By contrast, characters that have similar but distinct 
    3241 Lisp objects as their @code{display} properties are handled 
    3242 separately.  Here's a function that illustrates this point: 
     3257specifications.  Display specifications in the same @code{display} 
     3258property value generally apply in parallel to the text they cover. 
     3259 
     3260  If several sources (overlays and/or a text property) specify values 
     3261for the @code{display} property, only one of the values takes effect, 
     3262following the rules of @code{get-char-property}.  @xref{Examining 
     3263Properties}. 
     3264 
     3265  The rest of this section describes several kinds of 
     3266display specifications and what they mean. 
     3267 
     3268@menu 
     3269* Replacing Specs::      Display specs that replace the text. 
     3270* Specified Space::      Displaying one space with a specified width. 
     3271* Pixel Specification::  Specifying space width or height in pixels. 
     3272* Other Display Specs::  Displaying an image; magnifying text; moving it 
     3273                          up or down on the page; adjusting the width 
     3274                          of spaces within text. 
     3275* Display Margins::     Displaying text or images to the side of the main text. 
     3276@end menu 
     3277 
     3278@node Replacing Specs 
     3279@subsection Display Specs That Replace The Text 
     3280 
     3281  Some kinds of @code{display} specifications specify something to 
     3282display instead of the text that has the property.  These are called 
     3283@dfn{replacing} display specifications.  Emacs does not allow the user 
     3284to interactively move point into the middle of buffer text that is 
     3285replaced in this way. 
     3286 
     3287  If a list of display specifications includes more than one replacing 
     3288display specification, the first overrides the rest.  Replacing 
     3289display specifications make most other display specifications 
     3290irrelevant, since those don't apply to the replacement. 
     3291 
     3292  For replacing display specifications, ``the text that has the 
     3293property'' means all the consecutive characters that have the same 
     3294Lisp object as their @code{display} property; these characters are 
     3295replaced as a single unit.  By contrast, characters that have similar 
     3296but distinct Lisp objects as their @code{display} properties are 
     3297handled separately.  Here's a function that illustrates this point: 
    32433298 
    32443299@smallexample 
     
    32683323  (dotimes (i 5) 
    32693324    (let ((string (concat "A"))) 
    3270       (put-text-property (point) (2+ (point)) 'display string) 
     3325      (put-text-property (point) (+ 2 (point)) 'display string) 
    32713326      (put-text-property (point) (1+ (point)) 'display string) 
    32723327      (forward-char 2)))) 
     
    32793334whether they got this property from a single call to 
    32803335@code{put-text-property} or from two different calls. 
    3281  
    3282   The rest of this section describes several kinds of 
    3283 display specifications and what they mean. 
    3284  
    3285 @menu 
    3286 * Specified Space::      Displaying one space with a specified width. 
    3287 * Pixel Specification::  Specifying space width or height in pixels. 
    3288 * Other Display Specs::  Displaying an image; magnifying text; moving it 
    3289                           up or down on the page; adjusting the width 
    3290                           of spaces within text. 
    3291 * Display Margins::     Displaying text or images to the side of the main text. 
    3292 @end menu 
    32933336 
    32943337@node Specified Space 
     
    35303573@cindex margins, display 
    35313574 
    3532   A buffer can have blank areas called @dfn{display margins} on the left 
    3533 and on the right.  Ordinary text never appears in these areas, but you 
    3534 can put things into the display margins using the @code{display} 
    3535 property. 
    3536  
    3537   To put text in the left or right display margin of the window, use a 
    3538 display specification of the form @code{(margin right-margin)} or 
    3539 @code{(margin left-margin)} on it.  To put an image in a display margin, 
    3540 use that display specification along with the display specification for 
    3541 the image.  Unfortunately, there is currently no way to make 
    3542 text or images in the margin mouse-sensitive. 
    3543  
    3544   If you put such a display specification directly on text in the 
    3545 buffer, the specified margin display appears @emph{instead of} that 
    3546 buffer text itself.  To put something in the margin @emph{in 
    3547 association with} certain buffer text without preventing or altering 
    3548 the display of that text, put a @code{before-string} property on the 
    3549 text and put the display specification on the contents of the 
    3550 before-string. 
     3575  A buffer can have blank areas called @dfn{display margins} on the 
     3576left and on the right.  Ordinary text never appears in these areas, 
     3577but you can put things into the display margins using the 
     3578@code{display} property.  There is currently no way to make text or 
     3579images in the margin mouse-sensitive. 
     3580 
     3581  The way to display something in the margins is to specify it in a 
     3582margin display specification in the @code{display} property of some 
     3583text.  This is a replacing display specification, meaning that the 
     3584text you put it on does not get displayed; the margin display appears, 
     3585but that text does not. 
     3586 
     3587  A margin display specification looks like @code{((margin 
     3588right-margin) @var{spec}} or @code{((margin left-margin) @var{spec})}. 
     3589Here, @var{spec} is another display specification that says what to 
     3590display in the margin.  Typically it is a string of text to display, 
     3591or an image descriptor. 
     3592 
     3593  To display something in the margin @emph{in association with} 
     3594certain buffer text, without altering or preventing the display of 
     3595that text, put a @code{before-string} property on the text and put the 
     3596margin display specification on the contents of the before-string. 
    35513597 
    35523598  Before the display margins can display anything, you must give 
     
    36443690@end defvar 
    36453691 
    3646 @defun  image-type-available-p type 
    3647 @findex image-type-available-p 
    3648  
     3692@defun image-type-available-p type 
    36493693This function returns non-@code{nil} if image type @var{type} is 
    36503694available, i.e., if images of this type can be loaded and displayed in 
     
    42764320@cindex image cache 
    42774321 
    4278   Emacs stores images in an image cache when it displays them, so it can 
    4279 display them again more efficiently.  It removes an image from the cache 
    4280 when it hasn't been displayed for a specified period of time. 
    4281  
    4282 When an image is looked up in the cache, its specification is compared 
    4283 with cached image specifications using @code{equal}.  This means that 
    4284 all images with equal specifications share the same image in the cache. 
     4322  Emacs stores images in an image cache so that it can display them 
     4323again more efficiently.  When Emacs displays an image, it searches the 
     4324image cache for an existing image specification @code{equal} to the 
     4325desired specification.  If a match is found, the image is displayed 
     4326from the cache; otherwise, Emacs loads the image normally. 
     4327 
     4328  Occasionally, you may need to tell Emacs to refresh the images 
     4329associated with a given image specification.  For example, suppose you 
     4330display an image using a specification that contains a @code{:file} 
     4331property.  The image is loaded from the given file and stored in the 
     4332image cache.  If you later display the image again, using the same 
     4333image specification, the image is displayed from the image cache. 
     4334Normally, this is not a problem.  However, if the image file has 
     4335changed in the meantime, Emacs would be displaying the old version of 
     4336the image.  In such a situation, it is necessary to ``refresh'' the 
     4337image using @code{image-refresh}. 
     4338 
     4339@defun image-refresh spec &optional frame 
     4340This function refreshes any images having image specifications 
     4341@code{equal} to @var{spec} on frame @var{frame}.  If @var{frame} is 
     4342@code{nil}, the selected frame is used.  If @var{frame} is @code{t}, 
     4343the refresh is applied to all existing frames. 
     4344 
     4345This works by removing all image with image specifications matching 
     4346@var{spec} from the image cache.  Thus, the next time the image is 
     4347displayed, Emacs will load the image again. 
     4348@end defun 
     4349 
     4350@defun clear-image-cache &optional frame 
     4351This function clears the entire image cache.  If @var{frame} is 
     4352non-@code{nil}, only the cache for that frame is cleared.  Otherwise, 
     4353all frames' caches are cleared. 
     4354@end defun 
     4355 
     4356If an image in the image cache has not been displayed for a specified 
     4357period of time, Emacs removes it from the cache and frees the 
     4358associated memory. 
    42854359 
    42864360@defvar image-cache-eviction-delay 
     
    42934367debugging. 
    42944368@end defvar 
    4295  
    4296 @defun clear-image-cache &optional frame 
    4297 This function clears the image cache.  If @var{frame} is non-@code{nil}, 
    4298 only the cache for that frame is cleared.  Otherwise all frames' caches 
    4299 are cleared. 
    4300 @end defun 
    43014369 
    43024370@node Buttons