help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: fit-frame every time i open a file


From: David Reitter
Subject: Re: fit-frame every time i open a file
Date: Sun, 21 Oct 2007 00:57:59 -0700
User-agent: G2/1.0

On Oct 15, 9:12 pm, Alex Deva <address@hidden> wrote:

> Given this new information, is there anything else I could try? The
> problem started off pretty simple, but now seems to be getting
> hairier...

(I presume you run one-buffer-one-frame-mode, that is, "Display
Buffers in Separate Frames" is on in the Options menu.)

To fit a frame, the `fit-frame' function needs to see the buffer
contents.

When you type C-x C-f, a new frame is opened, and then you are allowed
to enter the name of the file to be loaded. This means that the `after-
make-frame-functions' are run _before_ the file is loaded. The  idea
of using `after-make-frame-functions' is thus a kludge: it assumes
that the frame is created after the file has been loaded. This is easy
to see if you actually watch watch's happening when you press C-x C-f.
As further hint: `fit-frame' works fine when you find files from the
"Recent Files" menu.

If you enter C-h k C-x C-f, you find that C-x C-f is bound to
`aquamacs-find-file' in Aquamacs. That's something we can leverage.
So, my solution is this (in addition to the code Drew suggested):

(defadvice aquamacs-find-file (after fit activate)
  (fit-frame))

if you add that to your ~/Library/Preferences/Aquamacs Emacs/
Preferences.el, `fit-frame' is called after each (interactive)
aquamacs-find-file operation.

Does that work for you?

Maybe we'll add an option for users to easily enable frame fitting in
such a situation - I think that'd be nice.

> Aquamacs support is rather scarce, and I'm surprised to
> discover that nobody from their team is on this list also.

Can you substantiate that? What else have you tried with respect to
support? Notice the support options on the website.

--
http://aquamacs.org -- Aquamacs: Emacs on Mac OS X
http://aquamacs.org/donate -- Could we help you? Return the favor and
support the Aquamacs Project!



reply via email to

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