aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGnus developers2011-07-02 13:26:49 +0000
committerKatsumi Yamaoka2011-07-02 13:26:49 +0000
commit67aa99ff0699ce18b97c4a72cdb000c030dbbebe (patch)
tree07e65ea1a1c93cbd28a74c1100b336791c3066a8
parent6e560c713408d95269e14c879ad3b0b59b536df9 (diff)
downloademacs-67aa99ff0699ce18b97c4a72cdb000c030dbbebe.tar.gz
emacs-67aa99ff0699ce18b97c4a72cdb000c030dbbebe.zip
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.
-rw-r--r--lisp/gnus/ChangeLog13
-rw-r--r--lisp/gnus/gnus-msg.el13
-rw-r--r--lisp/gnus/nnir.el62
3 files changed, 57 insertions, 31 deletions
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 @@
12011-07-02 Andrew Cohen <cohen@andy.bu.edu>
2
3 * nnir.el (nnir-run-imap): Allow halting a search when an article is
4 found by setting `shortcut' in 'query.
5 (nnir-request-article): Use `shortcut' setting when requesting article
6 by Message-ID.
7
82011-07-02 Teodor Zlatanov <tzz@lifelogs.com>
9
10 * gnus-msg.el (gnus-bug): Give the Version and Package headers to
11 debbugs with the X-Debbugs-Package and X-Debbugs-Version headers.
12 Bring the pseudo-headers back too.
13
12011-07-01 Daiki Ueno <ueno@unixuser.org> 142011-07-01 Daiki Ueno <ueno@unixuser.org>
2 15
3 * auth-source.el (auth-source-token-passphrase-callback-function): 16 * 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."
1455 (goto-char (point-min))) 1455 (goto-char (point-min)))
1456 (message-pop-to-buffer "*Gnus Bug*")) 1456 (message-pop-to-buffer "*Gnus Bug*"))
1457 (let ((message-this-is-mail t)) 1457 (let ((message-this-is-mail t))
1458 (message-setup `((To . ,gnus-maintainer) (Subject . "")))) 1458 (message-setup `((To . ,gnus-maintainer)
1459 (Subject . "")
1460 (X-Debbugs-Package
1461 . ,(format "%s" gnus-bug-package))
1462 (X-Debbugs-Version
1463 . ,(format "%s" (gnus-continuum-version))))))
1459 (when gnus-bug-create-help-buffer 1464 (when gnus-bug-create-help-buffer
1460 (push `(gnus-bug-kill-buffer) message-send-actions)) 1465 (push `(gnus-bug-kill-buffer) message-send-actions))
1461 (goto-char (point-min)) 1466 (goto-char (point-min))
@@ -1463,6 +1468,7 @@ If YANK is non-nil, include the original article."
1463 (forward-line 1) 1468 (forward-line 1)
1464 (insert (format "Package: %s\n" gnus-bug-package)) 1469 (insert (format "Package: %s\n" gnus-bug-package))
1465 (insert (format "Version: %s\n" (gnus-continuum-version))) 1470 (insert (format "Version: %s\n" (gnus-continuum-version)))
1471 (insert "\n")
1466 (insert (gnus-version) "\n" 1472 (insert (gnus-version) "\n"
1467 (emacs-version) "\n") 1473 (emacs-version) "\n")
1468 (when (and (boundp 'nntp-server-type) 1474 (when (and (boundp 'nntp-server-type)
@@ -1474,7 +1480,10 @@ If YANK is non-nil, include the original article."
1474 (erase-buffer) 1480 (erase-buffer)
1475 (gnus-debug) 1481 (gnus-debug)
1476 (setq text (buffer-string))) 1482 (setq text (buffer-string)))
1477 (insert "<#part type=application/emacs-lisp disposition=inline description=\"User settings\">\n" text "\n<#/part>")) 1483 (insert (concat "<#part type=application/emacs-lisp"
1484 "disposition=inline description=\"User settings\">\n"
1485 text
1486 "\n<#/part>")))
1478 (goto-char (point-min)) 1487 (goto-char (point-min))
1479 (search-forward "Subject: " nil t) 1488 (search-forward "Subject: " nil t)
1480 (message ""))) 1489 (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.")
672 (list 672 (list
673 (cons 'query (format "HEADER Message-ID %s" article)) 673 (cons 'query (format "HEADER Message-ID %s" article))
674 (cons 'unique-id article) 674 (cons 'unique-id article)
675 (cons 'criteria ""))) 675 (cons 'criteria "")
676 (cons 'shortcut t)))
676 (unless (and (equal query nnir-current-query) 677 (unless (and (equal query nnir-current-query)
677 (equal server nnir-current-server)) 678 (equal server nnir-current-server))
678 (setq nnir-artlist (nnir-run-imap query server)) 679 (setq nnir-artlist (nnir-run-imap query server))
@@ -791,7 +792,7 @@ ready to be added to the list of search results."
791(defun nnir-run-imap (query srv &optional groups) 792(defun nnir-run-imap (query srv &optional groups)
792 "Run a search against an IMAP back-end server. 793 "Run a search against an IMAP back-end server.
793This uses a custom query language parser; see `nnir-imap-make-query' for 794This uses a custom query language parser; see `nnir-imap-make-query' for
794details on the language and supported extensions" 795details on the language and supported extensions."
795 (save-excursion 796 (save-excursion
796 (let ((qstring (cdr (assq 'query query))) 797 (let ((qstring (cdr (assq 'query query)))
797 (server (cadr (gnus-server-to-method srv))) 798 (server (cadr (gnus-server-to-method srv)))
@@ -804,33 +805,36 @@ details on the language and supported extensions"
804 (message "Opening server %s" server) 805 (message "Opening server %s" server)
805 (apply 806 (apply
806 'vconcat 807 'vconcat
807 (mapcar 808 (catch 'found
808 (lambda (group) 809 (mapcar
809 (let (artlist) 810 (lambda (group)
810 (condition-case () 811 (let (artlist)
811 (when (nnimap-possibly-change-group 812 (condition-case ()
812 (gnus-group-short-name group) server) 813 (when (nnimap-possibly-change-group
813 (with-current-buffer (nnimap-buffer) 814 (gnus-group-short-name group) server)
814 (message "Searching %s..." group) 815 (with-current-buffer (nnimap-buffer)
815 (let ((arts 0) 816 (message "Searching %s..." group)
816 (result (nnimap-command "UID SEARCH %s" 817 (let ((arts 0)
817 (if (string= criteria "") 818 (result (nnimap-command "UID SEARCH %s"
818 qstring 819 (if (string= criteria "")
819 (nnir-imap-make-query 820 qstring
820 criteria qstring))))) 821 (nnir-imap-make-query
821 (mapc 822 criteria qstring)))))
822 (lambda (artnum) 823 (mapc
823 (let ((artn (string-to-number artnum))) 824 (lambda (artnum)
824 (when (> artn 0) 825 (let ((artn (string-to-number artnum)))
825 (push (vector group artn 100) 826 (when (> artn 0)
826 artlist) 827 (push (vector group artn 100)
827 (setq arts (1+ arts))))) 828 artlist)
828 (and (car result) (cdr (assoc "SEARCH" (cdr result))))) 829 (when (assq 'shortcut query)
829 (message "Searching %s... %d matches" group arts))) 830 (throw 'found (list artlist)))
830 (message "Searching %s...done" group)) 831 (setq arts (1+ arts)))))
831 (quit nil)) 832 (and (car result) (cdr (assoc "SEARCH" (cdr result)))))
832 (nreverse artlist))) 833 (message "Searching %s... %d matches" group arts)))
833 groups))))) 834 (message "Searching %s...done" group))
835 (quit nil))
836 (nreverse artlist)))
837 groups))))))
834 838
835(defun nnir-imap-make-query (criteria qstring) 839(defun nnir-imap-make-query (criteria qstring)
836 "Parse the query string and criteria into an appropriate IMAP search 840 "Parse the query string and criteria into an appropriate IMAP search