+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):
(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))
(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)
(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 "")))
(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))
(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)))
(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