From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alex Deva Newsgroups: gmane.emacs.help Subject: Re: fit-frame every time i open a file Date: Mon, 15 Oct 2007 23:12:46 +0300 Message-ID: <3575DEDA-88CF-442C-BE9D-1AB1A5E84383@indigenious.ro> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: multipart/mixed; boundary="===============2034454618==" X-Trace: ger.gmane.org 1192482259 11658 80.91.229.12 (15 Oct 2007 21:04:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 15 Oct 2007 21:04:19 +0000 (UTC) Cc: Help-gnu-emacs@gnu.org To: "Drew Adams" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Oct 15 23:04:10 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IhWJZ-0006Hb-Uj for geh-help-gnu-emacs@m.gmane.org; Mon, 15 Oct 2007 22:13:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IhWJS-000389-Tz for geh-help-gnu-emacs@m.gmane.org; Mon, 15 Oct 2007 16:13:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IhWJA-00037z-U1 for help-gnu-emacs@gnu.org; Mon, 15 Oct 2007 16:13:01 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IhWJ6-00037Z-4p for Help-gnu-emacs@gnu.org; Mon, 15 Oct 2007 16:13:00 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IhWJ5-00037W-Sn for Help-gnu-emacs@gnu.org; Mon, 15 Oct 2007 16:12:55 -0400 Original-Received: from nf-out-0910.google.com ([64.233.182.186]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IhWJ5-0004ab-79 for Help-gnu-emacs@gnu.org; Mon, 15 Oct 2007 16:12:55 -0400 Original-Received: by nf-out-0910.google.com with SMTP id f5so1494152nfh for ; Mon, 15 Oct 2007 13:12:53 -0700 (PDT) Original-Received: by 10.86.51.2 with SMTP id y2mr5223402fgy.1192479173525; Mon, 15 Oct 2007 13:12:53 -0700 (PDT) Original-Received: from ?192.168.0.19? ( [86.120.51.9]) by mx.google.com with ESMTPS id d13sm8625348fka.2007.10.15.13.12.50 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 15 Oct 2007 13:12:51 -0700 (PDT) In-Reply-To: X-Priority: 3 (Normal) X-Mailer: Apple Mail (2.752.3) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:48466 Archived-At: --===============2034454618== Content-Type: multipart/alternative; boundary=Apple-Mail-8--576398352 --Apple-Mail-8--576398352 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On Oct 15, 2007, at 9:41 PM, Drew Adams wrote: >> Sorry Drew, but as I said, I'm more of a beginner. > > No apology needed. My fault for not noticing that. I actually take pride in that :) > >> I saved the two libraries you recommended, and then loaded both >> manually with load-file. So... what now? I can't call add-hook from >> inside emacs (or I don't know how). What am I supposed to do from >> this point on? How do I test the hook? > > After you load the *.el files with `load-file', do this (mentioned > in the > file Commentary): > > M-: (add-hook 'after-make-frame-functions 'fit-frame) > I added the hook manually (I honestly didn't know about M-: because I'm not a LISP programmer, though it's on my list) and the effect was this: any file I opened came up in a frame exactly the same dimensions as the current frame (which, as it happens, had been fit- framed). The dimensions of the new frames are now irrespective of the frame best fit (i.e., if I manually call fit-frame, the frame resizes). However, if I resize the current window by dragging its corner (Aquamacs lets you do that), then the files I subsequently open still have the same dimensions that the current window originally had. In other words, width/height seem to have been frozen when I added the hook, somehow. > If that doesn't fix the problem, then take a look at the value of > `after-make-frame-functions'. If it contains more than just `fit- > frame', try > setting it to nil (empty) and then adding `fit-frame' back again: > Taking a look at the variable in question, I get this: (fit-frame set-mode-style-after-make-frame) A quick grep showed that the second call has nothing to do with either of your two libraries. I don't know how to look it up inside emacs to see where it comes from. :( > M-: (setq after-make-frame-functions nil) > M-: (add-hook 'after-make-frame-functions 'fit-frame) > > The result should then be this: > > C-h v after-make-frame-functions ==> (fit-frame) > OK. Now again nothing happens when I open new files. They seem to open with the default width/height and are resized to best fit when I call fit-frame manually. > The above procedure is just to try to see if `fit-frame' does the > right > thing at least when there are no other `after-make-frame-functions' > present. > If it does, then there is likely interference among those > functions. In that > case, you can try (starting with an empty list) adding them all > back, in > different orders (e.g. try `fit-frame' first or last), to see if > that helps. > You get the idea. Thank you, I do, but since the test failed, I don't see the point in reversing the order of the only 2 functions that were hooked... > > But see my previous reply about long lines. It sounds like this > might just > be unrealistic expectations on your part. `fit-frame' makes the > frame as > wide as its longest line, but it respects maximum limits that you > can set. > See the `fit-frame' doc string. I read everything you write carefully. I know (empirically) what fit- frame does and what it doesn't do, and we're not having a case of enforced line width limits (besides, those are accessible as configuration parameters within Aquamacs -- one of the reasons I thought fit-frame would be better integrated). Given this new information, is there anything else I could try? The problem started off pretty simple, but now seems to be getting hairier... Aquamacs support is rather scarce, and I'm surprised to discover that nobody from their team is on this list also. Thank you for your support so far, Alex --Apple-Mail-8--576398352 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=ISO-8859-1
On Oct 15, 2007, = at 9:41 PM, Drew Adams wrote:

Sorry Drew, but as I said, I'm = more of a beginner.

No apology needed. My fault for = not noticing that.

I actually take pride in = that :)


I saved the two libraries you recommended, and then = loaded both
manually with load-file. So... = what now? I can't call add-hook from
inside emacs = (or I don't know how). What am I supposed to do from
this point on? How do I test the hook?
=

After you load the *.el files with `load-file', do = this (mentioned in the
file Commentary):

M-: = (add-hook 'after-make-frame-functions 'fit-frame)


I added the hook manually = (I honestly didn't know about M-: because I'm not a LISP programmer, = though it's on my list) and the effect was this: any file I opened came = up in a frame=A0exactly the same dimensions=A0as the current = frame (which, as it happens, had been fit-framed). The dimensions of the = new frames are now irrespective of the frame best fit (i.e., if I = manually call fit-frame, the frame resizes).

However, if I resize the = current window by dragging its corner (Aquamacs lets you do that), then = the files I subsequently open still have the same dimensions that the = current window originally had. In other words, width/height seem to have = been frozen when I added the hook, somehow.

If that doesn't fix the problem, then take a look at = the value of
`after-make-frame-functions'. If = it contains more than just `fit-frame', try
setting = it to nil (empty) and then adding `fit-frame' back again:


Taking a look at the = variable in question, I get this:

(fit-frame = set-mode-style-after-make-frame)

A quick grep showed that = the second call has nothing to do with either of your two libraries. I = don't know how to look it up inside emacs to see where it comes from. = :(

M-: (setq = after-make-frame-functions nil)
M-: (add-hook = 'after-make-frame-functions 'fit-frame)

The result = should then be this:
C-h v after-make-frame-functions = =3D=3D> (fit-frame)
OK.

Now again nothing happens = when I open new files. They seem to open with the default width/height = and are resized to best fit when I call fit-frame = manually.


The above procedure is just = to try to see if `fit-frame' does the right
thing = at least when there are no other `after-make-frame-functions' = present.
If it does, then there is likely = interference among those functions. In that
case, = you can try (starting with an empty list) adding them all back, = in
different orders (e.g. try `fit-frame' first or = last), to see if that helps.
You get the = idea.

Thank you, I do, but since = the test failed, I don't see the point in reversing the order of the = only 2 functions that were hooked...


But see my previous reply about long lines. It = sounds like this might just
be = unrealistic expectations on your part. `fit-frame' makes the frame = as
wide as its longest line, but it respects = maximum limits that you can set.
See the = `fit-frame' doc string.

I read everything you write = carefully. I know (empirically) what fit-frame does and what it doesn't = do, and we're not having a case of enforced line width limits (besides, = those are accessible as configuration parameters within Aquamacs -- one = of the reasons I thought fit-frame would be better = integrated).

Given this new information, = is there anything else I could try? The problem started off pretty = simple, but now seems to be getting hairier... Aquamacs support is = rather scarce, and I'm surprised to discover that nobody from their team = is on this list also.

Thank you for your support = so far,

=A0 = Alex



= --Apple-Mail-8--576398352-- --===============2034454618== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ help-gnu-emacs mailing list help-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-emacs --===============2034454618==--