(setq keys (org-ref-split-and-strip-string link-string))
(setq years (mapcar 'org-ref-get-citation-year keys))
(setq data (mapcar* (lambda (a b) `(,a . ,b)) years keys))
(setq keys (org-ref-split-and-strip-string link-string))
(setq years (mapcar 'org-ref-get-citation-year keys))
(setq data (mapcar* (lambda (a b) `(,a . ,b)) years keys))
;; now get the keys separated by commas
(setq keys (mapconcat (lambda (x) (cdr x)) data ","))
;; and replace the link with the sorted keys
;; now get the keys separated by commas
(setq keys (mapconcat (lambda (x) (cdr x)) data ","))
;; and replace the link with the sorted keys