Bug: olivetti can't handle `:height` being a function. · Issue #80 · rnkn/olivetti · GitHub
Skip to content

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

Open

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

Activity

  1. rnkn commented on Jun 22, 2024

    @rnkn
    Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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