aboutsummaryrefslogtreecommitdiff
path: root/sx-question.el
diff options
context:
space:
mode:
authorSean Allred <code@seanallred.com>2014-12-27 17:53:25 -0500
committerSean Allred <code@seanallred.com>2014-12-27 17:53:25 -0500
commit1267f300c850173e74dda0b7f704261b4a25b85c (patch)
tree5530b3fd47a84857ea68888c7fe688a5efca3629 /sx-question.el
parent531d3d911990a5f9eed6646af24b2f55ae128aa3 (diff)
parent1ab0df0975e67a626c95d89120ae0c0e2fdcf9ff (diff)
Merge pull request #181 from vermiculus/issue-180--mark-hidden
Fix `sx-question--mark-hidden', which was just plain wrong.
Diffstat (limited to 'sx-question.el')
-rw-r--r--sx-question.el15
1 files changed, 7 insertions, 8 deletions
diff --git a/sx-question.el b/sx-question.el
index 801384a..03ebb4b 100644
--- a/sx-question.el
+++ b/sx-question.el
@@ -159,14 +159,13 @@ If no cache exists for it, initialize one with SITE."
(let ((site-cell (assoc .site sx-question--user-hidden-list)))
;; 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?
+ (if (null site-cell)
+ ;; First question from this site.
+ (push (list .site .question_id) sx-question--user-hidden-list)
+ ;; Not first question and question wasn't present.
+ ;; Add it in, but make sure it's sorted (just in case we
+ ;; decide to rely on it later).
+ (sx-sorted-insert-skip-first .question_id site-cell >))
;; Save the results.
(sx-cache-set 'hidden-questions sx-question--user-hidden-list)))))