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

[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: Eli Zaretskii
Subject: bug#19395: 25.0.50; Setting left fringe to 0 messes up window-width
Date: Sat, 20 Dec 2014 18:31:25 +0200

> From: Titus von der Malsburg <malsburg@posteo.de>
> Cc: 19395@debbugs.gnu.org
> Date: Sat, 20 Dec 2014 15:51:27 +0100
> 
> >    (aref (font-info (face-font 'default)) 11)
> 
> Great, thanks for adding this.  Below the updated version of my solution
> to the original problem:

Looks good to me.  A few comments about the doc strings:

> (defun window-char-width (&optional window face)
>    "Return character width for WINDOW.

      Return average character width for the font of FACE used in WINDOW.

> FACE is the face for which character width should be
> returned.

This is redundant with my proposed change above.

>           Buffer-local face remappings are applied.  If nil, the
> default face is used."

I would reverse the order:

  If FACE is nil or omitted, the default face is used.  If FACE is
  remapped (see `face-remapping-alist'), the function returns the
  information for the remapped face.

> (defun window-max-characters-per-line (&optional window face)
>   "Return the number of characters that can be displayed
> on one line.

This should be one line, and it is better to mention WINDOW there.

> Buffer-local face remappings are applied.

"Are applied" is too vague, and might confuse.  See my rewording above
for one possible solution.

> This function is different from `window-body-width' in that it
> accounts for fringes

Actually, it accounts for the portions of the line reserved for the
continuation glyph.  Missing fringes are just the trigger to reserve
that.

> one column is reserved for continuation characters) and for the

Please use "glyphs" here, as it could be a string, not a single
character.  (This is explained in the documentation of
standard-display-table.)

> For completeness, it probably also makes sense to include the following
> function in simple.el, which already has a function
> `default-font-height'.

I agree.

Thanks.





reply via email to

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