all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Mickey Ferguson <Mickey.Ferguson@cassidiancommunications.com>,
	"Emacs Help (help-gnu-emacs@gnu.org)" <help-gnu-emacs@gnu.org>
Subject: RE: Trying to right-align my window on startup
Date: Fri, 10 Jan 2014 15:09:36 -0800 (PST)	[thread overview]
Message-ID: <65e69797-8a7c-4d94-99c3-87d5a3c3ade6@default> (raw)
In-Reply-To: <B67C92F68785104E8816FEEE2B44C9346F33F9C9@TEMCAS01.peinet.peinc.com>

> >Just use a negative integer (e.g. -1) to set the number of pixels
> >from the right or bottom edge of your >screen.
> 
> The problem is not that I can't get the code to make the window move
> to the right position.  I've got the align-window function (below)
> working just fine.  The problem is that I can't get it to execute
> automatically upon emacs startup.

And yet clearly you did get it to execute automatically, since it
sent the message "Ran align-window-right".

> I can't figure out how or where to place it so that it executes
> _and works properly_.  I put it my MF-Init.el file that is loaded
> upon 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 that something.  (No, I cannot know that MF-Init.el is a
sack of eels.  Just a hunch.)

> In the load of that library, it automatically sets the desired
> font and calls align-window.

You are doing too much to find out about your problem.  Why throw
this test in with changing the font, checking the phase of the
moon, and mailing your mom her horoscope? ;-)

> If I just start up emacs, I see the message "Ran align-
> window-right" in the message area of the window, but it isn't right-
> aligned.

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.

> If I do a M-x load-library of that same file, it loads it
> (again), but this time it really does move the window to right
> alignment.

When?  Via the command-line switch -l?  Or using M-x load-file?
Emacs startup is a whole sequence of events.  Only at a particular
point is anything displayed.  At that point there is a frame to
be selected and aligned, but not before.

> Any clues what I'm doing wrong, or how to solve it?
> 
> (defun align-window-right ()
>   "align window to right window edge"
>   (interactive)
>   (set-frame-position (selected-frame) -1 0)
>   (message "Ran align-window-right"))

I do not see the problem here (on MS Windows).

I put just (align-window-right) in an otherwise empty file foo.el
(so I don't have to set the environment var), and I ran
emacs -Q -l "c:\path\to\foo.el".  That should be pretty much
equivalent to loading foo.el as an init file.

The frame was right-aligned, and I got the message
"Ran align-window-right".  No problem.

Try that: get rid of everything extraneous from your .emacs
(comment it out).  If that works, then bisect your .emacs
recursively, to find out what was interfering with the right
behavior.

FWIW, the fact that the code you showed here includes a comment,
a key binding, and a function that picks up an environment
var, all of which are extraneous, is indicative of not trying
to pare this down, to debug it.  (You can do that before asking
here, for instance.)

`M-x comment-region', with a numeric and with a plain prefix arg,
is your friend.  Use it to locate a problem in any file you load,
including your init file.  I bind it to `C-x C-;', and I use it
all the time, to comment and uncomment a block of code.



  reply	other threads:[~2014-01-10 23:09 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-08 20:11 Trying to right-align my window on startup Mickey Ferguson
2014-01-08 21:01 ` Eli Zaretskii
     [not found]   ` <B67C92F68785104E8816FEEE2B44C9346F33C978@TEMCAS01.peinet.peinc.com>
2014-01-09  6:23     ` Eli Zaretskii
2014-01-09 20:16       ` Mickey Ferguson
2014-01-09 20:30         ` Eli Zaretskii
2014-01-09 20:32         ` Drew Adams
2014-01-09 20:36           ` Eli Zaretskii
2014-01-09 20:41             ` Marcin Borkowski
2014-01-09 21:04               ` Drew Adams
     [not found]             ` <mailman.11466.1389300108.10748.help-gnu-emacs@gnu.org>
2014-01-09 21:43               ` Sebastien Vauban
2014-01-09 22:23                 ` Drew Adams
2014-01-10 22:31           ` Mickey Ferguson
2014-01-10 23:09             ` Drew Adams [this message]
2014-01-11  1:17               ` Mickey Ferguson
2014-01-11  3:07                 ` Drew Adams
2014-01-13 23:14                   ` Mickey Ferguson
2014-01-14  4:55                     ` Eli Zaretskii
     [not found]         ` <<83k3e8dhj9.fsf@gnu.org>
2014-01-09 21:02           ` Drew Adams
     [not found] <<B67C92F68785104E8816FEEE2B44C9346F33C8FD@TEMCAS01.peinet.peinc.com>
     [not found] ` <<83r48idw6z.fsf@gnu.org>
     [not found]   ` <<B67C92F68785104E8816FEEE2B44C9346F33C978@TEMCAS01.peinet.peinc.com>
     [not found]     ` <<83mwj5ekrs.fsf@gnu.org>
     [not found]       ` <<B67C92F68785104E8816FEEE2B44C9346F33D269@TEMCAS01.peinet.peinc.com>
     [not found]         ` <<28ab7799-fdc5-47c4-9ac0-f7db66771e7e@default>
     [not found]           ` <<83iotsdh9n.fsf@gnu.org>
2014-01-09 21:02             ` Drew Adams
2014-01-11 14:45               ` Juanma Barranquero
2014-01-11 17:35                 ` poor Customize [was: Trying to right-align my window on startup] Drew Adams
     [not found]                 ` <mailman.11630.1389461775.10748.help-gnu-emacs@gnu.org>
2014-01-13 15:11                   ` jack-mac
2014-01-13 17:06                     ` Drew Adams
     [not found]               ` <mailman.11626.1389451551.10748.help-gnu-emacs@gnu.org>
2014-01-14  9:24                 ` Trying to right-align my window on startup Rusi
2014-01-14 17:37                   ` In defense of Customize [was: Trying to right-align my window on startup] Drew Adams
2014-01-14 19:32                     ` session.* files (was: In defense of Customize) gottlieb
2014-01-14 19:52                       ` Peter Dyballa
2014-01-15 10:29                     ` In defense of Customize [was: Trying to right-align my window on startup] Phillip Lord
2014-01-15 17:28                       ` Drew Adams
2014-01-16 10:06                         ` Phillip Lord
2014-01-16 15:33                           ` Drew Adams
2014-01-14 17:53                   ` Trying to right-align my window on startup Emanuel Berg
2014-01-14 17:57                   ` Marcin Borkowski
     [not found]                   ` <mailman.11925.1389722262.10748.help-gnu-emacs@gnu.org>
2014-01-14 18:15                     ` Rusi
2014-01-14 18:19                     ` Emanuel Berg
2014-01-15  4:44                     ` Rusi
     [not found]                   ` <mailman.11921.1389721075.10748.help-gnu-emacs@gnu.org>
2014-01-18  2:59                     ` In defense of Customize [was: Trying to right-align my window on startup] Rusi
2014-01-18  4:42                       ` Emanuel Berg
2014-01-18 15:31                         ` Rusi
2014-01-28 15:17                     ` Christoph Wedler
2014-01-28 18:35                       ` Emanuel Berg
2014-01-29 10:57                         ` Phillip Lord
2014-01-29 13:23                           ` Stefan Monnier
2014-01-29 16:54                             ` Phillip Lord
2014-01-29 18:26                               ` Stefan Monnier
2014-01-30  9:59                                 ` Phillip Lord
     [not found]                         ` <mailman.13090.1390993048.10748.help-gnu-emacs@gnu.org>
2014-01-29 16:52                           ` Emanuel Berg
2014-01-29 17:19                             ` Phillip Lord
     [not found]                             ` <mailman.13107.1391015968.10748.help-gnu-emacs@gnu.org>
2014-01-29 18:21                               ` Emanuel Berg
2014-01-29  0:47                       ` Drew Adams
     [not found]                       ` <mailman.13068.1390956492.10748.help-gnu-emacs@gnu.org>
2014-01-30 10:14                         ` Christoph Wedler
2014-01-30 13:23                           ` Stefan Monnier
2014-01-30 16:06                           ` Drew Adams
     [not found]                           ` <mailman.13194.1391088219.10748.help-gnu-emacs@gnu.org>
2014-01-30 16:15                             ` Rusi
2014-01-30 18:44                               ` Emanuel Berg
2014-01-31  9:56                                 ` Phillip Lord
     [not found]                                 ` <mailman.13338.1391162177.10748.help-gnu-emacs@gnu.org>
2014-01-31 12:08                                   ` Rusi
2014-01-31 20:41                                     ` Emanuel Berg
2014-01-31 20:39                                   ` Emanuel Berg
     [not found]                           ` <mailman.13229.1391098001.10748.help-gnu-emacs@gnu.org>
2014-01-31  6:54                             ` Rusi
2014-01-31 17:50                             ` Christoph Wedler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=65e69797-8a7c-4d94-99c3-87d5a3c3ade6@default \
    --to=drew.adams@oracle.com \
    --cc=Mickey.Ferguson@cassidiancommunications.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.