From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: fit-frame every time i open a file Date: Mon, 15 Oct 2007 11:41:10 -0700 Message-ID: References: <4C1E5B52-22E6-4423-B1DE-2CCFDC134CEE@indigenious.ro> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1192477705 27021 80.91.229.12 (15 Oct 2007 19:48:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 15 Oct 2007 19:48:25 +0000 (UTC) Cc: Peter Dyballa , Help-gnu-emacs@gnu.org To: "Alex Deva" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Oct 15 21:48:15 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 1IhUvg-0002d7-Av for geh-help-gnu-emacs@m.gmane.org; Mon, 15 Oct 2007 20:44:40 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IhUvZ-0007tc-D1 for geh-help-gnu-emacs@m.gmane.org; Mon, 15 Oct 2007 14:44:33 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IhUu4-0007Ma-OY for help-gnu-emacs@gnu.org; Mon, 15 Oct 2007 14:43:00 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IhUu0-0007KS-2R for Help-gnu-emacs@gnu.org; Mon, 15 Oct 2007 14:43:00 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IhUtz-0007KN-WD for Help-gnu-emacs@gnu.org; Mon, 15 Oct 2007 14:42:56 -0400 Original-Received: from rgminet01.oracle.com ([148.87.113.118]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IhUtz-0007Ke-DT for Help-gnu-emacs@gnu.org; Mon, 15 Oct 2007 14:42:55 -0400 Original-Received: from agmgw1.us.oracle.com (agmgw1.us.oracle.com [152.68.180.212]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id l9FIgqnD007216; Mon, 15 Oct 2007 12:42:52 -0600 Original-Received: from acsmt350.oracle.com (acsmt350.oracle.com [141.146.40.150]) by agmgw1.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id l9F7EY8r015902; Mon, 15 Oct 2007 12:42:51 -0600 Original-Received: from dhcp-4op11-4op12-west-130-35-178-158.us.oracle.com by acsmt351.oracle.com with ESMTP id 3293603481192473669; Mon, 15 Oct 2007 11:41:09 -0700 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 In-reply-to: <4C1E5B52-22E6-4423-B1DE-2CCFDC134CEE@indigenious.ro> X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 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:48463 Archived-At: > Sorry Drew, but as I said, I'm more of a beginner. No apology needed. My fault for not noticing 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) 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: 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) Note: If there were additional functions, besides `fit-frame', in `after-make-frame-functions', then there might be a good reason for them to be there. ;-) 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. 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.