[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#19395: 25.0.50; Setting left fringe to 0 messes up window-width
From: |
martin rudalics |
Subject: |
bug#19395: 25.0.50; Setting left fringe to 0 messes up window-width |
Date: |
Fri, 19 Dec 2014 18:09:31 +0100 |
> Given the changes I pushed in commit b197822, you will no longer need
> all this complexity. Just
>
> (aref (font-info (face-font 'default)) 11)
>
> (For bullet-proof code, check that this is not zero, and if it is, use
> the 10th member instead; see the docs.)
Very good. IIUC this means that I could use something like
(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)))))
(defun window-char-height (&optional window)
"Return default character height 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)
(aref (font-info (face-font 'default)) 3)))
in window.el. If that is the case, then the doc of `font-info' should
be somehow amended. It currently says
Return information about a font named NAME on frame FRAME.
and nowhere mentions which buffer must be current or maybe even which
window must be selected. I'm a bit too lazy to look into this myself.
Thanks a lot for this, martin
- bug#19395: 25.0.50; Setting left fringe to 0 messes up window-width, (continued)
- bug#19395: 25.0.50; Setting left fringe to 0 messes up window-width, Titus von der Malsburg, 2014/12/16
- bug#19395: 25.0.50; Setting left fringe to 0 messes up window-width, Eli Zaretskii, 2014/12/17
- bug#19395: 25.0.50; Setting left fringe to 0 messes up window-width, Titus von der Malsburg, 2014/12/17
- bug#19395: 25.0.50; Setting left fringe to 0 messes up window-width, Eli Zaretskii, 2014/12/17
- bug#19395: 25.0.50; Setting left fringe to 0 messes up window-width, Titus von der Malsburg, 2014/12/17
- bug#19395: 25.0.50; Setting left fringe to 0 messes up window-width, Eli Zaretskii, 2014/12/17
- bug#19395: 25.0.50; Setting left fringe to 0 messes up window-width, Titus von der Malsburg, 2014/12/17
- bug#19395: 25.0.50; Setting left fringe to 0 messes up window-width, Eli Zaretskii, 2014/12/18
- bug#19395: 25.0.50; Setting left fringe to 0 messes up window-width,
martin rudalics <=
- bug#19395: 25.0.50; Setting left fringe to 0 messes up window-width, Eli Zaretskii, 2014/12/19
- bug#19395: 25.0.50; Setting left fringe to 0 messes up window-width, martin rudalics, 2014/12/20
- bug#19395: 25.0.50; Setting left fringe to 0 messes up window-width, Eli Zaretskii, 2014/12/20
- bug#19395: 25.0.50; Setting left fringe to 0 messes up window-width, martin rudalics, 2014/12/20
- bug#19395: 25.0.50; Setting left fringe to 0 messes up window-width, Eli Zaretskii, 2014/12/20
- bug#19395: 25.0.50; Setting left fringe to 0 messes up window-width, martin rudalics, 2014/12/20
- bug#19395: 25.0.50; Setting left fringe to 0 messes up window-width, Eli Zaretskii, 2014/12/20
- bug#19395: 25.0.50; Setting left fringe to 0 messes up window-width, martin rudalics, 2014/12/20
- bug#19395: 25.0.50; Setting left fringe to 0 messes up window-width, Eli Zaretskii, 2014/12/20
- bug#19395: 25.0.50; Setting left fringe to 0 messes up window-width, martin rudalics, 2014/12/20