diff options
author | Sean Allred <code@seanallred.com> | 2014-12-14 13:41:47 -0500 |
---|---|---|
committer | Sean Allred <code@seanallred.com> | 2014-12-14 13:41:47 -0500 |
commit | cdde177a997f47ca215978056a6cfbec6a6ad0f6 (patch) | |
tree | f6079473cc5b17cc8d8212cf927bb53eb441e718 | |
parent | f924a9c58ce30dc62fc61382b1933d8ef51189b5 (diff) | |
parent | 4bcdd311b590156998ebf51a14fce31b6d0569ec (diff) |
Merge pull request #156 from vermiculus/interface-upgrade
Interface upgrade
-rw-r--r-- | sx-question-list.el | 21 | ||||
-rw-r--r-- | sx-question-mode.el | 22 |
2 files changed, 40 insertions, 3 deletions
diff --git a/sx-question-list.el b/sx-question-list.el index 788fc2f..f23310c 100644 --- a/sx-question-list.el +++ b/sx-question-list.el @@ -196,6 +196,21 @@ and thus not displayed in the list of questions. This is ignored if `sx-question-list--refresh-function' is set.") (make-variable-buffer-local 'sx-question-list--dataset) +(defvar sx-question-list--header-line + '(" " + (:propertize "n p j k" face mode-line-buffer-id) + ": Navigate" + " " + (:propertize "RET" face mode-line-buffer-id) + ": View question" + " " + (:propertize "v" face mode-line-buffer-id) + ": Visit externally" + " " + (:propertize "q" face mode-line-buffer-id) + ": Quit") + "Header-line used on the question list.") + ;;; Mode Definition (define-derived-mode sx-question-list-mode @@ -266,7 +281,7 @@ into consideration. #'sx-question-list-refresh nil t) (add-hook 'tabulated-list-revert-hook #'sx-question-list--update-mode-line nil t) - (tabulated-list-init-header)) + (setq header-line-format sx-question-list--header-line)) (defcustom sx-question-list-date-sort-method 'last_activity_date "Parameter which controls date sorting." @@ -288,8 +303,8 @@ into consideration. (car x) (cadr x))) '( ;; S-down and S-up would collide with `windmove'. - ([down] sx-question-list-view-next) - ([up] sx-question-list-view-previous) + ([down] sx-question-list-next) + ([up] sx-question-list-previous) ("n" sx-question-list-next) ("p" sx-question-list-previous) ("j" sx-question-list-view-next) diff --git a/sx-question-mode.el b/sx-question-mode.el index 5735f47..68618bb 100644 --- a/sx-question-mode.el +++ b/sx-question-mode.el @@ -175,12 +175,34 @@ property." ;;; Major-mode +(defvar sx-question-mode--header-line + '(" " + (:propertize "n p TAB" face mode-line-buffer-id) + ": Navigate" + " " + (:propertize "u d" face mode-line-buffer-id) + ": Up/Down Vote" + " " + (:propertize "c" face mode-line-buffer-id) + ": Comment" + " " + (:propertize "a" face mode-line-buffer-id) + ": Answer" + " " + (:propertize "e" face mode-line-buffer-id) + ": Edit" + " " + (:propertize "q" face mode-line-buffer-id) + ": Quit") + "Header-line used on the question list.") + (define-derived-mode sx-question-mode special-mode "Question" "Major mode to display and navigate a question and its answers. Letters do not insert themselves; instead, they are commands. \\<sx-question-mode> \\{sx-question-mode}" + (setq header-line-format sx-question-mode--header-line) ;; Determine how to close this window. (unless (window-parameter nil 'quit-restore) (set-window-parameter |