aboutsummaryrefslogtreecommitdiff
path: root/sx-question-list.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-01-01 22:25:00 -0200
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-01-01 22:25:00 -0200
commit6cc480fdab287133d6e09a9ad1eba260b891b604 (patch)
treef54e0334389bb0f017b75b3e91061994f2fc44e3 /sx-question-list.el
parent026a6903e2bcc3a63da3db203b44516d9da3d9e4 (diff)
parente05f937910bb4ca0e7ea1c9f1273fbafac523921 (diff)
Merge branch 'master' into inbox
Conflicts: sx-question.el sx.el
Diffstat (limited to 'sx-question-list.el')
-rw-r--r--sx-question-list.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/sx-question-list.el b/sx-question-list.el
index 4f71251..a5cd005 100644
--- a/sx-question-list.el
+++ b/sx-question-list.el
@@ -333,6 +333,11 @@ Non-interactively, DATA is a question alist."
(tabulated-list-get-id)
(sx-user-error "Not in `sx-question-list-mode'"))))
(sx-question--mark-hidden data)
+ ;; The current entry will not be present after the list is
+ ;; redisplayed. To avoid `tabulated-list-mode' getting lost (and
+ ;; sending us to the top) we move to the next entry before
+ ;; redisplaying.
+ (forward-line 1)
(when (called-interactively-p 'any)
(sx-question-list-refresh 'redisplay 'noupdate)))
@@ -554,12 +559,11 @@ This does not update `sx-question-mode--window'."
(defun sx-question-list-switch-site (site)
"Switch the current site to SITE and display its questions.
-Use `ido-completing-read' if variable `ido-mode' is active.
Retrieve completions from `sx-site-get-api-tokens'.
Sets `sx-question-list--site' and then call
`sx-question-list-refresh' with `redisplay'."
(interactive
- (list (funcall (if ido-mode #'ido-completing-read #'completing-read)
+ (list (sx-completing-read
"Switch to site: " (sx-site-get-api-tokens)
(lambda (site) (not (equal site sx-question-list--site)))
t)))