diff options
| author | Andreas Politz <politza@hochschule-trier.de> | 2018-08-23 17:49:43 +0200 |
|---|---|---|
| committer | Andreas Politz <politza@hochschule-trier.de> | 2018-08-23 17:49:43 +0200 |
| commit | 074fcf9fe2bbdb8587ffdff4f22be8d6eadbb7d5 (patch) | |
| tree | c9649dafb64dff00953c62ca9d1e4d2d030d77c4 /lisp/pdf-annot.el | |
| parent | 8aa7aecf19090692d910036f256f67c1b8968a75 (diff) | |
Fix sorting of annotations by page
Diffstat (limited to 'lisp/pdf-annot.el')
| -rw-r--r-- | lisp/pdf-annot.el | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lisp/pdf-annot.el b/lisp/pdf-annot.el index af027d8..476fd1b 100644 --- a/lisp/pdf-annot.el +++ b/lisp/pdf-annot.el @@ -1502,13 +1502,17 @@ belong to the same page and A1 is displayed above/left of A2." "Unknown date"))))) (define-derived-mode pdf-annot-list-mode tablist-mode "Annots" - (setq tabulated-list-entries 'pdf-annot-list-entries - tabulated-list-format (vector - '("Pg." 3 t :read-only t :right-align t) - `("Type" 10 t :read-only t) - `("Label" 24 t :read-only t) - '("Date" 24 t :read-only t)) - tabulated-list-padding 2) + (let ((page-sorter + (lambda (a b) + (< (string-to-number (aref (cadr a) 0)) + (string-to-number (aref (cadr b) 0)))))) + (setq tabulated-list-entries 'pdf-annot-list-entries + tabulated-list-format (vector + `("Pg." 3 ,page-sorter :read-only t :right-align t) + `("Type" 10 t :read-only t) + `("Label" 24 t :read-only t) + '("Date" 24 t :read-only t)) + tabulated-list-padding 2)) (set-keymap-parent pdf-annot-list-mode-map tablist-mode-map) (use-local-map pdf-annot-list-mode-map) (setq tablist-current-filter |
