[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Automatically shrink-wrapping frames to fit their selected window
From: |
Drew Adams |
Subject: |
Automatically shrink-wrapping frames to fit their selected window |
Date: |
Fri, 7 May 2004 15:48:40 -0700 |
I have some elisp code that does the following:
- Library shrink-fit.el lets you shrink-wrap (enlarge or shrink) a frame on
demand, to fit the content of its selected window (within user-defined
limits).
- Library shrink-fit-all.el provides automatic shrink-wrapping of
one-window frames (one-window-p).
The latter redefines pop-to-buffer, display-buffer, and switch-to-buffer to
call a shrink-wrap function at the end. User variables control whether each
of these low-level functions, separately, should in fact resize frames.
I've updated the code so that it works in Emacs 21 (21.3.50.1
i386-mingw-nt5.1.2600), as well as Emacs 20.
The code and documentation are available here:
- code: http://www.emacswiki.org/elisp/shrink-fit.el,
http://www.emacswiki.org/elisp/shrink-fit-all.el
- doc:
http://www.emacswiki.org/cgi-bin/wiki/OneOnOneEmacs#Shrink-Wrapping_Frames
Please try it out, and consider incorporating it into Emacs at some point. I
believe it would help make Emacs more frame-oriented.
Thanks,
Drew
P.S. I have not tried this code with images or a mixture of font sizes. I
imagine that some tweaking might be necessary to accomodate these (?). The
current resizing code uses set-frame-size. It counts lines and measures
maximum line-width (in characters) to determine the needed frame height
(lines) and width (cols). Suggestions are welcome.
- Automatically shrink-wrapping frames to fit their selected window,
Drew Adams <=