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

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

Re: Function to present few centered lines


From: Eli Zaretskii
Subject: Re: Function to present few centered lines
Date: Wed, 14 Apr 2021 17:09:05 +0300

> Date: Wed, 14 Apr 2021 16:35:45 +0300
> From: Jean Louis <bugs@gnu.support>
> Cc: help-gnu-emacs@gnu.org
> 
> (window-width) ⇒ 103
> (text-scale-increase 5) ⇒ t
> (window-width) ⇒ 103
> (progn (insert "Hello") (center-line)) --- it will not show centered
>                                     according to text scale increase

You need to scale back fill-column, because evidently you want the
text centered in pixel units, not in column units.

> What I would like is to get a new (window-width) value adjusted to the
> text increased as to calculate more from thre.

The problem here is that window-width returns value in canonical
column units, while fill-column measures in actual columns.  So you
are comparing apples with oranges.



reply via email to

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