Next: , Previous: , Up: Temporary Displays   [Index]


H.1.3 Changing the Size of a Temporary Buffer Window

A window showing a temporary buffer can be fitted to the size of that buffer using the following mode:

Minor mode: temp-buffer-resize-mode

When this minor mode is enabled, windows showing a temporary buffer are automatically resized to fit their buffer’s contents.

A window is resized if and only if it has been specially created for the buffer.

By default, this mode uses fit-window-to-buffer (see Resizing Windows) for resizing. You can specify a different function by customizing the options

  • temp-buffer-max-height and
  • temp-buffer-max-width.
User option: temp-buffer-max-height

This option specifies the maximum height (in lines) of a window displaying a temporary buffer when temp-buffer-resize-mode is enabled.

It can also be a function to be called to choose the height for such a buffer. It gets one argument, the buffer, and should return a positive integer.

User option: temp-buffer-max-width

This option specifies the maximum width of a window (in columns) displaying a temporary buffer when temp-buffer-resize-mode is enabled.

It can also be a function to be called to choose the width for such a buffer. It gets one argument, the buffer, and should return a positive integer.