aboutsummaryrefslogtreecommitdiff
path: root/sx-tab.el
diff options
context:
space:
mode:
authorSean Allred <code@seanallred.com>2015-01-04 14:07:40 -0500
committerSean Allred <code@seanallred.com>2015-01-04 14:07:40 -0500
commit01df71244d3fe5412e2420127dcd2282d9fa39c7 (patch)
tree0fe936bfa609ea19c454cdcb4d1c2349d5c0c746 /sx-tab.el
parent59327f6f9c6ba419543c47670a62af0aa41271ca (diff)
parent89834aa61adf1fff29379c82ab96629f0b2960d0 (diff)
Merge branch 'master' into filter-macro
Conflicts: sx-filter.el
Diffstat (limited to 'sx-tab.el')
-rw-r--r--sx-tab.el57
1 files changed, 57 insertions, 0 deletions
diff --git a/sx-tab.el b/sx-tab.el
index 32a7784..6a2552f 100644
--- a/sx-tab.el
+++ b/sx-tab.el
@@ -189,5 +189,62 @@ If SITE is nil, use `sx-default-site'."
(file-name-directory load-file-name)))
nil t)
+
+;;; Unanswered
+(sx-tab--define "Unanswered"
+ (lambda (page)
+ (sx-question-get-questions
+ sx-question-list--site page nil 'unanswered)))
+;;;###autoload
+(autoload 'sx-tab-unanswered
+ (expand-file-name
+ "sx-tab"
+ (when load-file-name
+ (file-name-directory load-file-name)))
+ nil t)
+
+
+;;; Unanswered My-tags
+(sx-tab--define "Unanswered-my-tags"
+ (lambda (page)
+ (sx-question-get-questions
+ sx-question-list--site page nil 'unanswered/my-tags)))
+;;;###autoload
+(autoload 'sx-tab-unanswered
+ (expand-file-name
+ "sx-tab"
+ (when load-file-name
+ (file-name-directory load-file-name)))
+ nil t)
+
+
+;;; Featured
+(sx-tab--define "Featured"
+ (lambda (page)
+ (sx-question-get-questions
+ sx-question-list--site page nil 'featured)))
+;;;###autoload
+(autoload 'sx-tab-featured
+ (expand-file-name
+ "sx-tab"
+ (when load-file-name
+ (file-name-directory load-file-name)))
+ nil t)
+
+
+;;; Inter-modes navigation
+(defun sx-tab-meta-or-main ()
+ "Switch to the meta version of a main site, or vice-versa.
+Inside a question, go to the frontpage of the site this question
+belongs to."
+ (interactive)
+ (if (and (derived-mode-p 'sx-question-list-mode)
+ sx-question-list--site)
+ (sx-question-list-switch-site
+ (if (string-match "\\`meta\\." sx-question-list--site)
+ (replace-match "" :fixedcase nil sx-question-list--site)
+ (concat "meta." sx-question-list--site)))
+ (sx-tab-frontpage nil (sx--site (sx--data-here 'question)))))
+
(provide 'sx-tab)
;;; sx-tab.el ends here