help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: columns displayed on one line in frame / window


From: Mickey Ferguson
Subject: RE: columns displayed on one line in frame / window
Date: Fri, 5 Jun 2009 13:34:57 -0700

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]