From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Mickey Ferguson" Newsgroups: gmane.emacs.help Subject: window alignment at startup Date: Wed, 10 Jul 2013 14:22:32 -0700 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1373491430 19271 80.91.229.3 (10 Jul 2013 21:23:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 10 Jul 2013 21:23:50 +0000 (UTC) To: Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 10 23:23:51 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ux1ra-0007aV-KB for geh-help-gnu-emacs@m.gmane.org; Wed, 10 Jul 2013 23:23:50 +0200 Original-Received: from localhost ([::1]:55413 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ux1ra-0004ht-5q for geh-help-gnu-emacs@m.gmane.org; Wed, 10 Jul 2013 17:23:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41886) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ux1qY-0004Xz-3d for help-gnu-emacs@gnu.org; Wed, 10 Jul 2013 17:22:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ux1qS-0001XR-Rq for help-gnu-emacs@gnu.org; Wed, 10 Jul 2013 17:22:46 -0400 Original-Received: from mail.plantcml-eads.com ([67.151.52.7]:38881 helo=cassidiancommunications.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ux1qS-0001XH-JV for help-gnu-emacs@gnu.org; Wed, 10 Jul 2013 17:22:40 -0400 Original-Received: from ([172.16.4.102]) by mail.cassidiancommunications.com with ESMTP id 8YS9KF1.23838942; Wed, 10 Jul 2013 14:22:34 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 x-cr-puzzleid: {5E8C1EAB-04FF-432B-B820-6084249E5869} x-cr-hashedpuzzle: 53s= Aq9T A1+u BEmS BXZs BmUQ DI66 DUws D28i F1X8 F4Tv Gq1K GzZL G7A3 HzyP KPJH; 1; aABlAGwAcAAtAGcAbgB1AC0AZQBtAGEAYwBzAEAAZwBuAHUALgBvAHIAZwA=; Sosha1_v1; 7; {5E8C1EAB-04FF-432B-B820-6084249E5869}; bQBpAGMAawBlAHkALgBmAGUAcgBnAHUAcwBvAG4AQABjAGEAcwBzAGkAZABpAGEAbgBjAG8AbQBtAHUAbgBpAGMAYQB0AGkAbwBuAHMALgBjAG8AbQA=; Wed, 10 Jul 2013 21:22:32 GMT; dwBpAG4AZABvAHcAIABhAGwAaQBnAG4AbQBlAG4AdAAgAGEAdAAgAHMAdABhAHIAdAB1AHAA Content-class: urn:content-classes:message X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: window alignment at startup Thread-Index: Ac59s5bCW87jPqlwQFy3DQNe0EzEGQ== X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 67.151.52.7 X-Mailman-Approved-At: Wed, 10 Jul 2013 17:23:39 -0400 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:92043 Archived-At: I've coded the following function which works perfectly after a window is already in existence: =20 (defun align-window () "fix window positioning" (interactive) (set-frame-position (selected-frame) (if (equal (getenv "emacs_alignment") "right") -1 0) 0) ) =20 If I have the emacs_alignment environment variable defined and set to "right", it aligns the window to the right edge of my screen. Otherwise, it left-aligns it. The problem arises if I have (align-window) in my .emacs. If it's not set to "right", it properly left-aligns, but if it's set to "right", it aligns it to some point near the right edge, but not really there. After emacs is fully loaded and running, if I use M-x align-window, it works properly. Note that my .emacs results in setting a different font, which causes the window size to change. =20 OK, to boil it down: I want to execute this function as the last thing emacs does before it's done - after loading the file(s), etc. How do I do this? Replies directly to my email (Mickey.Ferguson - at - cassidiancommunications - dot - com), since my work doesn't allow for newsgroup access. =20 Thanks for any help you can provide!