summaryrefslogtreecommitdiff
path: root/bog.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2016-01-20 01:49:43 -0500
committerKyle Meyer <kyle@kyleam.com>2016-01-20 01:49:43 -0500
commitc1a295da9b285aecb9e750392f797fde4727bc45 (patch)
tree67abf19166c091bed948dfd4900744edbd2b0a0a /bog.el
parent38acfa7d2d1131ff97d774e6cada26f64b5f3b82 (diff)
downloadbog-c1a295da9b285aecb9e750392f797fde4727bc45.tar.gz
bog-list-orphan-citekeys: Fix sorting in Emacs 25
Diffstat (limited to 'bog.el')
-rw-r--r--bog.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/bog.el b/bog.el
index cecc390..8b465e9 100644
--- a/bog.el
+++ b/bog.el
@@ -493,8 +493,12 @@ file."
(insert "\n")
(dolist (file files)
(let* ((text-cks (bog-non-heading-citekeys-in-file file))
- (nohead-cks (nreverse (cl-set-difference text-cks heading-cks
- :test #'string=))))
+ (nohead-cks (cl-set-difference text-cks heading-cks
+ :test #'string=)))
+ ;; As of Emacs 25.1, `cl-set-difference' keeps the order of
+ ;; LIST1 rather than leaving it reversed.
+ (unless (string-lessp (nth 0 nohead-cks) (nth 1 nohead-cks))
+ (setq nohead-cks (nreverse nohead-cks)))
(when nohead-cks
(insert (format "* %s\n\n%s\n\n"
(file-name-nondirectory file)