[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#28844: 26.0.90; display-line-numbers-mode should call window-configu
From: |
Eli Zaretskii |
Subject: |
bug#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook |
Date: |
Sat, 09 Dec 2017 18:01:10 +0200 |
> From: Paul Rankin <hello@paulwrankin.com>
> Date: Sun, 10 Dec 2017 01:30:41 +1000
>
> I’m sorry Eli, and everyone else in this thread. I should have shown
> gratitude for your help instead of such arrogance.
Thanks.
> > For example,
> > what should happen if the user enlarges or makes smaller the default
> > face's font with the likes of "C-x +”?
>
> The basic idea of the package is to take a text body width value
> (integer or float) and keep the margins balanced on either side in each
> window the buffer is displayed. Whenever anything display-related
> changes, the package calls olivetti-set-environment. This function calls
> olivetti-scale-width to account for any changes to the font size.
I see. This does work with "C-x +", but when I try changing the font
size via mouse-appearance-menu (by clicking S-mouse-1), the margins
seem to not react to the change. (I was mistaken above to ask about
"C-x +", the problem is with selecting a font from the font menu.)
> I’m going to implement post-command-hook as you suggested, and once the
> API for line-number-display-width is locked I will call that to account
> for display-line-numbers.
Sounds like a good idea. Let me know if you need help in using the
current line-number-display-width as part of implementing this idea.
I think with the current APIs you want to call
line-number-display-width with the optional argument 'columns'. This
is especially important if the 'line-number' face is customized to use
a font different from the one used to display the buffer text.
> You know, the silly thing is... olivetti is designed for prose writing,
> most people will never use it in conjunction with line numbers...
I know. I myself never use line numbers, and only wrote the code
because so many people do via linum.el and similar packages, and then
complain that Emacs redisplay slows down too much.