unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Alex Deva <alxx@indigenious.ro>
To: "Drew Adams" <drew.adams@oracle.com>
Cc: Help-gnu-emacs@gnu.org
Subject: Re: fit-frame every time i open a file
Date: Tue, 16 Oct 2007 10:15:35 +0300	[thread overview]
Message-ID: <CCBBCED4-CB1E-4599-A99E-52077149D893@indigenious.ro> (raw)
In-Reply-To: <DNEMKBNJBGPAOPIJOOICKEKBEAAA.drew.adams@oracle.com>


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	other threads:[~2007-10-16  7:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-15 13:07 fit-frame every time i open a file alxx
2007-10-15 15:45 ` Drew Adams
2007-10-15 16:13   ` alxx
2007-10-15 17:02     ` Drew Adams
2007-10-15 17:44     ` Peter Dyballa
2007-10-15 18:15       ` Drew Adams
2007-10-15 18:23         ` Alex Deva
2007-10-15 18:41           ` Drew Adams
2007-10-15 20:12             ` Alex Deva
2007-10-15 20:54               ` Drew Adams
2007-10-16  7:15                 ` Alex Deva [this message]
2007-10-16 14:18                   ` Drew Adams
2007-10-16  8:44               ` Peter Dyballa
     [not found]             ` <mailman.2101.1192479183.18990.help-gnu-emacs@gnu.org>
2007-10-21  7:57               ` David Reitter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CCBBCED4-CB1E-4599-A99E-52077149D893@indigenious.ro \
    --to=alxx@indigenious.ro \
    --cc=Help-gnu-emacs@gnu.org \
    --cc=drew.adams@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).