emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fit-frame.el for possible inclusion in Emacs


From: Drew Adams
Subject: fit-frame.el for possible inclusion in Emacs
Date: Sun, 30 Dec 2007 19:02:23 -0800

Attached is library `fit-frame.el', for possible inclusion in Emacs.

Command `fit-frame' fits a frame to its buffer(s). See the doc string, in
particular, for the use of a prefix arg. A common use is to fit a one-window
frame to its buffer.

Users can set minimum and maximum width and height limits. Within those
limits, the width of a one-window frame that has been fit accommodates all
of the buffer lines without wrapping, and the height accommodates all of the
buffer lines.

Please give it a try. Let me know, especially, how well it works on
different platforms and with different kinds of buffers. I've tried to take
into account the menu-bar, minibuffer, and tool-bar, and I've tried to
compensate for long header lines in some buffers, such as Dired.

Wrt the last point: header lines can be wrapped in some modes - see option
`fit-frame-skip-header-lines-alist'. In these cases, a header line is
ignored, in order not to let its exceptional length skew the width
measurement. Example: Dired with `dired-details' hiding details - the frame
is only as wide as the longest file-name length, not the directory name in
the header line.

Note too that if a buffer contains faces larger than the default for the
frame, or characters that are extra-wide, then fitting is not perfect. For
example, TAB characters in Info menus can in some cases cause a menu line to
wrap, and likewise for the slightly larger characters of raised buttons in
Customize. This is because the computed size is based only on the frame's
default character size.

Attachment: fit-frame-2007-12-30.el
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]