aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2003-08-06 01:23:14 +0000
committerRichard M. Stallman2003-08-06 01:23:14 +0000
commit8a6ca431c7023784a66b80b696cfdf7ea087b5e7 (patch)
treeb2d56449f842f397999869ec2af272249000c5fc
parent46c7a6f0879c3735b8edac990bf67b59b594f54a (diff)
downloademacs-8a6ca431c7023784a66b80b696cfdf7ea087b5e7.tar.gz
emacs-8a6ca431c7023784a66b80b696cfdf7ea087b5e7.zip
(Warnings): New node, and subnodes.
(Fringes): New node.
-rw-r--r--lispref/display.texi250
1 files changed, 243 insertions, 7 deletions
diff --git a/lispref/display.texi b/lispref/display.texi
index d7ca6b65cbe..6d467f2f63a 100644
--- a/lispref/display.texi
+++ b/lispref/display.texi
@@ -15,6 +15,7 @@ that Emacs presents to the user.
15* Forcing Redisplay:: Forcing redisplay. 15* Forcing Redisplay:: Forcing redisplay.
16* Truncation:: Folding or wrapping long text lines. 16* Truncation:: Folding or wrapping long text lines.
17* The Echo Area:: Where messages are displayed. 17* The Echo Area:: Where messages are displayed.
18* Warnings:: Displaying warning messages for the user.
18* Invisible Text:: Hiding part of the buffer text. 19* Invisible Text:: Hiding part of the buffer text.
19* Selective Display:: Hiding part of the buffer text (the old way). 20* Selective Display:: Hiding part of the buffer text (the old way).
20* Overlay Arrow:: Display of an arrow to indicate position. 21* Overlay Arrow:: Display of an arrow to indicate position.
@@ -23,6 +24,7 @@ that Emacs presents to the user.
23* Width:: How wide a character or string is on the screen. 24* Width:: How wide a character or string is on the screen.
24* Faces:: A face defines a graphics style for text characters: 25* Faces:: A face defines a graphics style for text characters:
25 font, colors, etc. 26 font, colors, etc.
27* Fringes:: Controlling window fringes.
26* Display Property:: Enabling special display features. 28* Display Property:: Enabling special display features.
27* Images:: Displaying images in Emacs buffers. 29* Images:: Displaying images in Emacs buffers.
28* Blinking:: How Emacs shows the matching open parenthesis. 30* Blinking:: How Emacs shows the matching open parenthesis.
@@ -111,10 +113,9 @@ the rightmost column indicates a line that ``wraps'' onto the next line,
111which is also called @dfn{continuing} the line. (The display table can 113which is also called @dfn{continuing} the line. (The display table can
112specify alternative indicators; see @ref{Display Tables}.) 114specify alternative indicators; see @ref{Display Tables}.)
113 115
114@cindex fringes, and line continuation/truncation indicators
115 On a windowed display, the @samp{$} and @samp{\} indicators are 116 On a windowed display, the @samp{$} and @samp{\} indicators are
116replaced with graphics bitmaps displayed on the thin areas right near 117replaced with graphics bitmaps displayed in the window fringes
117the window edges, called the @dfn{fringes}. 118(@pxref{Fringes}).
118 119
119 Note that continuation is different from filling; continuation happens 120 Note that continuation is different from filling; continuation happens
120on the screen only, not in the buffer contents, and it breaks a line 121on the screen only, not in the buffer contents, and it breaks a line
@@ -327,6 +328,194 @@ sequence are echoed immediately.)
327If the value is zero, then command input is not echoed. 328If the value is zero, then command input is not echoed.
328@end defvar 329@end defvar
329 330
331@node Warnings
332@section Reporting Warnings
333@cindex warnings
334
335 @dfn{Warnings} are a facility for a program to inform the user of a
336possible problem, but continue running.
337
338@menu
339* Warning Basics:: Warnings concepts and functions to report them.
340* Warning Variables:: Variables programs bind to customize their warnings.
341* Warning Options:: Variables users set to control display of warnings.
342@end menu
343
344@node Warning Basics
345@subsection Warning Basics
346@cindex severity level
347
348 Every warning has a textual message, which explains the problem for
349the user, and a @dfn{severity level} which is a symbol. Here are the
350possible severity levels, in order of decreasing severity, and their
351meanings:
352
353@table @code
354@item :emergency
355A problem that will seriously impair Emacs operation soon
356if you do not attend to it promptly.
357@item :error
358A report of data or circumstances that are inherently wrong.
359@item :warning
360A report of data or circumstances that are not inherently wrong, but
361raise suspicion of a possible problem.
362@item :debug
363A report of information that may be useful if you are debugging.
364@end table
365
366 When your program encounters invalid input data, it can either
367signal a Lisp error by calling @code{error} or @code{signal} or report
368a warning with severity @code{:error}. Signaling a Lisp error is the
369easiest thing to do, but it means the program cannot continue
370processing. If you want to take the trouble to implement a way to
371continue processing despite the bad data, then reporting a warning of
372severity @code{:error} is the right way to inform the user of the
373problem. For instance, the Emacs Lisp byte compiler can report an
374error that way and continue compiling other functions. (If the
375program signals a Lisp error and then handles it with
376@code{condition-case}, the user won't see the error message; it could
377show the message to the user by reporting it as a warning.)
378
379@cinedex warning type
380 Each warning has a @dfn{warning type} to classify it. The type is a
381list of symbols. The first symbol should be the custom group that you
382use for the program's user options. For example, byte compiler
383warnings use the warning type @code{(bytecomp)}. You can also
384subcategorize the warnings, if you wish, by using more symbols in the
385list.
386
387@defun display-warning type message &optional level buffer-name
388This function reports a warning, using @var{message} as the message
389and @var{type} as the warning type. @var{level} should be the
390severity level, with @code{:warning} being the default.
391
392@var{buffer-name}, if non-@code{nil}, specifies the name of the buffer
393for logging the warning. By default, it is @samp{*Warnings*}.
394@end defun
395
396@defun lwarn type level message &rest args
397This function reports a warning using the value of @code{(format
398@var{message} @var{args}...)} as the message. In other respects it is
399equivalent to @code{display-warning}.
400@end defun
401
402@defun warn message &rest args
403This function reports a warning using the value of @code{(format
404@var{message} @var{args}...)} as the message, @code{(emacs)} as the
405type, and @code{:warning} as the severity level. It exists for
406compatibility only; we recommend not using it, because you should
407specify a specific warning type.
408@end defun
409
410@node Warning Variables
411@subsection Warning Variables
412
413 Programs can customize how their warnings appear by binding
414the variables described in this section.
415
416@defvar warning-levels
417This list defines the meaning and severity order of the warning
418severity levels. Each element defines one severity level,
419and they are arranged in order of decreasing severity.
420
421Each element has the form @code{(@var{level} @var{string}
422@var{function})}, where @var{level} is the severity level it defines.
423@var{string} specifies the textual description of this level.
424@var{string} should use @samp{%s} to specify where to put the warning
425type information, or it can omit the @samp{%s} so as not to include
426that information.
427
428The optional @var{function}, if non-@code{nil}, is a function to call
429with no arguments, to get the user's attention.
430
431Normally you should not change the value of this variable.
432@end defvar
433
434@defvar warning-prefix-function
435If non-@code{nil}, te value is a function to generate prefix text for
436warnings. Programs can bind the variable to a suitable function.
437@code{display-warning} calls this function with the warnings buffer
438current, and the function can insert text in it. That text becomes
439the beginning of the warning message.
440
441The function is called with two arguments, the severity level and its
442entry in @code{warning-levels}. It should return a list to use as the
443entry (this value need not be an actual member of
444@code{warning-levels}). By constructing this value, the function to
445change the severity of the warning, or specify different handling for
446a given severity level.
447
448If the variable's value is @code{nil} then there is no function
449to call.
450@end defvar
451
452@defvar warning-series
453Programs can bind this variable to @code{t} to say that the next
454warning should begin a series. When several warnings form a series,
455that means to leave point on the first warning of the series, rather
456than keep move it for each warning so that it appears on the last one.
457The series ends when the local binding is unbound and
458@code{warning-series} becomes @code{nil} again.
459
460The value can also be a symbol with a function definition. That is
461equivalent to @code{t}, except that the next warning will also call
462the function with no arguments with the warnings buffer current. The
463function can insert text which will serve as a header for the series
464of warnings.
465
466Once a series has begun, the value is a marker which points to the
467buffer position in the warnings buffer of the start of the series.
468
469The variable's normal value is @code{nil}, which means to handle
470each warning separately.
471@end defvar
472
473@defvar warning-fill-prefix
474When this variable is non-@code{nil}, it specifies a fill prefix to
475use for filling each warning's text.
476@end defvar
477
478@defvar warning-type-format
479This variable specifies the format for displaying the warning type
480in the warning message. The result of formatting the type this way
481gets included in the message under the control of the string in the
482entry in @code{warning-levels}. The default value is @code{" (%s)"}.
483If you bind it to @code{""} then the warning type won't appear at
484all.
485@end defvar
486
487@node Warning Options
488@subsection Warning Options
489
490 These variables are used by users to control what happens
491when a Lisp program reports a warning.
492
493@defopt warning-minimum-level
494This user option specifies the minimum severity level that should be
495shown immediately to the user. The default is @code{:warning}, which
496means to immediately display all warnings except @code{:debug}
497warnings.
498@end defopt
499
500@defopt warning-minimum-log-level
501This user option specifies the minimum severity level that should be
502logged in the warnings buffer. The default is @code{:warning}, which
503means to log all warnings except @code{:debug} warnings.
504@end defopt
505
506@defopt warning-suppress-types
507This list specifies which warning types should not be displayed
508immediately for the user. Each element of the list should be a list
509of symbols. If its elements match the first elements in a warning
510type, then that warning is not displayed immediately.
511@end defopt
512
513@defopt warning-suppress-log-types
514This list specifies which warning types should not be logged in the
515warnings buffer. Each element of the list should be a list of
516symbols. If it matches the first few elements in a warning type, then
517that warning is not logged.
518@end defopt
330@node Invisible Text 519@node Invisible Text
331@section Invisible Text 520@section Invisible Text
332 521
@@ -572,7 +761,6 @@ interface to debuggers, the overlay arrow indicates the line of code
572about to be executed. 761about to be executed.
573 762
574@defvar overlay-arrow-string 763@defvar overlay-arrow-string
575@cindex fringe, and overlay arrow display
576This variable holds the string to display to call attention to a 764This variable holds the string to display to call attention to a
577particular line, or @code{nil} if the arrow feature is not in use. 765particular line, or @code{nil} if the arrow feature is not in use.
578On a graphical display the contents of the string are ignored; instead a 766On a graphical display the contents of the string are ignored; instead a
@@ -2287,6 +2475,54 @@ Then, the font specifications for all but Chinese GB2312 characters have
2287Chinese GB2312 characters has a wild card @samp{*} in the @var{family} 2475Chinese GB2312 characters has a wild card @samp{*} in the @var{family}
2288field. 2476field.
2289 2477
2478@node Fringes
2479@section Fringes
2480@cindex Fringes
2481
2482 The @dfn{fringes} of a window are thin vertical strips down the
2483sides that are used for displaying bitmaps that indicate truncation,
2484continuation, and horizontal scrolling, the overlay arrow. The
2485fringes normally appear between the display margins and the window
2486text, but you can put them outside the display margins for a specific
2487buffer by setting @code{fringes-outside-margins} buffer-locally to a
2488non-@code{nil} value.
2489
2490@defvar fringes-outside-margins
2491If the value is non-@code{nil}, the frames appear outside
2492the display margins.
2493@end defvar
2494
2495@defvar left-fringe-width
2496This variable, if non-@code{nil}, specifies the width of the left
2497fringe in pixels.
2498@end defvar
2499
2500@defvar right-fringe-width
2501This variable, if non-@code{nil}, specifies the width of the right
2502fringe in pixels.
2503@end defvar
2504
2505 The values of these variables take effect when you display the
2506buffer in a window. If you change them while the buffer is visible,
2507you can call @code{set-buffer-window} to display it in a window again.
2508
2509@defun set-window-fringes window left &optional right outside-margins
2510This function sets the fringe widthes of window @var{window}.
2511If window is @code{nil}, that stands for the selected window.
2512
2513The argument @var{left} specifies the width in pixels of the left
2514fringe, and likewise @var{right} for the right fringe. A value of
2515@code{nil} for either one stands for the default width. If
2516@var{outside-margins} is non-@code{nil}, that specifies that fringes
2517should appear outside of the display margins.
2518@end defun
2519
2520@defun window-fringes window
2521This function returns information about the fringes of a window
2522@var{window}. The value as the form @code{(@var{left-width}
2523@var{right-width} @var{frames-outside-margins}).
2524@end defun
2525
2290@node Display Property 2526@node Display Property
2291@section The @code{display} Property 2527@section The @code{display} Property
2292@cindex display specification 2528@cindex display specification
@@ -3225,9 +3461,9 @@ buffers that do not override it. @xref{Default Value}.
3225@defopt indicate-empty-lines 3461@defopt indicate-empty-lines
3226@tindex indicate-empty-lines 3462@tindex indicate-empty-lines
3227@cindex fringes, and empty line indication 3463@cindex fringes, and empty line indication
3228When this is non-@code{nil}, Emacs displays a special glyph in 3464When this is non-@code{nil}, Emacs displays a special glyph in the
3229each empty line at the end of the buffer, on terminals that 3465fringe of each empty line at the end of the buffer, on terminals that
3230support it (window systems). 3466support it (window systems). @xref{Fringes}.
3231@end defopt 3467@end defopt
3232 3468
3233@defopt tab-width 3469@defopt tab-width