diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-12-14 12:59:17 +0000 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-12-14 12:59:17 +0000 |
commit | f924a9c58ce30dc62fc61382b1933d8ef51189b5 (patch) | |
tree | 0bdb23e549d68de2a35f68a89504219f0d7e70aa /sx-interaction.el | |
parent | 144db4c35bf902a045b221dae39d5437f7d9fb52 (diff) |
Fix dependency order. sx-tab now requires sx-interaction
Diffstat (limited to 'sx-interaction.el')
-rw-r--r-- | sx-interaction.el | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/sx-interaction.el b/sx-interaction.el index 9b63e0a..0411410 100644 --- a/sx-interaction.el +++ b/sx-interaction.el @@ -44,7 +44,6 @@ (require 'sx-question-mode) (require 'sx-question-list) (require 'sx-compose) -(require 'sx-tab) ;;; Using data in buffer @@ -299,6 +298,21 @@ from context at point." ;;; Asking +(defcustom sx-default-site "emacs" + "Name of the site to use by default when listing questions." + :type 'string + :group 'sx) + +(defun sx--interactive-site-prompt () + "Query the user for a site." + (let ((default (or sx-question-list--site + (sx-assoc-let sx-question-mode--data .site) + sx-default-site))) + (funcall (if ido-mode #'ido-completing-read #'completing-read) + (format "Site (%s): " default) + (sx-site-get-api-tokens) nil t nil nil + default))) + (defun sx-ask (site) "Start composing a question for SITE. SITE is a string, indicating where the question will be posted." @@ -308,7 +322,7 @@ SITE is a string, indicating where the question will be posted." (sx-compose-create site nil nil ;; After send functions - (list (lambda (_ res) (sx--maybe-update-display buffer))))))) + (list (lambda (_b _res) (sx--maybe-update-display buffer))))))) ;;; Answering |