aboutsummaryrefslogtreecommitdiff
path: root/sx-question.el
diff options
context:
space:
mode:
authorSean Allred <code@seanallred.com>2014-11-29 09:36:59 -0500
committerSean Allred <code@seanallred.com>2014-11-29 09:36:59 -0500
commitf5ca9c6d7629817569c3bd58e5569fee88cd5f2b (patch)
treebcbbdcb2e2fdc91f9431d3b3ad605aa0a7fa0bde /sx-question.el
parenta8e882d99a037075595260dc74fad0fb67c69d81 (diff)
parent00a187f5bb7dc08117965eae05df51d0eedac90e (diff)
Merge branch 'master' into issue-100
Conflicts: sx-question-mode.el
Diffstat (limited to 'sx-question.el')
-rw-r--r--sx-question.el32
1 files changed, 17 insertions, 15 deletions
diff --git a/sx-question.el b/sx-question.el
index a7aadb2..f80a9bd 100644
--- a/sx-question.el
+++ b/sx-question.el
@@ -1,4 +1,4 @@
-;;; sx-question.el --- question logic for stack-mode -*- lexical-binding: t; -*-
+;;; sx-question.el --- question logic
;; Copyright (C) 2014 Sean Allred
@@ -134,20 +134,21 @@ If no cache exists for it, initialize one with SITE."
(defun sx-question--mark-hidden (question)
"Mark QUESTION as being hidden."
- (let ((site-cell (assoc .site sx-question--user-hidden-list))
- cell)
- ;; If question already hidden, do nothing.
- (unless (memq .question_id site-cell)
- ;; First question from this site.
- (push (list .site .question_id) sx-question--user-hidden-list)
- ;; Question wasn't present.
- ;; Add it in, but make sure it's sorted (just in case we need
- ;; it later).
- (sx-sorted-insert-skip-first .question_id site-cell >)
- ;; This causes a small lag on `j' and `k' as the list gets large.
- ;; Should we do this on a timer?
- ;; Save the results.
- (sx-cache-set 'hidden-questions sx-question--user-hidden-list))))
+ (sx-assoc-let question
+ (let ((site-cell (assoc .site sx-question--user-hidden-list))
+ cell)
+ ;; If question already hidden, do nothing.
+ (unless (memq .question_id site-cell)
+ ;; First question from this site.
+ (push (list .site .question_id) sx-question--user-hidden-list)
+ ;; Question wasn't present.
+ ;; Add it in, but make sure it's sorted (just in case we need
+ ;; it later).
+ (sx-sorted-insert-skip-first .question_id site-cell >)
+ ;; This causes a small lag on `j' and `k' as the list gets large.
+ ;; Should we do this on a timer?
+ ;; Save the results.
+ (sx-cache-set 'hidden-questions sx-question--user-hidden-list)))))
;;;; Other data
@@ -167,4 +168,5 @@ If no cache exists for it, initialize one with SITE."
;; Local Variables:
;; indent-tabs-mode: nil
+;; lexical-binding: t
;; End: