diff options
author | Sean Allred <code@seanallred.com> | 2015-01-02 12:13:28 -0500 |
---|---|---|
committer | Sean Allred <code@seanallred.com> | 2015-01-02 12:13:28 -0500 |
commit | 9a420bffcc426b4826f14ad1f62b5430750821df (patch) | |
tree | 9d5ff1e26d2b8019031895acdb9d030116e35d6f /sx-interaction.el | |
parent | 51fd9620672ce656a0c660ad9e3a940cc9b435f3 (diff) | |
parent | 0325369632523a81e4246533e4067ebd57f7a0e7 (diff) |
Merge pull request #183 from vermiculus/search
Search
Diffstat (limited to 'sx-interaction.el')
-rw-r--r-- | sx-interaction.el | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sx-interaction.el b/sx-interaction.el index b2673c8..3877035 100644 --- a/sx-interaction.el +++ b/sx-interaction.el @@ -364,6 +364,18 @@ from context at point." (sx-site-get-api-tokens) nil t nil nil default))) +(defun sx--maybe-site-prompt (arg) + "Get a site token conditionally in an interactive context. +If ARG is non-nil, use `sx--interactive-site-prompt'. +Otherwise, use `sx-question-list--site' if non-nil. +If nil, use `sx--interactive-site-prompt' anyway." + ;; This could eventually be generalized into (sx--maybe-prompt + ;; prefix-arg value-if-non-nil #'prompt-function). + (if arg + (sx--interactive-site-prompt) + (or sx-question-list--site + (sx--interactive-site-prompt)))) + ;;;###autoload (defun sx-ask (site) "Start composing a question for SITE. |