From: Gnus developers Date: Sat, 2 Jul 2011 13:26:49 +0000 (+0000) Subject: Merge changes made in Gnus trunk. X-Git-Tag: emacs-pretest-24.0.90~104^2~152^2~251 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=67aa99ff0699ce18b97c4a72cdb000c030dbbebe;p=emacs.git 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. --- diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 1567bfaddd2..07a33fad9ad 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,16 @@ +2011-07-02 Andrew Cohen + + * 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 + + * 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 * auth-source.el (auth-source-token-passphrase-callback-function): diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index 8e382e02cc3..9fdd3bba909 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el @@ -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 ""))) diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el index 732316a71f4..71b85183e0f 100644 --- a/lisp/gnus/nnir.el +++ b/lisp/gnus/nnir.el @@ -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