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: Tue, 16 Oct 2007 10:15:35 +0300 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1192519973 5944 80.91.229.12 (16 Oct 2007 07:32:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Oct 2007 07:32:53 +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 Tue Oct 16 09:32:44 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 1Ihguy-0004gR-0M for geh-help-gnu-emacs@m.gmane.org; Tue, 16 Oct 2007 09:32:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ihgur-0000ic-2r for geh-help-gnu-emacs@m.gmane.org; Tue, 16 Oct 2007 03:32:37 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IhgtY-0008ER-Sm for help-gnu-emacs@gnu.org; Tue, 16 Oct 2007 03:31:17 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IhgtU-0008C6-3L for Help-gnu-emacs@gnu.org; Tue, 16 Oct 2007 03:31:16 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IhgtT-0008C3-Tb for Help-gnu-emacs@gnu.org; Tue, 16 Oct 2007 03:31:11 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IhgtT-0005zf-GS for Help-gnu-emacs@gnu.org; Tue, 16 Oct 2007 03:31:11 -0400 Original-Received: from nf-out-0910.google.com ([64.233.182.187]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ihgec-0004qb-1W for Help-gnu-emacs@gnu.org; Tue, 16 Oct 2007 03:15:51 -0400 Original-Received: by nf-out-0910.google.com with SMTP id f5so1632106nfh for ; Tue, 16 Oct 2007 00:15:42 -0700 (PDT) Original-Received: by 10.86.95.20 with SMTP id s20mr5636070fgb.1192518942363; Tue, 16 Oct 2007 00:15:42 -0700 (PDT) Original-Received: from ?192.168.0.19? ( [86.120.51.9]) by mx.google.com with ESMTPS id e32sm9590716fke.2007.10.16.00.15.40 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 16 Oct 2007 00:15:40 -0700 (PDT) In-Reply-To: X-Priority: 3 (Normal) X-Mailer: Apple Mail (2.752.3) X-detected-kernel: by mx20.gnu.org: Linux 2.6 (newer, 2) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:48477 Archived-At: 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