Set-popup-rule! on existing popup rule duplicate item

What happened?

set-popup-rule! duplicates item

What did you expect to happen?

I’m not sure. If I try to overwrite an existing popup-rule, defined as one with an existing regexp, it adds a duplicate entry.

Either

  1. A warning is given that there’s a duplicate
  2. It overwrites the default setting

Steps to reproduce

In config.el

(set-popup-rules!
  '(("^\\*Org Src"
     :slot 20 :side right :size 0.5 :select t)))

Inspect +popup–display-buffer-alist, there are two entries with “^\*Org Src”. Doom pick the first one.

One perhaps hacky solution is to delay the setting of popup-rule until after the default is loaded. Then my custom one appear above in the list.

System information


Loading data dump...

Edit

If there’s a hook to use for this it solves the problem. I.e. a “run-after-doom-is-finished-loading-its-stuff-hook”. Does that one exist?

Otherwise, it’s possible to use e.g. (after! org …) for the particular example above. But then, how does one customize say the info buffer?

I think for cases (after! ...) is preferable. For exceptional case doom-after-init-hook should work. If that is not late enough you can try doom-first-buffer-hook. Doom has a quite a few hooks, you can search for them using SPC h v doom hook and you might find a more better one for this purpose.

1 Like

+popup--display-buffer-alist

there are two entries with “^*Org Src”. Doom pick the first one.

That’s not a bug, but a feature of association lists. See Association Lists.

Association lists are often used to record information that you might otherwise keep on a stack, since new associations may be added easily to the front of the list. When searching an association list for an association with a given key, the first one found is returned, if there is more than one.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.