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

Open
opened 2022-06-18 09:09:48 +00:00 by atensity · 1 comment
atensity commented 2022-06-18 09:09:48 +00:00 (Migrated from github.com)

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

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) ```emacs-lisp (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
tecosaur commented 2022-06-21 04:08:08 +00:00 (Migrated from github.com)

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

Ah, the issue is that `(face-attribute 'marginalia-date :foreground nil t)` is `unspecified` with `homage-white`.
Sign in to join this conversation.
No description provided.