diff options
-rw-r--r-- | elogt.el | 31 |
1 files changed, 29 insertions, 2 deletions
@@ -197,6 +197,26 @@ Return opened buffer (done via `find-file')." (tabulated-list-print t) (message "The ElogT table is ready.")) +(defun elogt-sort-package () + "Sort the ElogT table by package, ascending." + (interactive) + (tabulated-list-sort 2)) + +(defun elogt-sort-category () + "Sort the ElogT table by category, ascending." + (interactive) + (tabulated-list-sort 1)) + +(defun elogt-sort-priority () + "Sort the ElogT table by priority, ascending." + (interactive) + (tabulated-list-sort 0)) + +(defun elogt-sort-time () + "Sort the ElogT table by time, descending." + (interactive) + (tabulated-list-sort 3)) + ;; Major mode @@ -205,10 +225,17 @@ Return opened buffer (done via `find-file')." (defvar elogt-mode-map (let ((elogt-mode-map (make-keymap))) - (define-key elogt-mode-map (kbd "/") #'isearch-forward) + ;; Standard key bindings. (define-key elogt-mode-map (kbd "o") #'elogt-open-entry) (define-key elogt-mode-map (kbd "d") #'elogt-delete-entry) (define-key elogt-mode-map (kbd "g") #'elogt-refresh-table) + ;; Elogv key bindings. + (define-key elogt-mode-map (kbd "A") #'elogt-sort-package) + (define-key elogt-mode-map (kbd "a") #'elogt-sort-category) + (define-key elogt-mode-map (kbd "c") #'elogt-sort-priority) + (define-key elogt-mode-map (kbd "t") #'elogt-sort-time) + ;; Miscellaneous key bindings. + (define-key elogt-mode-map (kbd "/") #'isearch-forward) elogt-mode-map) "Key map for `elogt' major mode.") @@ -221,7 +248,7 @@ Return opened buffer (done via `find-file')." ("Package" 30 t) ("Time" 20 t) ("Size" 10 t)]) - (setq tabulated-list-sort-key (cons "Time" t)) + (setq tabulated-list-sort-key '("Time" . t)) (run-hooks 'elogt-mode-hook) (use-local-map elogt-mode-map)) |