From 204d78168f394904ecbea51d087c7658fc28a9a8 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Fri, 30 Sep 2022 09:55:13 +1000 Subject: a tiny bug --- hcel-haddorg.el | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/hcel-haddorg.el b/hcel-haddorg.el index 09a8026..a6961cc 100644 --- a/hcel-haddorg.el +++ b/hcel-haddorg.el @@ -86,14 +86,16 @@ is in ghc-8.10.1, hcel will attempt to look up in ghc-9.2.2.org." (expand-file-name (format "%s/%s.org" hcel-haddorg-dir package-id)))) (cond ((file-exists-p exact-match) exact-match) (hcel-haddorg-lax-version - (when-let ((files - (sort (directory-files - hcel-haddorg-dir t - (format "^%s\\(-[0-9.]+\\)?\\.org$" - (car (split-string package-id "-")))) - (lambda (x y) - (string> (file-name-base x) - (file-name-base y)))))) + (when-let + ((files + (sort (directory-files + hcel-haddorg-dir t + (format "^%s\\(-[0-9.]+\\)?\\.org$" + (alist-get + 'name (hcel-parse-package-id package-id "-")))) + (lambda (x y) + (string> (file-name-base x) + (file-name-base y)))))) (message "Cannot find org file for %s, opening instead that of the highest available version %s." package-id (file-name-base (car files))) -- cgit v1.2.3