branch: externals/marginalia
commit 9cd762b6c3f2714375f47993e9a6384d3bc16ebf
Author: Daniel Mendler <m...@daniel-mendler.de>
Commit: Daniel Mendler <m...@daniel-mendler.de>

    Improve marginalia-bookmark-type-transformers
---
 marginalia.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index bdb4547..2ad123b 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -145,10 +145,12 @@ determine it."
   :type '(alist :key-type symbol :value-type symbol))
 
 (defcustom marginalia-bookmark-type-transformers
-  `(("\\`bookmark-\\(.*?\\)-handler\\'" . "\\1")
-    ("default" . "File")
-    ("\\`\\(.*?\\)-+bookmark-jump\\(?:-handler\\)?\\'" . "\\1")
-    (".*" . ,#'capitalize))
+  (let ((words (regexp-opt '("handle" "handler" "jump" "bookmark"))))
+    `((,(format "-+%s-+" words) . "-")
+      (,(format "\\`%s-+" words) . "")
+      (,(format "-%s\\'" words) . "")
+      ("\\`default\\'" . "File")
+      (".*" . ,#'capitalize)))
   "List of bookmark type transformers."
   :type '(alist :key-type regexp :value-type (choice string function)))
 

Reply via email to