unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Mickey Ferguson" <MFerguson@peinc.com>
Subject: how to set frame parameters?
Date: Tue, 18 Jan 2005 09:48:25 -0800	[thread overview]
Message-ID: <csji4v$h6p$1@quimby.gnus.org> (raw)
In-Reply-To: 41ec8088$0$16226$5a62ac22@per-qv1-newsreader-01.iinet.net.au


[-- 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

  reply	other threads:[~2005-01-18 17:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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       ` Mickey Ferguson [this message]
2005-01-18 18:10         ` how to set frame parameters? Drew Adams

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='csji4v$h6p$1@quimby.gnus.org' \
    --to=mferguson@peinc.com \
    /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.
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).