diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-01-16 13:07:20 -0200 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-01-16 13:07:20 -0200 |
commit | 574944fa6ca61ce07e0eb059711ead2b74891e44 (patch) | |
tree | facfe1ef83d2eace51dc170a19e8a1e11e70c90f /sx-search.el | |
parent | 7a75cd61e822a4895b85bc17780b163bd6876ca7 (diff) | |
parent | 389e433953bba4003b102748dbbf5f8a9b421a51 (diff) |
Merge branch 'master' into more-tests
Diffstat (limited to 'sx-search.el')
-rw-r--r-- | sx-search.el | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/sx-search.el b/sx-search.el index 2633da9..aefd12e 100644 --- a/sx-search.el +++ b/sx-search.el @@ -1,4 +1,4 @@ -;;; sx-search.el --- Searching for questions. -*- lexical-binding: t; -*- +;;; sx-search.el --- searching for questions -*- lexical-binding: t; -*- ;; Copyright (C) 2014 Artur Malabarba @@ -19,7 +19,7 @@ ;;; Commentary: -;; Implements sarch functionality. The basic function is +;; Implements search functionality. The basic function is ;; `sx-search-get-questions', which returns an array of questions ;; according to a search term. ;; @@ -32,13 +32,11 @@ (require 'sx) (require 'sx-question-list) +(require 'sx-tag) (defvar sx-search--query-history nil "Query history for interactive prompts.") -(defvar sx-search--tag-history nil - "Tags history for interactive prompts.") - ;;; Basic function (defun sx-search-get-questions (site page query &optional tags excluded-tags keywords) @@ -84,15 +82,12 @@ prefix argument, the user is asked for everything." (when (string= query "") (setq query nil)) (when current-prefix-arg - (setq tags (sx--multiple-read - (format "Tags (%s)" - (if query "optional" "mandatory")) - 'sx-search--tag-history)) + (setq tags (sx-tag-multiple-read + site (concat "Tags" (when query " (optional)")))) (when (and (not query) (string= "" tags)) (sx-user-error "Must supply either QUERY or TAGS")) (setq excluded-tags - (sx--multiple-read - "Excluded tags (optional)" 'sx-search--tag-history))) + (sx-tag-multiple-read site "Excluded tags (optional)"))) (list site query tags excluded-tags))) ;; Here starts the actual function @@ -110,3 +105,7 @@ prefix argument, the user is asked for everything." (provide 'sx-search) ;;; sx-search.el ends here + +;; Local Variables: +;; indent-tabs-mode: nil +;; End: |