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.
This commit is contained in:
parent
6e560c7134
commit
67aa99ff06
3 changed files with 57 additions and 31 deletions
|
@ -1,3 +1,16 @@
|
||||||
|
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>
|
2011-07-01 Daiki Ueno <ueno@unixuser.org>
|
||||||
|
|
||||||
* auth-source.el (auth-source-token-passphrase-callback-function):
|
* 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)))
|
(goto-char (point-min)))
|
||||||
(message-pop-to-buffer "*Gnus Bug*"))
|
(message-pop-to-buffer "*Gnus Bug*"))
|
||||||
(let ((message-this-is-mail t))
|
(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
|
(when gnus-bug-create-help-buffer
|
||||||
(push `(gnus-bug-kill-buffer) message-send-actions))
|
(push `(gnus-bug-kill-buffer) message-send-actions))
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
|
@ -1463,6 +1468,7 @@ If YANK is non-nil, include the original article."
|
||||||
(forward-line 1)
|
(forward-line 1)
|
||||||
(insert (format "Package: %s\n" gnus-bug-package))
|
(insert (format "Package: %s\n" gnus-bug-package))
|
||||||
(insert (format "Version: %s\n" (gnus-continuum-version)))
|
(insert (format "Version: %s\n" (gnus-continuum-version)))
|
||||||
|
(insert "\n")
|
||||||
(insert (gnus-version) "\n"
|
(insert (gnus-version) "\n"
|
||||||
(emacs-version) "\n")
|
(emacs-version) "\n")
|
||||||
(when (and (boundp 'nntp-server-type)
|
(when (and (boundp 'nntp-server-type)
|
||||||
|
@ -1474,7 +1480,10 @@ If YANK is non-nil, include the original article."
|
||||||
(erase-buffer)
|
(erase-buffer)
|
||||||
(gnus-debug)
|
(gnus-debug)
|
||||||
(setq text (buffer-string)))
|
(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))
|
(goto-char (point-min))
|
||||||
(search-forward "Subject: " nil t)
|
(search-forward "Subject: " nil t)
|
||||||
(message "")))
|
(message "")))
|
||||||
|
|
|
@ -672,7 +672,8 @@ Add an entry here when adding a new search engine.")
|
||||||
(list
|
(list
|
||||||
(cons 'query (format "HEADER Message-ID %s" article))
|
(cons 'query (format "HEADER Message-ID %s" article))
|
||||||
(cons 'unique-id article)
|
(cons 'unique-id article)
|
||||||
(cons 'criteria "")))
|
(cons 'criteria "")
|
||||||
|
(cons 'shortcut t)))
|
||||||
(unless (and (equal query nnir-current-query)
|
(unless (and (equal query nnir-current-query)
|
||||||
(equal server nnir-current-server))
|
(equal server nnir-current-server))
|
||||||
(setq nnir-artlist (nnir-run-imap query 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)
|
(defun nnir-run-imap (query srv &optional groups)
|
||||||
"Run a search against an IMAP back-end server.
|
"Run a search against an IMAP back-end server.
|
||||||
This uses a custom query language parser; see `nnir-imap-make-query' for
|
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
|
(save-excursion
|
||||||
(let ((qstring (cdr (assq 'query query)))
|
(let ((qstring (cdr (assq 'query query)))
|
||||||
(server (cadr (gnus-server-to-method srv)))
|
(server (cadr (gnus-server-to-method srv)))
|
||||||
|
@ -804,33 +805,36 @@ details on the language and supported extensions"
|
||||||
(message "Opening server %s" server)
|
(message "Opening server %s" server)
|
||||||
(apply
|
(apply
|
||||||
'vconcat
|
'vconcat
|
||||||
(mapcar
|
(catch 'found
|
||||||
(lambda (group)
|
(mapcar
|
||||||
(let (artlist)
|
(lambda (group)
|
||||||
(condition-case ()
|
(let (artlist)
|
||||||
(when (nnimap-possibly-change-group
|
(condition-case ()
|
||||||
(gnus-group-short-name group) server)
|
(when (nnimap-possibly-change-group
|
||||||
(with-current-buffer (nnimap-buffer)
|
(gnus-group-short-name group) server)
|
||||||
(message "Searching %s..." group)
|
(with-current-buffer (nnimap-buffer)
|
||||||
(let ((arts 0)
|
(message "Searching %s..." group)
|
||||||
(result (nnimap-command "UID SEARCH %s"
|
(let ((arts 0)
|
||||||
(if (string= criteria "")
|
(result (nnimap-command "UID SEARCH %s"
|
||||||
qstring
|
(if (string= criteria "")
|
||||||
(nnir-imap-make-query
|
qstring
|
||||||
criteria qstring)))))
|
(nnir-imap-make-query
|
||||||
(mapc
|
criteria qstring)))))
|
||||||
(lambda (artnum)
|
(mapc
|
||||||
(let ((artn (string-to-number artnum)))
|
(lambda (artnum)
|
||||||
(when (> artn 0)
|
(let ((artn (string-to-number artnum)))
|
||||||
(push (vector group artn 100)
|
(when (> artn 0)
|
||||||
artlist)
|
(push (vector group artn 100)
|
||||||
(setq arts (1+ arts)))))
|
artlist)
|
||||||
(and (car result) (cdr (assoc "SEARCH" (cdr result)))))
|
(when (assq 'shortcut query)
|
||||||
(message "Searching %s... %d matches" group arts)))
|
(throw 'found (list artlist)))
|
||||||
(message "Searching %s...done" group))
|
(setq arts (1+ arts)))))
|
||||||
(quit nil))
|
(and (car result) (cdr (assoc "SEARCH" (cdr result)))))
|
||||||
(nreverse artlist)))
|
(message "Searching %s... %d matches" group arts)))
|
||||||
groups)))))
|
(message "Searching %s...done" group))
|
||||||
|
(quit nil))
|
||||||
|
(nreverse artlist)))
|
||||||
|
groups))))))
|
||||||
|
|
||||||
(defun nnir-imap-make-query (criteria qstring)
|
(defun nnir-imap-make-query (criteria qstring)
|
||||||
"Parse the query string and criteria into an appropriate IMAP search
|
"Parse the query string and criteria into an appropriate IMAP search
|
||||||
|
|
Loading…
Add table
Reference in a new issue