From 73b380e1407bfc688204812bbf58f9872e57f8c5 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Tue, 25 Nov 2014 02:45:48 +0000 Subject: sx can also updates question-mode buffer. --- sx-question-mode.el | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'sx-question-mode.el') diff --git a/sx-question-mode.el b/sx-question-mode.el index 59313d1..416a4eb 100644 --- a/sx-question-mode.el +++ b/sx-question-mode.el @@ -552,16 +552,21 @@ Letters do not insert themselves; instead, they are commands. (,(kbd "") backward-button) ([return] push-button))) -(defun sx-question-mode-refresh () +(defun sx-question-mode-refresh (&optional no-update) "Refresh currently displayed question. Queries the API for any changes to the question or its answers or -comments, and redisplays it." - (interactive) +comments, and redisplays it. + +With non-nil prefix argument NO-UPDATE, just redisplay, don't +query the api." + (interactive "P") (sx-question-mode--ensure-mode) - (sx-assoc-let sx-question-mode--data - (sx-question-mode--display - (sx-question-get-question .site .question_id) - (selected-window)))) + (sx-question-mode--display + (if no-update + sx-question-mode--data + (sx-assoc-let sx-question-mode--data + (sx-question-get-question .site .question_id))) + (selected-window))) (defun sx-question-mode--ensure-mode () "Ensures we are in question mode, erroring otherwise." -- cgit v1.2.3