Commit 67aa99ff authored by Gnus developers's avatar Gnus developers Committed by Katsumi Yamaoka
Browse files

Merge changes made in Gnus trunk.

nnir.el (nnir-run-imap): Allow halting a search when an article is found by setting `shortcut' in 'query.
 (nnir-request-article): Use `shortcut' setting when requesting article by Message-ID.
gnus-msg.el (gnus-bug): Give the Version and Package headers to debbugs with the X-Debbugs-Package and X-Debbugs-Version headers.  Bring the pseudo-headers back too.
parent 6e560c71
2011-07-02 Andrew Cohen <cohen@andy.bu.edu>
* nnir.el (nnir-run-imap): Allow halting a search when an article is
found by setting `shortcut' in 'query.
(nnir-request-article): Use `shortcut' setting when requesting article
by Message-ID.
2011-07-02 Teodor Zlatanov <tzz@lifelogs.com>
* gnus-msg.el (gnus-bug): Give the Version and Package headers to
debbugs with the X-Debbugs-Package and X-Debbugs-Version headers.
Bring the pseudo-headers back too.
2011-07-01 Daiki Ueno <ueno@unixuser.org>
 
* auth-source.el (auth-source-token-passphrase-callback-function):
......
......@@ -1455,7 +1455,12 @@ If YANK is non-nil, include the original article."
(goto-char (point-min)))
(message-pop-to-buffer "*Gnus Bug*"))
(let ((message-this-is-mail t))
(message-setup `((To . ,gnus-maintainer) (Subject . ""))))
(message-setup `((To . ,gnus-maintainer)
(Subject . "")
(X-Debbugs-Package
. ,(format "%s" gnus-bug-package))
(X-Debbugs-Version
. ,(format "%s" (gnus-continuum-version))))))
(when gnus-bug-create-help-buffer
(push `(gnus-bug-kill-buffer) message-send-actions))
(goto-char (point-min))
......@@ -1463,6 +1468,7 @@ If YANK is non-nil, include the original article."
(forward-line 1)
(insert (format "Package: %s\n" gnus-bug-package))
(insert (format "Version: %s\n" (gnus-continuum-version)))
(insert "\n")
(insert (gnus-version) "\n"
(emacs-version) "\n")
(when (and (boundp 'nntp-server-type)
......@@ -1474,7 +1480,10 @@ If YANK is non-nil, include the original article."
(erase-buffer)
(gnus-debug)
(setq text (buffer-string)))
(insert "<#part type=application/emacs-lisp disposition=inline description=\"User settings\">\n" text "\n<#/part>"))
(insert (concat "<#part type=application/emacs-lisp"
"disposition=inline description=\"User settings\">\n"
text
"\n<#/part>")))
(goto-char (point-min))
(search-forward "Subject: " nil t)
(message "")))
......
......@@ -672,7 +672,8 @@ Add an entry here when adding a new search engine.")
(list
(cons 'query (format "HEADER Message-ID %s" article))
(cons 'unique-id article)
(cons 'criteria "")))
(cons 'criteria "")
(cons 'shortcut t)))
(unless (and (equal query nnir-current-query)
(equal server nnir-current-server))
(setq nnir-artlist (nnir-run-imap query server))
......@@ -791,7 +792,7 @@ ready to be added to the list of search results."
(defun nnir-run-imap (query srv &optional groups)
"Run a search against an IMAP back-end server.
This uses a custom query language parser; see `nnir-imap-make-query' for
details on the language and supported extensions"
details on the language and supported extensions."
(save-excursion
(let ((qstring (cdr (assq 'query query)))
(server (cadr (gnus-server-to-method srv)))
......@@ -804,33 +805,36 @@ details on the language and supported extensions"
(message "Opening server %s" server)
(apply
'vconcat
(mapcar
(lambda (group)
(let (artlist)
(condition-case ()
(when (nnimap-possibly-change-group
(gnus-group-short-name group) server)
(with-current-buffer (nnimap-buffer)
(message "Searching %s..." group)
(let ((arts 0)
(result (nnimap-command "UID SEARCH %s"
(if (string= criteria "")
qstring
(nnir-imap-make-query
criteria qstring)))))
(mapc
(lambda (artnum)
(let ((artn (string-to-number artnum)))
(when (> artn 0)
(push (vector group artn 100)
artlist)
(setq arts (1+ arts)))))
(and (car result) (cdr (assoc "SEARCH" (cdr result)))))
(message "Searching %s... %d matches" group arts)))
(message "Searching %s...done" group))
(quit nil))
(nreverse artlist)))
groups)))))
(catch 'found
(mapcar
(lambda (group)
(let (artlist)
(condition-case ()
(when (nnimap-possibly-change-group
(gnus-group-short-name group) server)
(with-current-buffer (nnimap-buffer)
(message "Searching %s..." group)
(let ((arts 0)
(result (nnimap-command "UID SEARCH %s"
(if (string= criteria "")
qstring
(nnir-imap-make-query
criteria qstring)))))
(mapc
(lambda (artnum)
(let ((artn (string-to-number artnum)))
(when (> artn 0)
(push (vector group artn 100)
artlist)
(when (assq 'shortcut query)
(throw 'found (list artlist)))
(setq arts (1+ arts)))))
(and (car result) (cdr (assoc "SEARCH" (cdr result)))))
(message "Searching %s... %d matches" group arts)))
(message "Searching %s...done" group))
(quit nil))
(nreverse artlist)))
groups))))))
(defun nnir-imap-make-query (criteria qstring)
"Parse the query string and criteria into an appropriate IMAP search
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment