diff options
author | Sean Allred <code@seanallred.com> | 2014-11-18 19:45:58 -0500 |
---|---|---|
committer | Sean Allred <code@seanallred.com> | 2014-11-18 19:45:58 -0500 |
commit | 1bdfe21dbbeaa0e88b2d8504624941fdbf53a151 (patch) | |
tree | 7be28b9e71f2378882e7c8d779af700e7f524671 | |
parent | 821bf636028a38562e18d0da0818cd5d09748f97 (diff) | |
parent | cc9e7d491808dda40a0f3f34f0b941f08ed460d8 (diff) |
Merge pull request #76 from vermiculus/mark-read-key
Mark as read with "m"
-rw-r--r-- | sx-question-list.el | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sx-question-list.el b/sx-question-list.el index 7dd0d00..be088c8 100644 --- a/sx-question-list.el +++ b/sx-question-list.el @@ -139,6 +139,7 @@ Letters do not insert themselves; instead, they are commands. (":" sx-question-list-switch-site) ("v" sx-question-list-visit) ("h" sx-question-list-hide) + ("m" sx-question-list-mark-read) ([?\r] sx-question-list-display-question))) (defun sx-question-list-hide (data) @@ -152,6 +153,18 @@ Non-interactively, DATA is a question alist." (when (called-interactively-p 'any) (sx-question-list-refresh 'redisplay 'noupdate))) +(defun sx-question-list-mark-read (data) + "Mark as read question under point. +Non-interactively, DATA is a question alist." + (interactive + (list (if (derived-mode-p 'sx-question-list-mode) + (tabulated-list-get-id) + (user-error "Not in `sx-question-list-mode'")))) + (sx-question--mark-read data) + (sx-question-list-next 1) + (when (called-interactively-p 'any) + (sx-question-list-refresh 'redisplay 'noupdate))) + (defvar sx-question-list--current-page "Latest" ;; Other values (once we implement them) are "Top Voted", ;; "Unanswered", etc. |