emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r104976: Merge changes made in Gnus t


From: Katsumi Yamaoka
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r104976: Merge changes made in Gnus trunk.
Date: Tue, 05 Jul 2011 22:27:16 +0000
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 104976
author: Gnus developers <address@hidden>
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Tue 2011-07-05 22:27:16 +0000
message:
  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.
modified:
  doc/misc/ChangeLog
  doc/misc/gnus.texi
  lisp/gnus/ChangeLog
  lisp/gnus/gnus-group.el
  lisp/gnus/gnus-msg.el
  lisp/gnus/gnus-start.el
  lisp/gnus/mm-decode.el
  lisp/gnus/nnir.el
  lisp/gnus/pop3.el
=== modified file 'doc/misc/ChangeLog'
--- a/doc/misc/ChangeLog        2011-07-04 12:31:55 +0000
+++ b/doc/misc/ChangeLog        2011-07-05 22:27:16 +0000
@@ -1,3 +1,7 @@
+2011-07-05  Lars Magne Ingebrigtsen  <address@hidden>
+
+       * gnus.texi (Expiring Mail): Document gnus-auto-expirable-marks.
+
 2011-07-04  Michael Albinus  <address@hidden>
 
        * tramp.texi (Cleanup remote connections): Add

=== modified file 'doc/misc/gnus.texi'
--- a/doc/misc/gnus.texi        2011-07-04 00:33:48 +0000
+++ b/doc/misc/gnus.texi        2011-07-05 22:27:16 +0000
@@ -15648,14 +15648,16 @@
 repeating one more time, with some spurious capitalizations: IF you do
 NOT mark articles as EXPIRABLE, Gnus will NEVER delete those ARTICLES.
 
address@hidden 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},
address@hidden, @samp{O}, @samp{K}, @samp{Y} and so on are considered
-expirable.
address@hidden, @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

=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2011-07-05 21:03:54 +0000
+++ b/lisp/gnus/ChangeLog       2011-07-05 22:27:16 +0000
@@ -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  <address@hidden>
+
+       * 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  <address@hidden>
+
+       * 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  <address@hidden>
+
+       * 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  <address@hidden>
 
        * message.el (message-return-action): Fix typo in docstring.

=== modified file 'lisp/gnus/gnus-group.el'
--- a/lisp/gnus/gnus-group.el   2011-07-03 22:17:49 +0000
+++ b/lisp/gnus/gnus-group.el   2011-07-05 22:27:16 +0000
@@ -2428,25 +2428,28 @@
   :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 ", address@hidden" number
+       (insert (format ", address@hidden" (car ids)
                        (gnus-replace-in-string
                         (gnus-replace-in-string mbox-url "^http://"; "")
                         "/.*$" ""))))
@@ -2466,19 +2469,21 @@
    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.

=== modified file 'lisp/gnus/gnus-msg.el'
--- a/lisp/gnus/gnus-msg.el     2011-07-03 00:24:28 +0000
+++ b/lisp/gnus/gnus-msg.el     2011-07-05 22:27:16 +0000
@@ -1480,10 +1480,10 @@
        (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 "")))

=== modified file 'lisp/gnus/gnus-start.el'
--- a/lisp/gnus/gnus-start.el   2011-06-10 00:10:24 +0000
+++ b/lisp/gnus/gnus-start.el   2011-07-05 22:27:16 +0000
@@ -1043,7 +1043,7 @@
 
     ;; 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 @@
 
 ;; 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 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)

=== modified file 'lisp/gnus/mm-decode.el'
--- a/lisp/gnus/mm-decode.el    2011-03-25 23:27:18 +0000
+++ b/lisp/gnus/mm-decode.el    2011-07-05 22:27:16 +0000
@@ -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)

=== modified file 'lisp/gnus/nnir.el'
--- a/lisp/gnus/nnir.el 2011-07-02 13:26:49 +0000
+++ b/lisp/gnus/nnir.el 2011-07-05 22:27:16 +0000
@@ -499,6 +499,31 @@
   :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 @@
              ((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 @@
                                (> (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))

=== modified file 'lisp/gnus/pop3.el'
--- a/lisp/gnus/pop3.el 2011-07-03 22:17:49 +0000
+++ b/lisp/gnus/pop3.el 2011-07-05 22:27:16 +0000
@@ -307,7 +307,7 @@
                     (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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]