aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sx-question-list.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/sx-question-list.el b/sx-question-list.el
index 45982a4..e1ea349 100644
--- a/sx-question-list.el
+++ b/sx-question-list.el
@@ -440,17 +440,18 @@ relevant window."
(defun sx-question-list-switch-site (site)
"Switch the current site to SITE and display its questions.
-Uses `ido-completing-read' if variable `ido-mode' is active. Retrieves
-completions from `sx-site-get-api-tokens'. Sets
-`sx-question-list--current-site' and then
+Use `ido-completing-read' if variable `ido-mode' is active.
+Retrieve completions from `sx-site-get-api-tokens'.
+Sets `sx-question-list--current-site' and then call
`sx-question-list-refresh' with `redisplay'."
(interactive
(list (funcall (if ido-mode #'ido-completing-read #'completing-read)
"Switch to site: " (sx-site-get-api-tokens)
(lambda (site) (not (equal site sx-question-list--current-site)))
t)))
- (setq sx-question-list--current-site site)
- (sx-question-list-refresh 'redisplay))
+ (when (and (stringp site) (> (length site) 0))
+ (setq sx-question-list--current-site site)
+ (sx-question-list-refresh 'redisplay)))
(provide 'sx-question-list)
;;; sx-question-list.el ends here