GNU bug report logs - #19194
24.4.50; `window-body-width' is not dynamic relative to font size changes

Previous Next

Package: emacs;

Reported by: Joe Corneli <holtzermann17 <at> gmail.com>

Date: Wed, 26 Nov 2014 13:48:01 UTC

Severity: normal

Tags: notabug

Merged with 20022

Found in versions 24.4.50, 24.4.90

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Joe Corneli <holtzermann17 <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 19194 <at> debbugs.gnu.org
Subject: bug#19194: 24.4.50; `window-body-width' is not dynamic relative to font size changes
Date: Sat, 20 Dec 2014 15:49:39 +0100
> The one thing I'd add is an explanation of how "character width" is
> found or computed for variable-width fonts.  (E.g. is it the width of an
> "M"?)

Elsewhere I proposed:

(defun window-char-width (&optional window)
  "Return default character width for WINDOW.
WINDOW must be a live window and defaults to the selected one."
  (setq window (window-normalize-window window t))
  (with-current-buffer (window-buffer window)
    (let* ((info (font-info (face-font 'default)))
       (width (aref info 11)))
      (if (> width 0)
      width
    (aref info 10)))))

You could try to experiment with this and either use

(width (aref info 10))

or

(width (aref info 7))

instead of (aref info 11).  Or use something like

(face-font 'default ?M) instead of (face-font 'default).

I use variable width fonts only in customization buffers, so I'm not
very qualified at checking this myself.  We can use whatever you find
here provided we can pack it into an argument of `window-body-width'.

And Eli certainly knows better, so wait.  Maybe my idea is silly.

martin




This bug report was last modified 3 years and 105 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.