From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Mickey Ferguson" Newsgroups: gmane.emacs.help Subject: how to set frame parameters? Date: Tue, 18 Jan 2005 09:48:25 -0800 Message-ID: References: <1105994654.009453.228500@c13g2000cwb.googlegroups.com> <41ec8088$0$16226$5a62ac22@per-qv1-newsreader-01.iinet.net.au> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0863260243==" X-Trace: sea.gmane.org 1106070790 9233 80.91.229.6 (18 Jan 2005 17:53:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 18 Jan 2005 17:53:10 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jan 18 18:53:00 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CqxXG-0001wX-00 for ; Tue, 18 Jan 2005 18:53:00 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CqxjB-0006vo-Ed for geh-help-gnu-emacs@m.gmane.org; Tue, 18 Jan 2005 13:05:17 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsmi-us.news.garr.it!newsmi-eu.news.garr.it!NewsITBone-GARR!feed.news.tiscali.de!uninett.no!news.eunet.no!uio.no!quimby.gnus.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 172 Original-NNTP-Posting-Host: 67.151.52.10 Original-X-Trace: quimby.gnus.org 1106070496 17625 67.151.52.10 (18 Jan 2005 17:48:16 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: Tue, 18 Jan 2005 17:48:16 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Original-Xref: shelby.stanford.edu gnu.emacs.help:127978 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:23466 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:23466 This is a multi-part message in MIME format. --===============0863260243== Content-Type: multipart/alternative; boundary="----=_NextPart_000_001D_01C4FD42.DA9B3490" This is a multi-part message in MIME format. ------=_NextPart_000_001D_01C4FD42.DA9B3490 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable "Quokka" 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"=3D"-*-Terminal-bold-r-*-*-8-60-96-96-c-*-ms-oem" ;"emacs.Geometry"=3D"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) ))) ------=_NextPart_000_001D_01C4FD42.DA9B3490 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
 
"Quokka" <NoSpam@iinet.net.au> wrote in = message=20 news:41ec8088$0$16226$5a62ac22@per-qv1-newsreader-01.iinet.net.a= u...
> Actually .. I find that that is why I put it = into the=20 registry,
> so when I am on a different machine with a different = size=20 screens
> (i.e. 19inch work station as opposed to a = laptop)
> then=20 the size goes back to default.
Different perspectives of the same issue.  I = specifically=20 wanted my window to be 80 columns wide (actually 81, because I didn't = want the=20 80th character to be displayed as a wrap), and the length set to the = size of the=20 screen where I'm working.  I had a function that calculated the = maximum=20 length (max-lines) that I could use for the window.  I also = calculated that=20 for a 1024x768 display (my default at work), with the toolbar disabled = (because=20 I only want the menu, and frankly I almost never use it either), I could = fit 87=20 lines for my display with my desired font.  See the code=20 below.
 
So is there an easier (and more correct) way to = accomplish=20 this task?  Here's what I have in my .emacs:
 
(cond
 ((eq = window-system=20 'w32)
  (progn
    (and=20 window-system
        =20 (setq
          = screen-width=20 (x-display-pixel-width)
       &nbs= p; =20 screen-height (x-display-pixel-height)))
 
    (defun = max-lines=20 (arg)
      "Calculate maximum number of = lines=20 supported, based on number pre-calculated, scaled to 1024x768=20 display."
      (interactive=20 "P")
      (if (eq screen-height=20 768)
         =20 arg
        (+ 1 (/ (* = screen-height arg)=20 768))))
;;;See HKCU/Software/GNU/Emacs = key for=20 initial size customizations
;;;(specifically,=20 emacs.Geometry)
;[HKEY_CURRENT_USER\Software\GNU\Emacs]
;"emacs.Fon= t"=3D"-*-Terminal-bold-r-*-*-8-60-96-96-c-*-ms-oem"
;"emacs.Geometry"=3D= "81x87"
 
;;; Instead of using the = registry key=20 above, we now set things manually as below
   =20 (set-default-font=20 "-*-Terminal-bold-r-*-*-8-60-96-96-c-*-ms-oem")
   =20 (set-frame-width (selected-frame) 81)
    = (set-frame-height=20 (selected-frame) (max-lines 87))
    = (set-frame-position=20 (selected-frame)
          &nbs= p;            = ;=20 ; for BLDMGRCDRW02, right-anchor window.  For all others,=20 left.
          &nbs= p;            = ;=20 (if (equal (getenv "COMPUTERNAME") "BLDMGRCDRW02") -1 0)
          &nbs= p;            = ;=20 0)
   =20 )))
------=_NextPart_000_001D_01C4FD42.DA9B3490-- --===============0863260243== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Help-gnu-emacs mailing list Help-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-emacs --===============0863260243==--