olivetti icon indicating copy to clipboard operation
olivetti copied to clipboard

Bug: olivetti can't handle `:height` being a function.

Open hab25 opened this issue 1 year ago • 1 comments

On some specific modes I like using a larger font. I achieve this, I do like this:

(add-hook
 ;; example mode
 'help-mode-hook
 (lambda ()
   (buffer-face-mode-invoke `(:height ,(apply-partially #'+ 30)) t)
   (olivetti-mode)))

However, with this, olivetti errors, here is the start of the debugger backtrace:

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p #[128 "\302\301\303\300\4\"\"\207" [(30) + apply append] 6 "\n\n(fn &rest ARGS2)"])

(olivetti-scale-width 814)
(olivetti-normalize-width 74 #<window 3 on *Help*>)
(olivetti-set-window #<window 3 on *Help*>)
(olivetti-set-buffer-windows)
(olivetti-mode toggle)

This is because #'olivetti-scale-width assumes :height will be either integer or float even though function is also supported (see "info (elisp) Face Attributes").

hab25 avatar Jun 21 '24 19:06 hab25

Interesting. That seems pretty obscure so I won’t be able to dedicate time to it, but I certainly welcome a patch.

rnkn avatar Jun 22 '24 07:06 rnkn