Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hab25 opened this issue Jun 21, 2024 · 1 comment
Open

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

hab25 opened this issue Jun 21, 2024 · 1 comment

Comments

@hab25
Copy link

hab25 commented Jun 21, 2024

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

@rnkn
Copy link
Owner

rnkn commented Jun 22, 2024

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants