TransWikia.com

elfeed + olivetti modes

Emacs Asked by Luis Silva on December 7, 2021

I want the elfeed-show-mode to be displayed with the olivetti minor mode olivetti-mode, so I do:

(add-hook 'elfeed-show-mode-hook 'olivetti-mode)

The problem is that the lines are not truncated correctly (see image). I have to invoke elfeed-show-refresh every time to obtain the desired effect. Thank you very much in advance for any hint.

enter image description here

One Answer

I didn't get this to work via the elfeed-show-mode-hook. I don't really fully understand what is going on, but I think it is something to do with the margins set by olivetti mode not activating until after the buffer is displayed, but elfeed renders the buffer before that and so the HTML renderer doesn't get the updated text width.

However, I was able to solve it another way by setting the elfeed-show-entry-switch function. Elfeed calls this function after it sets up the *elfeed-entry* buffer. If this is given a function that switches to the buffer, turns on olivetti-mode and then does a refresh, it all seems to work:

(defun elfeed-olivetti (buff)
  (switch-to-buffer buff)
  (olivetti-mode)
  (elfeed-show-refresh))

(setq elfeed-show-entry-switch 'elfeed-olivetti)

I guess this is a bit inefficient because it does the refresh twice, but I haven't noticed any slowdown when using it.

Answered by Bob Atkey on December 7, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP