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: Alex Deva
Subject: Re: fit-frame every time i open a file
Date: Tue, 16 Oct 2007 10:15:35 +0300


On Oct 15, 2007, at 11:54 PM, Drew Adams wrote:

`M-:' means hold the Meta key (probably the Alt key) pressed while you hit `:'. It is bound to command `pp-eval-expression', which lets you type a Lisp
expression to evaluate.


Thanks. I wouldn't have gotten very far without knowing the basic emacs keystroke conventions, and definitely not this far. :) I just didn't know that `pp-eval-expression' was bound to a particular keystroke.


FYI - You can use `C-h f' to describe any function. The *Help* buffer
showing the description usually tells you what file it is defined in and
provides a link to its definition.

Another keystroke I didn't know. This is what I get in the *Help* buffer:

set-mode-style-after-make-frame is a Lisp function in `aquamacs- styles.el'.
(set-mode-style-after-make-frame frame)

Not documented.


So obviously Aquamacs-specific code.



If `after-make-frame-functions' has value (fit-frame), then `fit- frame'
should be called. You can do this to see if it is called:

M-x debug-on-entry RET fit-frame RET

I activated up the debugger, then opened a new file and the debugger didn't start, probably meaning that `fit-frame' never got called. I double-checked and `after-make-frame-functions' indeed had the value (fit-frame). I suppose this means that the problem is Aquamacs ignoring this call...?

Again, however, I doubt that it is getting called at all, since calling it
manually does resize the frame correctly.


You seem to be right there.


If `fit-frame' is called, you can also try stepping through it in the
debugger (`d') to see what it is doing. Why it might do something wrong when called in a hook and when called manually is unclear. I doubt that that is
what's happening - I suspect that it is not called from the hook.


Is there any way I can debug the hook itself, and maybe see why it doesn't call `fit-frame'?


The things you need to determine for sure are these:

1. Whether `fit-frame' gets called as an after-make-frame function.

It doesn't seem to get called.

2. Exactly what changes if you have short or long lines.

That must've been my fault -- I expressed myself poorly (sorry, I'm not a native English speaker). When I call `fit-frame' manually, the frame is correctly resized to smaller if the lines are shorter than the current edge (within minimum limits), and bigger if the lines are soft-wrapped (also within maximum limits). I don't think that the problem is anywhere inside `fit-frame'.


If `fit-frame' is not called by the hook, then I cannot help you. If it is
called but it doesn't DTRT, then I can try to help.


That makes perfect sense and thank you again for your help so far. However, let me ask again, perhaps I might debug the hook itself and see what it's calling and what it's not? Is there a way to do this?

Thanks,

  Alex





reply via email to

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