From 39f336c03edd26a77b5ce3fe3b5d80ff36b6f9c9 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Wed, 4 Mar 2015 01:03:45 -0500 Subject: 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.) --- bog.el | 12 +++++++----- 1 file 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)) -- cgit v1.2.3