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: RE: Trying to right-align my window on startup Date: Sat, 11 Jan 2014 01:17:22 +0000 Message-ID: References: <83r48idw6z.fsf@gnu.org> <83mwj5ekrs.fsf@gnu.org> <28ab7799-fdc5-47c4-9ac0-f7db66771e7e@default> <65e69797-8a7c-4d94-99c3-87d5a3c3ade6@default> 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 1389403064 29056 80.91.229.3 (11 Jan 2014 01:17:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 11 Jan 2014 01:17:44 +0000 (UTC) To: Drew Adams , "Emacs Help (help-gnu-emacs@gnu.org)" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jan 11 02:17:51 2014 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 1W1nCw-0003jX-Oh for geh-help-gnu-emacs@m.gmane.org; Sat, 11 Jan 2014 02:17:50 +0100 Original-Received: from localhost ([::1]:59726 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1nCv-00007c-W2 for geh-help-gnu-emacs@m.gmane.org; Fri, 10 Jan 2014 20:17:49 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56351) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1nCg-00006M-1Z for help-gnu-emacs@gnu.org; Fri, 10 Jan 2014 20:17:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W1nCa-0004kD-1W for help-gnu-emacs@gnu.org; Fri, 10 Jan 2014 20:17:33 -0500 Original-Received: from mail.plantcml-eads.com ([67.151.52.7]:20787 helo=cassidiancommunications.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1nCZ-0004jG-PA for help-gnu-emacs@gnu.org; Fri, 10 Jan 2014 20:17:27 -0500 Original-Received: from ([172.16.4.12]) by mail.cassidiancommunications.com with ESMTP with TLS id 8YS9KF1.26475076; Fri, 10 Jan 2014 17:17:23 -0800 Original-Received: from TEMCAS01.peinet.peinc.com ([::1]) by TEMCAS01.peinet.peinc.com ([::1]) with mapi id 14.02.0387.000; Fri, 10 Jan 2014 17:17:23 -0800 Thread-Topic: Trying to right-align my window on startup Thread-Index: AQHPDLdlRbFj07j3V0q8XEvV7E9P1Zp8c0CAgAA3FHCAALYrgIABK7kwgACShAD//4TyEA== In-Reply-To: <65e69797-8a7c-4d94-99c3-87d5a3c3ade6@default> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.16.10.30] X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 67.151.52.7 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:95355 Archived-At: >> I can't figure out how or where to place it so that it executes _and=20 >> works properly. I put it my MF-Init.el file that is loaded upon=20 >> startup. >Replace that file with one that does _only_ what you are testing. >Adding something untested to a giant sack of eels is not the way to test t= hat something. (No, I cannot know >that MF-Init.el is a sack of eels. Jus= t a hunch.) Yes, it is a sack of eels. :-) It's been building up for at least 20 year= s... most of which I added stuff based on recommendations from others, not = really knowing fully what I was doing. When it comes to elisp, I'm not usu= ally even competent enough to be dangerous. =20 >According to your code, that could happen if the `selected-frame' >is not what you think it is. Try adding a `message' call that tells >you what the selected frame is, and its displayed buffer etc. >IOW, find out what is going on. I'm afraid I don't even know how to do this, or even what it means to diffe= rentiate between frames. But I have made some progress, using your isolati= on approach. Here is a very pared down file I'm calling minimal.el. I've narrowed it al= l down to the call to set-frame-font within big-font-mode. As it appears b= elow, emacs starts up and is properly right-aligned. If I uncomment out th= e call to big-font-mode, which ultimately is just a call to set-frame-font,= it gives the message that it ran align-window-right, but it starts up abou= t an inch from the right edge. (Don't ask me where I got that string for t= he font to use, because I don't remember. But it does give me the best loo= king font [to me] for my needs. If there is a better way to specify it tha= t will give me the font I want, but not run into the problem I'm encounteri= ng, I'm all ears.) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D (defun align-window () "fix window positioning" (interactive) (if (equal (getenv "emacs_alignment") "right") (align-window-right) (align-window-left)) ) (defun align-window-left () "align window to left window edge" (interactive) (set-frame-position (selected-frame) 0 0) (message "Ran align-window-left") ) (defun align-window-right () "align window to right window edge" (interactive) (set-frame-position (selected-frame) -1 0) (message "Ran align-window-right") ) (defun big-font-mode () "Use larger font" (interactive) (set-frame-font "-outline-Consolas-bold-r-normal-normal-12-90-96-96-c-*-iso10646-1" ) ) (cond ((eq window-system 'w32) (progn ;; (big-font-mode) (align-window) ))) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D