Skip to content

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

Description

@hab25

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").

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions