mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-27 07:37:33 +00:00
Merge changes made in Gnus trunk.
gnus.texi (Expiring Mail): Document gnus-auto-expirable-marks. nnir.el (nnir-notmuch-program, nnir-notmuch-additional-switches, nnir-notmuch-remove-prefix, nnir-engines, nnir-run-notmuch): New nnir `notmuch' backend. mm-decode.el (mm-text-html-renderer): Doc fix. gnus-msg.el (gnus-bug): Fix the MML tag. pop3.el (pop3-open-server): -ERR is a valid response to CAPA. gnus-start.el (gnus-get-unread-articles): Don't connect to the secondary methods if started with `gnus-no-server'. gnus-group.el (gnus-read-ephemeral-bug-group): Allow fetching several bug reports at once.
This commit is contained in:
parent
0e4260bf5d
commit
d30dd079c9
@ -1,3 +1,7 @@
|
||||
2011-07-05 Lars Magne Ingebrigtsen <larsi@gnus.org>
|
||||
|
||||
* gnus.texi (Expiring Mail): Document gnus-auto-expirable-marks.
|
||||
|
||||
2011-07-04 Michael Albinus <michael.albinus@gmx.de>
|
||||
|
||||
* tramp.texi (Cleanup remote connections): Add
|
||||
|
@ -15648,14 +15648,16 @@ will remain on your system until hell freezes over. This bears
|
||||
repeating one more time, with some spurious capitalizations: IF you do
|
||||
NOT mark articles as EXPIRABLE, Gnus will NEVER delete those ARTICLES.
|
||||
|
||||
@vindex gnus-auto-expirable-marks
|
||||
You do not have to mark articles as expirable by hand. Gnus provides
|
||||
two features, called ``auto-expire'' and ``total-expire'', that can help you
|
||||
with this. In a nutshell, ``auto-expire'' means that Gnus hits @kbd{E}
|
||||
for you when you select an article. And ``total-expire'' means that Gnus
|
||||
considers all articles as expirable that are read. So, in addition to
|
||||
the articles marked @samp{E}, also the articles marked @samp{r},
|
||||
@samp{R}, @samp{O}, @samp{K}, @samp{Y} and so on are considered
|
||||
expirable.
|
||||
@samp{R}, @samp{O}, @samp{K}, @samp{Y} (and so on) are considered
|
||||
expirable. @code{gnus-auto-expirable-marks} has the full list of
|
||||
these marks.
|
||||
|
||||
When should either auto-expire or total-expire be used? Most people
|
||||
who are subscribed to mailing lists split each list into its own group
|
||||
|
@ -3,6 +3,25 @@
|
||||
* gnus.el (gnus-refer-article-method): Remove mention of nnspool, which
|
||||
no longer is much used.
|
||||
|
||||
2011-04-03 Kan-Ru Chen <kanru@kanru.info>
|
||||
|
||||
* nnir.el (nnir-notmuch-program, nnir-notmuch-additional-switches)
|
||||
(nnir-notmuch-remove-prefix, nnir-engines, nnir-run-notmuch): New nnir
|
||||
`notmuch' backend.
|
||||
|
||||
2011-07-05 Lars Magne Ingebrigtsen <larsi@gnus.org>
|
||||
|
||||
* mm-decode.el (mm-text-html-renderer): Doc fix.
|
||||
|
||||
* gnus-msg.el (gnus-bug): Fix the MML tag.
|
||||
|
||||
* pop3.el (pop3-open-server): -ERR is a valid response to CAPA.
|
||||
|
||||
2011-07-05 Daiki Ueno <ueno@unixuser.org>
|
||||
|
||||
* gnus-start.el (gnus-get-unread-articles): Don't connect to the
|
||||
secondary methods if started with `gnus-no-server'.
|
||||
|
||||
2011-07-05 Juanma Barranquero <lekktu@gmail.com>
|
||||
|
||||
* message.el (message-return-action): Fix typo in docstring.
|
||||
|
@ -2428,25 +2428,28 @@ the bug number, and browsing the URL must return mbox output."
|
||||
:version "24.1"
|
||||
:type '(repeat (cons (symbol) (string :tag "URL format string"))))
|
||||
|
||||
(defun gnus-read-ephemeral-bug-group (number mbox-url &optional window-conf)
|
||||
(defun gnus-read-ephemeral-bug-group (ids mbox-url &optional window-conf)
|
||||
"Browse bug NUMBER as ephemeral group."
|
||||
(interactive (list (read-string "Enter bug number: "
|
||||
(thing-at-point 'word) nil)
|
||||
;; FIXME: Add completing-read from
|
||||
;; `gnus-emacs-bug-group-download-format' ...
|
||||
(cdr (assoc 'emacs gnus-bug-group-download-format-alist))))
|
||||
(when (stringp number)
|
||||
(setq number (string-to-number number)))
|
||||
(when (stringp ids)
|
||||
(setq ids (string-to-number ids)))
|
||||
(unless (listp ids)
|
||||
(setq ids (list ids)))
|
||||
(let ((tmpfile (mm-make-temp-file "gnus-temp-group-"))
|
||||
(coding-system-for-write 'binary)
|
||||
(coding-system-for-read 'binary))
|
||||
(with-temp-file tmpfile
|
||||
(url-insert-file-contents (format mbox-url number))
|
||||
(dolist (id ids)
|
||||
(url-insert-file-contents (format mbox-url id)))
|
||||
(goto-char (point-min))
|
||||
;; Add the debbugs address so that we can respond to reports easily.
|
||||
(while (re-search-forward "^To: " nil t)
|
||||
(end-of-line)
|
||||
(insert (format ", %s@%s" number
|
||||
(insert (format ", %s@%s" (car ids)
|
||||
(gnus-replace-in-string
|
||||
(gnus-replace-in-string mbox-url "^http://" "")
|
||||
"/.*$" ""))))
|
||||
@ -2466,19 +2469,21 @@ the bug number, and browsing the URL must return mbox output."
|
||||
number
|
||||
(cdr (assoc 'debian gnus-bug-group-download-format-alist))))
|
||||
|
||||
(defun gnus-read-ephemeral-emacs-bug-group (number &optional window-conf)
|
||||
"Browse Emacs bug NUMBER as ephemeral group."
|
||||
(defun gnus-read-ephemeral-emacs-bug-group (ids &optional window-conf)
|
||||
"Browse Emacs bugs IDS as an ephemeral group."
|
||||
(interactive (list (string-to-number
|
||||
(read-string "Enter bug number: "
|
||||
(thing-at-point 'word) nil))))
|
||||
(unless (listp ids)
|
||||
(setq ids (list ids)))
|
||||
(gnus-read-ephemeral-bug-group
|
||||
number
|
||||
ids
|
||||
(cdr (assoc 'emacs gnus-bug-group-download-format-alist))
|
||||
window-conf)
|
||||
(when (boundp 'debbugs-summary-mode)
|
||||
(with-current-buffer (window-buffer (selected-window))
|
||||
(debbugs-summary-mode 1)
|
||||
(set (make-local-variable 'debbugs-bug-number) number))))
|
||||
(set (make-local-variable 'debbugs-bug-number) (car ids)))))
|
||||
|
||||
(defun gnus-group-jump-to-group (group &optional prompt)
|
||||
"Jump to newsgroup GROUP.
|
||||
|
@ -1480,10 +1480,10 @@ If YANK is non-nil, include the original article."
|
||||
(erase-buffer)
|
||||
(gnus-debug)
|
||||
(setq text (buffer-string)))
|
||||
(insert (concat "<#part type=application/emacs-lisp"
|
||||
"disposition=inline description=\"User settings\">\n"
|
||||
text
|
||||
"\n<#/part>")))
|
||||
(insert "<#part type=application/emacs-lisp "
|
||||
"disposition=inline description=\"User settings\">\n"
|
||||
text
|
||||
"\n<#/part>"))
|
||||
(goto-char (point-min))
|
||||
(search-forward "Subject: " nil t)
|
||||
(message "")))
|
||||
|
@ -1043,7 +1043,7 @@ If LEVEL is non-nil, the news will be set up at level LEVEL."
|
||||
|
||||
;; Find the number of unread articles in each non-dead group.
|
||||
(let ((gnus-read-active-file (and (not level) gnus-read-active-file)))
|
||||
(gnus-get-unread-articles level))))
|
||||
(gnus-get-unread-articles level dont-connect))))
|
||||
|
||||
(defun gnus-call-subscribe-functions (method group)
|
||||
"Call METHOD to subscribe GROUP.
|
||||
@ -1606,7 +1606,7 @@ If SCAN, request a scan of that group as well."
|
||||
|
||||
;; Go though `gnus-newsrc-alist' and compare with `gnus-active-hashtb'
|
||||
;; and compute how many unread articles there are in each group.
|
||||
(defun gnus-get-unread-articles (&optional level)
|
||||
(defun gnus-get-unread-articles (&optional level dont-connect)
|
||||
(setq gnus-server-method-cache nil)
|
||||
(require 'gnus-agent)
|
||||
(let* ((newsrc (cdr gnus-newsrc-alist))
|
||||
@ -1702,12 +1702,13 @@ If SCAN, request a scan of that group as well."
|
||||
|
||||
;; If we have primary/secondary select methods, but no groups from
|
||||
;; them, we still want to issue a retrieval request from them.
|
||||
(dolist (method (cons gnus-select-method
|
||||
gnus-secondary-select-methods))
|
||||
(when (and (not (assoc method type-cache))
|
||||
(gnus-check-backend-function 'request-list (car method)))
|
||||
(with-current-buffer nntp-server-buffer
|
||||
(gnus-read-active-file-1 method nil))))
|
||||
(unless dont-connect
|
||||
(dolist (method (cons gnus-select-method
|
||||
gnus-secondary-select-methods))
|
||||
(when (and (not (assoc method type-cache))
|
||||
(gnus-check-backend-function 'request-list (car method)))
|
||||
(with-current-buffer nntp-server-buffer
|
||||
(gnus-read-active-file-1 method nil)))))
|
||||
|
||||
;; Start early async retrieval of data.
|
||||
(let ((done-methods nil)
|
||||
|
@ -114,14 +114,14 @@
|
||||
"Render of HTML contents.
|
||||
It is one of defined renderer types, or a rendering function.
|
||||
The defined renderer types are:
|
||||
`shr': use Gnus simple HTML renderer;
|
||||
`gnus-w3m' : use Gnus renderer based on w3m;
|
||||
`w3m' : use emacs-w3m;
|
||||
`w3m-standalone': use w3m;
|
||||
`shr': use the built-in Gnus HTML renderer;
|
||||
`gnus-w3m': use Gnus renderer based on w3m;
|
||||
`w3m': use emacs-w3m;
|
||||
`w3m-standalone': use plain w3m;
|
||||
`links': use links;
|
||||
`lynx' : use lynx;
|
||||
`w3' : use Emacs/W3;
|
||||
`html2text' : use html2text;
|
||||
`lynx': use lynx;
|
||||
`w3': use Emacs/W3;
|
||||
`html2text': use html2text;
|
||||
nil : use external viewer (default web browser)."
|
||||
:version "24.1"
|
||||
:type '(choice (const shr)
|
||||
|
@ -499,6 +499,31 @@ arrive at the correct group name, \"mail.misc\"."
|
||||
:type '(directory)
|
||||
:group 'nnir)
|
||||
|
||||
(defcustom nnir-notmuch-program "notmuch"
|
||||
"*Name of notmuch search executable."
|
||||
:type '(string)
|
||||
:group 'nnir)
|
||||
|
||||
(defcustom nnir-notmuch-additional-switches '()
|
||||
"*A list of strings, to be given as additional arguments to notmuch.
|
||||
|
||||
Note that this should be a list. Ie, do NOT use the following:
|
||||
(setq nnir-notmuch-additional-switches \"-i -w\") ; wrong
|
||||
Instead, use this:
|
||||
(setq nnir-notmuch-additional-switches '(\"-i\" \"-w\"))"
|
||||
:type '(repeat (string))
|
||||
:group 'nnir)
|
||||
|
||||
(defcustom nnir-notmuch-remove-prefix (concat (getenv "HOME") "/Mail/")
|
||||
"*The prefix to remove from each file name returned by notmuch
|
||||
in order to get a group name (albeit with / instead of .). This is a
|
||||
regular expression.
|
||||
|
||||
This variable is very similar to `nnir-namazu-remove-prefix', except
|
||||
that it is for notmuch, not Namazu."
|
||||
:type '(regexp)
|
||||
:group 'nnir)
|
||||
|
||||
;;; Developer Extension Variable:
|
||||
|
||||
(defvar nnir-engines
|
||||
@ -519,6 +544,8 @@ arrive at the correct group name, \"mail.misc\"."
|
||||
((group . "Swish-e Group spec: ")))
|
||||
(namazu nnir-run-namazu
|
||||
())
|
||||
(notmuch nnir-run-notmuch
|
||||
())
|
||||
(hyrex nnir-run-hyrex
|
||||
((group . "Hyrex Group spec: ")))
|
||||
(find-grep nnir-run-find-grep
|
||||
@ -1338,6 +1365,80 @@ Tested with Namazu 2.0.6 on a GNU/Linux system."
|
||||
(> (nnir-artitem-rsv x)
|
||||
(nnir-artitem-rsv y)))))))))
|
||||
|
||||
(defun nnir-run-notmuch (query server &optional group)
|
||||
"Run QUERY against notmuch.
|
||||
Returns a vector of (group name, file name) pairs (also vectors,
|
||||
actually)."
|
||||
|
||||
;; (when group
|
||||
;; (error "The notmuch backend cannot search specific groups"))
|
||||
|
||||
(save-excursion
|
||||
(let ( (qstring (cdr (assq 'query query)))
|
||||
(groupspec (cdr (assq 'group query)))
|
||||
(prefix (nnir-read-server-parm 'nnir-notmuch-remove-prefix server))
|
||||
artlist
|
||||
(article-pattern (if (string= (gnus-group-server server) "nnmaildir")
|
||||
":[0-9]+"
|
||||
"^[0-9]+$"))
|
||||
artno dirnam filenam)
|
||||
|
||||
(when (equal "" qstring)
|
||||
(error "notmuch: You didn't enter anything"))
|
||||
|
||||
(set-buffer (get-buffer-create nnir-tmp-buffer))
|
||||
(erase-buffer)
|
||||
|
||||
(if groupspec
|
||||
(message "Doing notmuch query %s on %s..." qstring groupspec)
|
||||
(message "Doing notmuch query %s..." qstring))
|
||||
|
||||
(let* ((cp-list `( ,nnir-notmuch-program
|
||||
nil ; input from /dev/null
|
||||
t ; output
|
||||
nil ; don't redisplay
|
||||
"search"
|
||||
"--format=text"
|
||||
"--output=files"
|
||||
,@(nnir-read-server-parm 'nnir-notmuch-additional-switches server)
|
||||
,qstring ; the query, in notmuch format
|
||||
))
|
||||
(exitstatus
|
||||
(progn
|
||||
(message "%s args: %s" nnir-notmuch-program
|
||||
(mapconcat 'identity (cddddr cp-list) " ")) ;; ???
|
||||
(apply 'call-process cp-list))))
|
||||
(unless (or (null exitstatus)
|
||||
(zerop exitstatus))
|
||||
(nnheader-report 'nnir "Couldn't run notmuch: %s" exitstatus)
|
||||
;; notmuch failure reason is in this buffer, show it if
|
||||
;; the user wants it.
|
||||
(when (> gnus-verbose 6)
|
||||
(display-buffer nnir-tmp-buffer))))
|
||||
|
||||
;; The results are output in the format of:
|
||||
;; absolute-path-name
|
||||
(goto-char (point-min))
|
||||
(while (not (eobp))
|
||||
(setq filenam (buffer-substring-no-properties (line-beginning-position)
|
||||
(line-end-position))
|
||||
artno (file-name-nondirectory filenam)
|
||||
dirnam (file-name-directory filenam))
|
||||
(forward-line 1)
|
||||
|
||||
;; don't match directories
|
||||
(when (string-match article-pattern artno)
|
||||
(when (not (null dirnam))
|
||||
|
||||
;; maybe limit results to matching groups.
|
||||
(when (or (not groupspec)
|
||||
(string-match groupspec dirnam))
|
||||
(nnir-add-result dirnam artno "" prefix server artlist)))))
|
||||
|
||||
(message "Massaging notmuch output...done")
|
||||
|
||||
artlist)))
|
||||
|
||||
(defun nnir-run-find-grep (query server &optional grouplist)
|
||||
"Run find and grep to obtain matching articles."
|
||||
(let* ((method (gnus-server-to-method server))
|
||||
|
@ -307,7 +307,7 @@ Returns the process associated with the connection."
|
||||
(or pop3-stream-type 'network)))
|
||||
:capability-command "CAPA\r\n"
|
||||
:end-of-command "^\\(-ERR\\|+OK \\).*\n"
|
||||
:end-of-capability "^\\.\r?\n"
|
||||
:end-of-capability "^\\.\r?\n\\|^-ERR"
|
||||
:success "^\\+OK.*\n"
|
||||
:return-list t
|
||||
:starttls-function
|
||||
|
Loading…
Reference in New Issue
Block a user