diff options
| -rw-r--r-- | lisp/gnus/gnus-search.el | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index cf1cb7f6462..bad2b909c36 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el | |||
| @@ -2233,6 +2233,25 @@ article came from is also searched." | |||
| 2233 | (defvar gnus-group-marked) | 2233 | (defvar gnus-group-marked) |
| 2234 | (defvar gnus-topic-alist) | 2234 | (defvar gnus-topic-alist) |
| 2235 | 2235 | ||
| 2236 | (defvar gnus-search-minibuffer-map | ||
| 2237 | (let ((km (make-sparse-keymap))) | ||
| 2238 | (set-keymap-parent km minibuffer-local-map) | ||
| 2239 | (define-key km (kbd "SPC") #'self-insert-command) | ||
| 2240 | (define-key km (kbd "TAB") #'gnus-search-complete-key) | ||
| 2241 | km)) | ||
| 2242 | |||
| 2243 | (defun gnus-search-complete-key () | ||
| 2244 | "Complete a search key at point. | ||
| 2245 | Used when reading a search query from the minibuffer." | ||
| 2246 | (interactive) | ||
| 2247 | (when (completion-in-region | ||
| 2248 | (save-excursion | ||
| 2249 | (if (re-search-backward " " (minibuffer-prompt-end) t) | ||
| 2250 | (1+ (point)) | ||
| 2251 | (minibuffer-prompt-end))) | ||
| 2252 | (point) gnus-search-expandable-keys) | ||
| 2253 | (insert ":"))) | ||
| 2254 | |||
| 2236 | (defun gnus-search-make-specs (arg &optional specs) | 2255 | (defun gnus-search-make-specs (arg &optional specs) |
| 2237 | (let* ((group-spec | 2256 | (let* ((group-spec |
| 2238 | (or (cdr (assq 'search-group-spec specs)) | 2257 | (or (cdr (assq 'search-group-spec specs)) |
| @@ -2247,7 +2266,9 @@ article came from is also searched." | |||
| 2247 | (query-spec | 2266 | (query-spec |
| 2248 | (or (cdr (assq 'search-query-spec specs)) | 2267 | (or (cdr (assq 'search-query-spec specs)) |
| 2249 | (list (cons 'query | 2268 | (list (cons 'query |
| 2250 | (read-string "Query: " nil 'gnus-search-history)) | 2269 | (read-from-minibuffer |
| 2270 | "Query: " nil gnus-search-minibuffer-map | ||
| 2271 | nil 'gnus-search-history)) | ||
| 2251 | (cons 'no-parse arg))))) | 2272 | (cons 'no-parse arg))))) |
| 2252 | (list (cons 'search-query-spec query-spec) | 2273 | (list (cons 'search-query-spec query-spec) |
| 2253 | (cons 'search-group-spec group-spec)))) | 2274 | (cons 'search-group-spec group-spec)))) |