emacs-devel
[Top][All Lists]
Advanced

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

Re: Adding olivetti to GNU ELPA


From: Stefan Monnier
Subject: Re: Adding olivetti to GNU ELPA
Date: Thu, 09 May 2019 09:30:54 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> 'set-window-margins' doesn't do much when margins don't change.  So I
> suppose that for some reason olivetti mode wants margins to change too
> often.  If so, could you try to find out why?

I think the issue here is that even when margins "aren't modified",
olivetti does change them, because it first sets them to 0 before
setting them again to the previous value, as can be seen in
olivetti--set-margins (which is function called for post-command-hook,
window-size-change-functions, and friends):

    (defun olivetti--set-margins (&optional window-or-frame)
      [...]
        (olivetti-reset-window window-or-frame)
        [...]
          (set-window-margins window-or-frame left-margin right-margin))))
    
    (defun olivetti-reset-window (window)
      [...]
      (set-window-margins window nil))

I don't know why it starts by calling olivetti-reset-window.
But I think that for Emacs-27, it doesn't matter because it should only
use window-size-change-functions so the extra (set-window-margins window
nil) shouldn't be problematic.


        Stefan




reply via email to

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