[OS X Emacs] fit-frame resizes frames too large in Aquamacs
siemsen at ucar.edu
siemsen at ucar.edu
Wed Oct 21 18:32:49 EDT 2009
I'm using Aquamacs "2.0preview2".
When I open a file, I'd like the frame to automatically resize to fit
the text, as much as possible. I found fit-frame on the web, which
seems exactly what I want. I discovered that it's distributed with
Aquamacs. When I did M-x fit-frame, it resized the frame. Very cool!
Trouble is, it makes the frame wider than needed. I think this is
because I've customized Aquamacs to use a default font height of
"120", while fit-frame uses the height attribute of the "default"
face, which is 130. In other words, in my customizations.el file I have
(custom-set-faces
'(autoface-default ((((type ns)) (:inherit default :height
120 :family "Monaco" :background "#02053c"))))
...but when I evaluate (face-attribute `default :height) I get 130. I
think fit-frame is using 130, hence my frames are resized too large.
Admittedly, I'm guessing a bit here.
To try to fix it, I put this in my Preferences.el:
(set-face-attribute `default nil :height 120)
It didn't work. It doesn't set the value used by fit-frame. Instead,
it seems to set the height of the font of the current frame, not of
the height of the default face.
Am I in the right ballpark?
I have a second problem getting fit-frame to run every time I open a
file, but it's not related to this problem, so I'll post a separate
message about it.
-- Pete
More information about the MacOSX-Emacs
mailing list