diff options
| author | Martin Rudalics | 2016-03-25 08:30:23 +0100 |
|---|---|---|
| committer | Martin Rudalics | 2016-03-25 08:30:23 +0100 |
| commit | a1cd84cffcca020e8cff88c7a5633e8d5a2d417e (patch) | |
| tree | fc063da2551ebe4f104af9293c2727fa38ea2e10 | |
| parent | 5ec105648b4695ef3fa159cad2fedcd31e62337a (diff) | |
| download | emacs-a1cd84cffcca020e8cff88c7a5633e8d5a2d417e.tar.gz emacs-a1cd84cffcca020e8cff88c7a5633e8d5a2d417e.zip | |
Describe temporary displays in Emacs manual
* doc/emacs/emacs.texi (Temporary Displays): New subsubsection.
* doc/emacs/windows.texi (Window Choice): Minor fixes.
(Temporary Displays): New subsubsection describing display of
temporary buffers and `temp-buffer-resize-mode'.
| -rw-r--r-- | doc/emacs/emacs.texi | 1 | ||||
| -rw-r--r-- | doc/emacs/windows.texi | 64 |
2 files changed, 62 insertions, 3 deletions
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index dc99d493241..c23c96f0745 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi | |||
| @@ -519,6 +519,7 @@ Multiple Windows | |||
| 519 | * Pop Up Window:: Finding a file or buffer in another window. | 519 | * Pop Up Window:: Finding a file or buffer in another window. |
| 520 | * Change Window:: Deleting windows and changing their sizes. | 520 | * Change Window:: Deleting windows and changing their sizes. |
| 521 | * Displaying Buffers:: How Emacs picks a window for displaying a buffer. | 521 | * Displaying Buffers:: How Emacs picks a window for displaying a buffer. |
| 522 | * Temporary Displays:: Displaying non-editable buffers. | ||
| 522 | * Window Convenience:: Convenience functions for window handling. | 523 | * Window Convenience:: Convenience functions for window handling. |
| 523 | 524 | ||
| 524 | Displaying a Buffer in a Window | 525 | Displaying a Buffer in a Window |
diff --git a/doc/emacs/windows.texi b/doc/emacs/windows.texi index f99234b5c1b..e40162031f3 100644 --- a/doc/emacs/windows.texi +++ b/doc/emacs/windows.texi | |||
| @@ -374,6 +374,7 @@ Several of these commands are bound in the @kbd{C-x 5} prefix key. | |||
| 374 | 374 | ||
| 375 | @menu | 375 | @menu |
| 376 | * Window Choice:: How @code{display-buffer} works. | 376 | * Window Choice:: How @code{display-buffer} works. |
| 377 | * Temporary Displays:: Displaying non-editable buffers. | ||
| 377 | @end menu | 378 | @end menu |
| 378 | 379 | ||
| 379 | @node Window Choice | 380 | @node Window Choice |
| @@ -411,15 +412,15 @@ By default, this step is skipped. To enable it, change the variable | |||
| 411 | @code{graphic-only} means to do this only on graphical displays. | 412 | @code{graphic-only} means to do this only on graphical displays. |
| 412 | 413 | ||
| 413 | @item | 414 | @item |
| 414 | Otherwise, try to create a new window by splitting the selected | 415 | Otherwise, try to create a new window by splitting a window on the |
| 415 | window, and display the buffer in that new window. | 416 | selected frame, and display the buffer in that new window. |
| 416 | 417 | ||
| 417 | @vindex split-height-threshold | 418 | @vindex split-height-threshold |
| 418 | @vindex split-width-threshold | 419 | @vindex split-width-threshold |
| 419 | The split can be either vertical or horizontal, depending on the | 420 | The split can be either vertical or horizontal, depending on the |
| 420 | variables @code{split-height-threshold} and | 421 | variables @code{split-height-threshold} and |
| 421 | @code{split-width-threshold}. These variables should have integer | 422 | @code{split-width-threshold}. These variables should have integer |
| 422 | values. If @code{split-height-threshold} is smaller than the selected | 423 | values. If @code{split-height-threshold} is smaller than the chosen |
| 423 | window's height, the split puts the new window below. Otherwise, if | 424 | window's height, the split puts the new window below. Otherwise, if |
| 424 | @code{split-width-threshold} is smaller than the window's width, the | 425 | @code{split-width-threshold} is smaller than the window's width, the |
| 425 | split puts the new window on the right. If neither condition holds, | 426 | split puts the new window on the right. If neither condition holds, |
| @@ -427,6 +428,12 @@ Emacs tries to split so that the new window is below---but only if the | |||
| 427 | window was not split before (to avoid excessive splitting). | 428 | window was not split before (to avoid excessive splitting). |
| 428 | 429 | ||
| 429 | @item | 430 | @item |
| 431 | Otherwise, display the buffer in a window previously showing it. | ||
| 432 | Normally, only windows on the selected frame are considered, but if | ||
| 433 | @code{pop-up-frames} is non-@code{nil} the window may be also on another | ||
| 434 | frame. | ||
| 435 | |||
| 436 | @item | ||
| 430 | Otherwise, display the buffer in an existing window on the selected | 437 | Otherwise, display the buffer in an existing window on the selected |
| 431 | frame. | 438 | frame. |
| 432 | 439 | ||
| @@ -435,6 +442,57 @@ If all the above methods fail for whatever reason, create a new frame | |||
| 435 | and display the buffer there. | 442 | and display the buffer there. |
| 436 | @end itemize | 443 | @end itemize |
| 437 | 444 | ||
| 445 | A more advanced and flexible way to customize the behavior of | ||
| 446 | @code{display-buffer} is by using the option @code{display-buffer-alist} | ||
| 447 | mentioned in the next section. | ||
| 448 | |||
| 449 | |||
| 450 | @node Temporary Displays | ||
| 451 | @subsection Displaying non-editable buffers. | ||
| 452 | |||
| 453 | Some buffers are shown in windows for perusal rather than for editing. | ||
| 454 | Help commands (@pxref{Help}) typically use a buffer called @file{*Help*} | ||
| 455 | for that purpose, minibuffer completion (@pxref{Completion}) uses a | ||
| 456 | buffer called @file{*Completions*} instead. Such buffers are usually | ||
| 457 | displayed only for a short period of time. | ||
| 458 | |||
| 459 | Normally, Emacs chooses the window for such temporary displays via | ||
| 460 | @code{display-buffer} as described above. The @file{*Completions*} | ||
| 461 | buffer, on the other hand, is preferably displayed in a window at the | ||
| 462 | bottom of the selected frame, regardless of the number of windows | ||
| 463 | already shown on that frame. | ||
| 464 | |||
| 465 | If you prefer Emacs to display a temporary buffer in a different | ||
| 466 | fashion, the recommended approach is to customize the variable | ||
| 467 | @code{display-buffer-alist} (@pxref{Choosing Window,,Choosing a Window | ||
| 468 | for Display, elisp, The Emacs Lisp Reference Manual}). For example, to | ||
| 469 | display @file{*Completions*} by splitting a window as described in the | ||
| 470 | previous section, use the following form in your initialization file | ||
| 471 | (@pxref{Init File}): | ||
| 472 | |||
| 473 | @example | ||
| 474 | @group | ||
| 475 | (customize-set-variable | ||
| 476 | 'display-buffer-alist | ||
| 477 | '(("\\*Completions\\*" display-buffer-pop-up-window))) | ||
| 478 | @end group | ||
| 479 | @end example | ||
| 480 | |||
| 481 | The @file{*Completions*} buffer is also special in the sense that | ||
| 482 | Emacs usually tries to make its window just as large as to display all | ||
| 483 | of its contents. To resize windows showing other temporary displays | ||
| 484 | like, for example, the @file{*Help*} buffer accordingly, you have to | ||
| 485 | explicitly invoke the minor mode (@pxref{Minor Modes}) | ||
| 486 | @code{temp-buffer-resize-mode} (@pxref{Temporary Displays,,Temporary | ||
| 487 | Displays, elisp, The Emacs Lisp Reference Manual}). | ||
| 488 | |||
| 489 | The maximum size of windows resized by @code{temp-buffer-resize-mode} | ||
| 490 | can be controlled by customizing the options | ||
| 491 | @code{temp-buffer-max-height} and @code{temp-buffer-max-width} | ||
| 492 | (@pxref{Temporary Displays,,Temporary Displays, elisp, The Emacs Lisp | ||
| 493 | Reference Manual}) and cannot exceed the size of the containing frame. | ||
| 494 | |||
| 495 | |||
| 438 | @node Window Convenience | 496 | @node Window Convenience |
| 439 | @section Convenience Features for Window Handling | 497 | @section Convenience Features for Window Handling |
| 440 | 498 | ||