diff options
author | Arun Isaac | 2022-08-17 00:24:06 +0530 |
---|---|---|
committer | Arun Isaac | 2022-08-17 00:51:55 +0530 |
commit | e2694487648194865dcc51e5b5492bf3d6a6de99 (patch) | |
tree | 5ceed9eb73e5e8fae1c4829f27d3ad8c68e156b7 | |
parent | 81cb2f254ad8b0e19088b51908d3469cec99fc3e (diff) | |
download | ennum-e2694487648194865dcc51e5b5492bf3d6a6de99.tar.gz ennum-e2694487648194865dcc51e5b5492bf3d6a6de99.tar.lz ennum-e2694487648194865dcc51e5b5492bf3d6a6de99.zip |
Do not pattern match link objects, use the org API.
* ennum.el (ennum--read-post): Do not pattern match link objects. Use
the org API instead.
-rw-r--r-- | ennum.el | 32 |
1 files changed, 15 insertions, 17 deletions
@@ -263,23 +263,21 @@ the current state of all its variables." (let* ((tree (org-element-parse-buffer)) (links (org-element-map tree 'link (lambda (link) - (pcase link - (`(link ,properties . ,_) - (let ((link-type (org-element-property :type link)) - (path (org-element-property :path link))) - (pcase link-type - ("post" - (ennum-make-post-link - :path path - :target-title (if (org-element-contents link) - 'not-required 'required))) - ("video" - (ennum-make-video-link - :path path - :poster (ennum-video-poster path))) - (_ (ennum-make-link - :type (intern link-type) - :path path)))))))))) + (let ((link-type (org-element-property :type link)) + (path (org-element-property :path link))) + (pcase link-type + ("post" + (ennum-make-post-link + :path path + :target-title (if (org-element-contents link) + 'not-required 'required))) + ("video" + (ennum-make-video-link + :path path + :poster (ennum-video-poster path))) + (_ (ennum-make-link + :type (intern link-type) + :path path)))))))) (ennum-make-post :filename filename :slug (file-name-base filename) |