summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-03-04 01:03:45 -0500
committerKyle Meyer <kyle@kyleam.com>2015-03-04 01:03:45 -0500
commit39f336c03edd26a77b5ce3fe3b5d80ff36b6f9c9 (patch)
tree598c5500003e18fb45a5f77e3f09d818c87ef685
parent06551c1754e884504ab5318986c9b9f79d5266b3 (diff)
downloadbog-39f336c03edd26a77b5ce3fe3b5d80ff36b6f9c9.tar.gz
bog-create-combined-bib: Fix citekey sorting
Sort citekeys after they're collected from marked files so that the list is sorted alphabetically, order and then alphabetically. (This fixes behavior that was introduced in 87f4e2ce8.)
-rw-r--r--bog.el12
1 files changed, 7 insertions, 5 deletions
diff --git a/bog.el b/bog.el
index 950e560..bc1dd87 100644
--- a/bog.el
+++ b/bog.el
@@ -762,11 +762,13 @@ Otherwise, collect citekeys the current buffer."
(let ((bib-buffer-name "*Bog combined bib*")
citekeys
citekey-bibs)
- (if (derived-mode-p 'dired-mode)
- (setq citekeys
- (delete-dups (cl-mapcan #'bog-citekeys-in-file
- (dired-get-marked-files nil arg))))
- (setq citekeys (bog-citekeys-in-buffer)))
+ (let ((bog--no-sort t))
+ (if (derived-mode-p 'dired-mode)
+ (setq citekeys
+ (delete-dups (cl-mapcan #'bog-citekeys-in-file
+ (dired-get-marked-files nil arg))))
+ (setq citekeys (bog-citekeys-in-buffer))))
+ (setq citekeys (sort citekeys #'string-lessp))
(setq citekey-bibs
(mapcar (lambda (ck) (cons ck (bog-citekey-as-bib ck)))
citekeys))