unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* how to set window starting coordinates?
@ 2005-01-15  1:07 Mickey Ferguson
  2005-01-15  1:32 ` Jesper Harder
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Mickey Ferguson @ 2005-01-15  1:07 UTC (permalink / raw)


I'm using GNU Emacs 21.3.1 on Windows XP.  Is there a way for me to set the
location and size of the window when I first start it from the windows Start
Menu (runemacs.exe)?  I can't seem to find the answer - I'm probably trying
the wrong keywords when searching via M-x apropos.  An acceptable answer is
any of the following:  through a registry setting, through something to put
into my .emacs, or as a last resort, through something to be passed via
command line.

TIA!

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: how to set window starting coordinates?
  2005-01-15  1:07 how to set window starting coordinates? Mickey Ferguson
@ 2005-01-15  1:32 ` Jesper Harder
  2005-01-17 17:45   ` Mickey Ferguson
  2005-01-17 13:57 ` Peter Dyballa
  2005-01-17 20:44 ` david.boon
  2 siblings, 1 reply; 9+ messages in thread
From: Jesper Harder @ 2005-01-15  1:32 UTC (permalink / raw)


"Mickey Ferguson" <MFerguson@peinc.com> writes:

> I'm using GNU Emacs 21.3.1 on Windows XP.  Is there a way for me to set the
> location and size of the window when I first start it from the windows Start
> Menu (runemacs.exe)?

See <http://www.gnu.org/software/emacs/windows/faq4.html>.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: how to set window starting coordinates?
  2005-01-15  1:07 how to set window starting coordinates? Mickey Ferguson
  2005-01-15  1:32 ` Jesper Harder
@ 2005-01-17 13:57 ` Peter Dyballa
  2005-01-17 20:44 ` david.boon
  2 siblings, 0 replies; 9+ messages in thread
From: Peter Dyballa @ 2005-01-17 13:57 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 15.01.2005 um 02:07 schrieb Mickey Ferguson:

>  Is there a way for me to set the
> location and size of the window when I first start it from the windows 
> Start
> Menu (runemacs.exe)?

You could try such things in .emacs:

           (setq initial-frame-alist '(
                   (font . "fontset-12pt_monaco")
                   (top . 5) (left . 50) (width . 89) (height . 60)))
           (setq default-frame-alist '(
                   (background-color . "honeydew")
                   (vertical-scroll-bars . left)
                   (font . "fontset-12pt_monaco")
                   (top . 9) (left . 500) (width . 89) (height . 50)))
--
Greetings

   Pete

Behold the warranty ... the bold print giveth and the fine print taketh 
away.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: how to set window starting coordinates?
  2005-01-15  1:32 ` Jesper Harder
@ 2005-01-17 17:45   ` Mickey Ferguson
  0 siblings, 0 replies; 9+ messages in thread
From: Mickey Ferguson @ 2005-01-17 17:45 UTC (permalink / raw)


"Jesper Harder" <harder@myrealbox.com> wrote in message
news:m2r7kn5vfd.fsf@Jesper-Harders-Computer.local...
> "Mickey Ferguson" <MFerguson@peinc.com> writes:
>
> > I'm using GNU Emacs 21.3.1 on Windows XP.  Is there a way for me to set
the
> > location and size of the window when I first start it from the windows
Start
> > Menu (runemacs.exe)?
>
> See <http://www.gnu.org/software/emacs/windows/faq4.html>.

This looks promising.  From the FAQ:

To reposition an Emacs frame using elisp, you can use the set-frame-position
function. For example, to move the current frame to the offset (10, 30), you
could use:

    (set-frame-position (selected-frame) 10 30)

I also used M-x apropos on the set-frame-position, and it says this:

(set-frame-position FRAME XOFFSET YOFFSET)

Sets position of FRAME in pixels to XOFFSET by YOFFSET.
This is actually the position of the upper left corner of the frame.
Negative values for XOFFSET or YOFFSET are interpreted relative to
the rightmost or bottommost possible position (that stays within the
screen).

Now what I want is to be able to specify my window (frame) to be up against
the right-hand side of my screen.  So I thought I would use (set-frame
position (selected-frame) -0 0).  Nope, it interprets -0 the same as 0.  The
best I could do was -1 0, which left a little space between my window and
the edge of the screen.  Is there any way to specify it flush-right?  Or is
this a bug where it should interpret -0 as meaning flush-right, but it's
not?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: how to set window starting coordinates?
  2005-01-15  1:07 how to set window starting coordinates? Mickey Ferguson
  2005-01-15  1:32 ` Jesper Harder
  2005-01-17 13:57 ` Peter Dyballa
@ 2005-01-17 20:44 ` david.boon
  2005-01-17 21:51   ` Mickey Ferguson
  2 siblings, 1 reply; 9+ messages in thread
From: david.boon @ 2005-01-17 20:44 UTC (permalink / raw)


Mickey Ferguson wrote:
> I'm using GNU Emacs 21.3.1 on Windows XP.  Is there a way for me to
set the
> location and size of the window when I first start it from the
windows Start
> Menu (runemacs.exe)?  I can't seem to find the answer - I'm probably
trying
> the wrong keywords when searching via M-x apropos.  An acceptable
answer is
> any of the following:  through a registry setting, through something
to put
> into my .emacs, or as a last resort, through something to be passed
via
> command line.
>
> TIA!

The technique suggested in faq results in the window frame jumping
around, sort of goofy if you ask me.

I use custom settings in the registry.  If you create registry entries
like the following I'm sure you'll get what you're after:


[HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs]
"Emacs.FONT"="-*-Lucida Console-normal-r-*-*-11-82-96-96-c-*-iso8859-1"
"Emacs.GEOMETRY"="90x60"

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: how to set window starting coordinates?
  2005-01-17 20:44 ` david.boon
@ 2005-01-17 21:51   ` Mickey Ferguson
  2005-01-18  3:20     ` Quokka
  0 siblings, 1 reply; 9+ messages in thread
From: Mickey Ferguson @ 2005-01-17 21:51 UTC (permalink / raw)


<david.boon@gmail.com> wrote in message
news:1105994654.009453.228500@c13g2000cwb.googlegroups.com...
> The technique suggested in faq results in the window frame jumping
> around, sort of goofy if you ask me.
>
> I use custom settings in the registry.  If you create registry entries
> like the following I'm sure you'll get what you're after:
>
>
> [HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs]
> "Emacs.FONT"="-*-Lucida Console-normal-r-*-*-11-82-96-96-c-*-iso8859-1"
> "Emacs.GEOMETRY"="90x60"

True enough.  And better yet, put it into HKEY_CURRENT_USER instead of
HKEY_LOCAL_MACHINE so that if more than one user uses the PC, each can
customize as he desires.

But I kind of wanted it to be controlled through code in the .emacs file and
not in the registry, because that way I have portability if I take my emacs
installation elsewhere.  I don't have to remember to import a reg file if I
take it to a PC in the lab, or at a customer site.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: how to set window starting coordinates?
  2005-01-17 21:51   ` Mickey Ferguson
@ 2005-01-18  3:20     ` Quokka
  2005-01-18 17:48       ` how to set frame parameters? Mickey Ferguson
  0 siblings, 1 reply; 9+ messages in thread
From: Quokka @ 2005-01-18  3:20 UTC (permalink / raw)


>>
>>[HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs]
>>"Emacs.FONT"="-*-Lucida Console-normal-r-*-*-11-82-96-96-c-*-iso8859-1"
>>"Emacs.GEOMETRY"="90x60"
> 
> 
> True enough.  And better yet, put it into HKEY_CURRENT_USER instead of
> HKEY_LOCAL_MACHINE so that if more than one user uses the PC, each can
> customize as he desires.
> 
> But I kind of wanted it to be controlled through code in the .emacs file and
> not in the registry, because that way I have portability if I take my emacs
> installation elsewhere.  I don't have to remember to import a reg file if I
> take it to a PC in the lab, or at a customer site.

Actually .. I find that that is why I put it into the registry,
so when I am on a different machine with a different size screens
(i.e. 19inch work station as opposed to a laptop)
then the size goes back to default.

Paul

^ permalink raw reply	[flat|nested] 9+ messages in thread

* how to set frame parameters?
  2005-01-18  3:20     ` Quokka
@ 2005-01-18 17:48       ` Mickey Ferguson
  2005-01-18 18:10         ` Drew Adams
  0 siblings, 1 reply; 9+ messages in thread
From: Mickey Ferguson @ 2005-01-18 17:48 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 2236 bytes --]


"Quokka" <NoSpam@iinet.net.au> wrote in message news:41ec8088$0$16226$5a62ac22@per-qv1-newsreader-01.iinet.net.au...
> Actually .. I find that that is why I put it into the registry,
> so when I am on a different machine with a different size screens
> (i.e. 19inch work station as opposed to a laptop)
> then the size goes back to default.

Different perspectives of the same issue.  I specifically wanted my window to be 80 columns wide (actually 81, because I didn't want the 80th character to be displayed as a wrap), and the length set to the size of the screen where I'm working.  I had a function that calculated the maximum length (max-lines) that I could use for the window.  I also calculated that for a 1024x768 display (my default at work), with the toolbar disabled (because I only want the menu, and frankly I almost never use it either), I could fit 87 lines for my display with my desired font.  See the code below.

So is there an easier (and more correct) way to accomplish this task?  Here's what I have in my .emacs:

(cond
 ((eq window-system 'w32)
  (progn
    (and window-system
         (setq
          screen-width (x-display-pixel-width)
          screen-height (x-display-pixel-height)))

    (defun max-lines (arg)
      "Calculate maximum number of lines supported, based on number pre-calculated, scaled to 1024x768 display."
      (interactive "P")
      (if (eq screen-height 768)
          arg
        (+ 1 (/ (* screen-height arg) 768))))

;;;See HKCU/Software/GNU/Emacs key for initial size customizations
;;;(specifically, emacs.Geometry)
;[HKEY_CURRENT_USER\Software\GNU\Emacs]
;"emacs.Font"="-*-Terminal-bold-r-*-*-8-60-96-96-c-*-ms-oem"
;"emacs.Geometry"="81x87"

;;; Instead of using the registry key above, we now set things manually as below
    (set-default-font "-*-Terminal-bold-r-*-*-8-60-96-96-c-*-ms-oem")
    (set-frame-width (selected-frame) 81)
    (set-frame-height (selected-frame) (max-lines 87))
    (set-frame-position (selected-frame)
                        ; for BLDMGRCDRW02, right-anchor window.  For all others, left.
                        (if (equal (getenv "COMPUTERNAME") "BLDMGRCDRW02") -1 0)
                        0)
    )))

[-- Attachment #1.2: Type: text/html, Size: 4366 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: how to set frame parameters?
  2005-01-18 17:48       ` how to set frame parameters? Mickey Ferguson
@ 2005-01-18 18:10         ` Drew Adams
  0 siblings, 0 replies; 9+ messages in thread
From: Drew Adams @ 2005-01-18 18:10 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 339 bytes --]

  the length set to the size of the screen where I'm working.  I had a
function that calculated the maximum length (max-lines) that I could use for
the window.
This is what I would do:

  (/ (x-display-pixel-height) (frame-char-height))

That gives you the max height in number of lines, which is what you want, if
I understand correctly.

[-- Attachment #1.2: Type: text/html, Size: 1590 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-01-18 18:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-15  1:07 how to set window starting coordinates? Mickey Ferguson
2005-01-15  1:32 ` Jesper Harder
2005-01-17 17:45   ` Mickey Ferguson
2005-01-17 13:57 ` Peter Dyballa
2005-01-17 20:44 ` david.boon
2005-01-17 21:51   ` Mickey Ferguson
2005-01-18  3:20     ` Quokka
2005-01-18 17:48       ` how to set frame parameters? Mickey Ferguson
2005-01-18 18:10         ` Drew Adams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).