Move known links to front of link list only in older Org versions

This behavior became the default in Org 9.7.
This commit is contained in:
Daniel Borchmann 2024-06-08 10:41:07 +02:00
parent de68fc30b2
commit 01a71c93d2
No known key found for this signature in database
GPG Key ID: 784AA8DF0CCDF625

View File

@ -827,6 +827,10 @@
:autoload (org-link-set-parameters) :autoload (org-link-set-parameters)
:config (progn :config (progn
(when (version< (org-version) "9.7")
;; Pushing already stored links to the front of `org-stored-links' became default
;; behavior in Org 9.7, the below code is thus only needed for older versions.
(define-advice org-store-link (:around (define-advice org-store-link (:around
(orig-func &rest args) (orig-func &rest args)
db/org--push-new-links-to-beginning) db/org--push-new-links-to-beginning)
@ -865,7 +869,7 @@
(member x org-stored-links--new)) (member x org-stored-links--new))
org-stored-links--original)))) org-stored-links--original))))
org-store-link--return-value)) org-store-link--return-value)))
(define-advice org-link-make-string (:around (define-advice org-link-make-string (:around
(orig-func link &optional description) (orig-func link &optional description)