unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Mickey Ferguson" <MFerguson@plantcml.com>
To: "Drew Adams" <drew.adams@oracle.com>, <help-gnu-emacs@gnu.org>
Subject: RE: columns displayed on one line in frame / window
Date: Fri, 5 Jun 2009 13:34:57 -0700	[thread overview]
Message-ID: <B7C31281351E1646814F4A6E3A15895C05974F@costarica.peinet.peinc.com> (raw)
In-Reply-To: 8548E7CE4DBE4C96AA496AECB512B41B@us.oracle.com

I've done some more experiments (still with 21.3) and observed the
following.  First, here are three relevant functions I had defined in my
site-init.el:

(defun max-lines ()
  "Calculate maximum number of lines supported on current display."
  (interactive "P")
  (/ (x-display-pixel-height) (frame-char-height)))

(defun fit-max-lines (fudge)
  "Resize window to fix maximum number of lines vertically"
  (interactive)
  (set-frame-height (selected-frame)
                    ;;; we subtract fudge, an estimated number, to allow
for
                    ;;; window title bar, mode line and minibuffer.
                    (-(max-lines)
                      (if (equal (getenv "emacs_alignment") "bottom")
                          11 fudge)))
  (set-frame-width (selected-frame)
                   (if (equal (getenv "emacs_alignment") "right") 80
81))
  (set-frame-position (selected-frame)
                      (if (equal (getenv "emacs_alignment") "right") -1
0)
                      (if (equal (getenv "emacs_alignment") "bottom") -1
0))
  ;;; do a set-frame-width twice - once before set-frame-position and
once
  ;;; after it.  This allows for true right-alignment.
  (set-frame-width (selected-frame) 81)
  )

(defun big-font-mode ()
  "Use larger font"
  (interactive)
  (set-default-font
   "-raster-Terminal-bold-r-normal-normal-12-90-96-96-c-*-ms-oemlatin")
  (set-frame-height (selected-frame) (-(max-lines) 6))
  (fit-max-lines 6)
  )

First, I started emacs with -q --no-site-file, and the display was fine.
It was using a decent fixed-width font.  I then visited (not loaded) my
site-init.el file.  I did an eval-region on the max-lines and
fit-max-lines function.  Everything is the same.  I then did an
eval-region on the last two lines from big-font-mode (set-frame-height
and fit-max-lines).  The window resized, and it still had exactly the
right number of columns visible (in this case, 81).  I then did an
eval-region on the two lines from big-font-mode that change the font,
and it was at exactly that point that the window frame no longer limited
itself to 81 columns, but instead showed 91 columns.  (Oh, I should add
that my emacs_alignment environment variable is set to right, and if it
matters, my windows screen resolution is 1280x1024.)

Does this provide any clue at all?  I know emacs 21.3 is no longer being
supported, but you might be able to see what's wrong just from the very
small amount of code here.  I eliminated everything else from the
picture.  Maybe it can even be reproduced on 22.x or 23.x.




  parent reply	other threads:[~2009-06-05 20:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-04 22:01 columns displayed on one line in frame / window Mickey Ferguson
2009-06-05 15:40 ` Drew Adams
2009-06-05 17:28   ` Mickey Ferguson
2009-06-05 17:48     ` Drew Adams
2009-06-05 20:34   ` Mickey Ferguson [this message]
2009-06-05 21:28     ` 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=B7C31281351E1646814F4A6E3A15895C05974F@costarica.peinet.peinc.com \
    --to=mferguson@plantcml.com \
    --cc=drew.adams@oracle.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.
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).