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

vertico--exhibit post-command-hook error with marginalia configuration and doom-homage-white #35

Open
atensity opened this issue Jun 18, 2022 · 1 comment
Labels
uh-oh something seems dodgy

Comments

@atensity
Copy link

atensity commented Jun 18, 2022

Hi,

first of all - thank you for the amazing configuration file and for it being really well documented. I have lifted some parts here and there and they've been incredibly helpful.

Now onto the issue. I had some time ago taken the part from the marginalia configuration regarding the marginalia-annotator-registry for making it look nicer - which is working perfectly fine. I was trying out some themes and noticed that if I changed it to doom-homage-white I would seem to get Error in post-command-hook (vertico--exhibit): (wrong-type-argument sequencep unspecified) as an error for anything requiring a completion window (i.e recent files etc). From bisecting my config it seems to be that the marginalia function that I had lifted from your config.

(The relevant part)

(after! marginalia
  (setq marginalia-censor-variables nil)

  (defadvice! +marginalia--anotate-local-file-colorful (cand)
    "Just a more colourful version of `marginalia--anotate-local-file'."
    :override #'marginalia--annotate-local-file
    (when-let (attrs (file-attributes (substitute-in-file-name
                                       (marginalia--full-candidate cand))
                                      'integer))
      (marginalia--fields
       ((marginalia--file-owner attrs)
        :width 12 :face 'marginalia-file-owner)
       ((marginalia--file-modes attrs))
       ((+marginalia-file-size-colorful (file-attribute-size attrs))
        :width 7)
       ((+marginalia--time-colorful (file-attribute-modification-time attrs))
        :width 12))))

  (defun +marginalia--time-colorful (time)
    (let* ((seconds (float-time (time-subtract (current-time) time)))
           (color (doom-blend
                   (face-attribute 'marginalia-date :foreground nil t)
                   (face-attribute 'marginalia-documentation :foreground nil t)
                   (/ 1.0 (log (+ 3 (/ (+ 1 seconds) 345600.0)))))))
      ;; 1 - log(3 + 1/(days + 1)) % grey
      (propertize (marginalia--time time) 'face (list :foreground color))))

  (defun +marginalia-file-size-colorful (size)
    (let* ((size-index (/ (log10 (+ 1 size)) 7.0))
           (color (if (< size-index 10000000) ; 10m
                      (doom-blend 'orange 'green size-index)
                    (doom-blend 'red 'orange (- size-index 1)))))
      (propertize (file-size-human-readable size) 'face (list :foreground color)))))

I had tried debugging it a bit, but except that error I wasn't able to get much further. It could also be related to following emacs-master, so I'll poke around some more. So far it seems to happen also launching the doom sandbox without my configuration but just running the marginalia addition. If this issue is irrelevant feel free to close it - just wanted to let you know incase somebody else might have the same problem or if it pops up in the future.

Steps to Reproduce

  1. Run/Load marignalia function (either in sandbox or normally)
  2. Load doom-homage-white theme
  3. Try to load recent files i.e SPC f r
  4. Error in post-command-hook (vertico--exhibit): (wrong-type-argument sequencep unspecified)

Doom Version: v22.06.0-dev (most recent version as of this comment)
Emacs Version: 29.0.50

@atensity atensity changed the title vertico--exhibit post-command-hook error with marginalia and doom-homage-white vertico--exhibit post-command-hook error with marginalia configuration and doom-homage-white Jun 18, 2022
@tecosaur
Copy link
Owner

Ah, the issue is that (face-attribute 'marginalia-date :foreground nil t) is unspecified with homage-white.

@tecosaur tecosaur added the uh-oh something seems dodgy label Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
uh-oh something seems dodgy
Projects
None yet
Development

No branches or pull requests

2 participants