[Top][All Lists]

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

Re: Adding olivetti to GNU ELPA

From: martin rudalics
Subject: Re: Adding olivetti to GNU ELPA
Date: Thu, 9 May 2019 10:14:15 +0200

>     (set-window-margins
>       (current-window) (/ 2 (- (window-width) olivetti-body-width)))

What is 'current-window' and how does it relate to 'selected-window'?

> There are some other ancillary functions, but really it's just a
> case of running this function in all windows displaying the current
> buffer when olivetti-body-width changes or when the window width
> changes.

What does "current buffer" refer to here?  I suppose you want to run
"this function" whenever the body width of a window showing a buffer
with olivetti mode enabled changes.  So with Emacs 27 it should
suffice to add your function to `window-size-change-functions' for
each buffer where olivetti mode is enabled

> 1. Some users have complained of lagging input, which seems to be
> due to olivetti setting the margins too often, i.e. on too many
> hooks. So using the minimal number of hooks is preferable.

'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?

> 2. But I've experienced olivetti failing to set the margins during a few 
common cases, e.g.:
>   - splitting window with icomplete "*Completions*" buffer
>   - splitting window with ispell-word "*Choices*" buffer
>   - splitting window with magit-status
>   - splitting window vertically with any buffers in a side-window in the  
same frame (which results in window being too large to split -- I  think this is a 
separate issue)

Too _large_ to split?

> It would be nice to achieve consistency with these.

Are these failures due to the fact that a releated hook is not run or
are there other issues?


reply via email to

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