From 14bf87002539ea46adebd23ad17a2ed2687b1a06 Mon Sep 17 00:00:00 2001 From: TEC Date: Thu, 1 Dec 2022 10:46:47 +0800 Subject: [PATCH] fix(org): support module link names with A-Z0-9 We also guard against calling doom-module-locate-path unless the category is non-nil. --- modules/lang/org/autoload/org-link.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/lang/org/autoload/org-link.el b/modules/lang/org/autoload/org-link.el index 4e38288b6..83953d0b1 100644 --- a/modules/lang/org/autoload/org-link.el +++ b/modules/lang/org/autoload/org-link.el @@ -80,7 +80,7 @@ exist, and `org-link' otherwise." (defun +org-link--read-module-spec (module-spec-str) (if (string-prefix-p "+" (string-trim-left module-spec-str)) (let ((title (cadar (org-collect-keywords '("TITLE"))))) - (if (and title (string-match-p "\\`:[a-z]+ [a-z]+\\'" title)) + (if (and title (string-match-p "\\`:[a-z]+ [A-Za-z0-9]+\\'" title)) (+org-link--read-module-spec (concat title " " module-spec-str)) (list :category nil :module nil :flag (intern module-spec-str)))) (cl-destructuring-bind (category &optional module flag) @@ -167,7 +167,7 @@ exist, and `org-link' otherwise." (defun +org-link--doom-module-link-face-fn (module-path) (cl-destructuring-bind (&key category module flag) (+org-link--read-module-spec module-path) - (if (doom-module-locate-path category module) + (if (and category (doom-module-locate-path category module)) `(:inherit org-priority :weight bold) 'error)))