diff options
| author | Richard M. Stallman | 2002-12-23 18:13:17 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-12-23 18:13:17 +0000 |
| commit | 31b0520f82b071e5c8a156fe4c08ad8d97d6a94d (patch) | |
| tree | 53a59b48ba93ae28101d78247432b75917b115f7 | |
| parent | 175e9712b72d1a7fe0c21ac8dd3892efa155442b (diff) | |
| download | emacs-31b0520f82b071e5c8a156fe4c08ad8d97d6a94d.tar.gz emacs-31b0520f82b071e5c8a156fe4c08ad8d97d6a94d.zip | |
Explain about conventioal use of t as `invisible' property
and how `add-to-invisibility-spec' protects that.
| -rw-r--r-- | lispref/display.texi | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/lispref/display.texi b/lispref/display.texi index 175456d5559..bc22fd48f17 100644 --- a/lispref/display.texi +++ b/lispref/display.texi | |||
| @@ -339,7 +339,9 @@ text property (@pxref{Text Properties}) or a property of an overlay | |||
| 339 | In the simplest case, any non-@code{nil} @code{invisible} property makes | 339 | In the simplest case, any non-@code{nil} @code{invisible} property makes |
| 340 | a character invisible. This is the default case---if you don't alter | 340 | a character invisible. This is the default case---if you don't alter |
| 341 | the default value of @code{buffer-invisibility-spec}, this is how the | 341 | the default value of @code{buffer-invisibility-spec}, this is how the |
| 342 | @code{invisible} property works. | 342 | @code{invisible} property works. You should normally use @code{t} |
| 343 | as the value of the @code{invisible} property if you don't plan | ||
| 344 | to set @code{buffer-invisibility-spec} yourself. | ||
| 343 | 345 | ||
| 344 | More generally, you can use the variable @code{buffer-invisibility-spec} | 346 | More generally, you can use the variable @code{buffer-invisibility-spec} |
| 345 | to control which values of the @code{invisible} property make text | 347 | to control which values of the @code{invisible} property make text |
| @@ -387,19 +389,23 @@ by a visible newline, it displays an ellipsis. | |||
| 387 | @code{buffer-invisibility-spec} and removing elements from it. | 389 | @code{buffer-invisibility-spec} and removing elements from it. |
| 388 | 390 | ||
| 389 | @defun add-to-invisibility-spec element | 391 | @defun add-to-invisibility-spec element |
| 390 | Add the element @var{element} to @code{buffer-invisibility-spec} | 392 | This function adds the element @var{element} to |
| 391 | (if it is not already present in that list). | 393 | @code{buffer-invisibility-spec} (if it is not already present in that |
| 394 | list). If @code{buffer-invisibility-spec} was @code{t}, it changes to | ||
| 395 | a list, @code{(t)}, so that text whose @code{invisible} property | ||
| 396 | is @code{t} remains invisible. | ||
| 392 | @end defun | 397 | @end defun |
| 393 | 398 | ||
| 394 | @defun remove-from-invisibility-spec element | 399 | @defun remove-from-invisibility-spec element |
| 395 | Remove the element @var{element} from @code{buffer-invisibility-spec}. | 400 | This removeds the element @var{element} from |
| 396 | This does nothing if @var{element} is not in the list. | 401 | @code{buffer-invisibility-spec}. This does nothing if @var{element} |
| 402 | is not in the list. | ||
| 397 | @end defun | 403 | @end defun |
| 398 | 404 | ||
| 399 | One convention about the use of @code{buffer-invisibility-spec} is | 405 | A convention for use of @code{buffer-invisibility-spec} is that a |
| 400 | that a major mode should use the mode's own name as an element of | 406 | major mode should use the mode's own name as an element of |
| 401 | @code{buffer-invisibility-spec} and as the value of the @code{invisible} | 407 | @code{buffer-invisibility-spec} and as the value of the |
| 402 | property: | 408 | @code{invisible} property: |
| 403 | 409 | ||
| 404 | @example | 410 | @example |
| 405 | ;; @r{If you want to display an ellipsis:} | 411 | ;; @r{If you want to display an ellipsis:} |