diff options
author | Yuchen Pei <hi@ypei.me> | 2022-09-30 09:55:13 +1000 |
---|---|---|
committer | Yuchen Pei <hi@ypei.me> | 2022-09-30 09:55:13 +1000 |
commit | 204d78168f394904ecbea51d087c7658fc28a9a8 (patch) | |
tree | 8a10efda15b5e46410c1c9e98bc406d37e7e535e | |
parent | 76d1a74a4572c83abbe81265d1f38d95de9de309 (diff) |
a tiny bug
-rw-r--r-- | hcel-haddorg.el | 18 |
1 files 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))) |