changeset 110859:7aa4fdb60d57

shr.el (shr-insert): Don't insert double spaces. auth.texi (Help for users, GnuPG and EasyPG Assistant Configuration): Update docs. gnus-registry.el, nnregistry.el: Remove nnregistry refer method auto-install and update docs. gnus.texi (Finding the Parent, The Gnus Registry, Registry Article Refer Method): Update docs for nnregistry.el. gnus-demon.el, gnus-group.el, gnus-msg.el, gnus-sum.el, gnus-util.el, gnus.el: Rename `gnus-pull' to `gnus-alist-pull'. gnus.texi (Article Washing): Add mm-shr. mm-decode.el (mm-text-html-renderer): Add mm-shr in choice list.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Fri, 08 Oct 2010 23:55:33 +0000
parents a6ae19bc27ec
children 1b90af51024f
files doc/misc/ChangeLog doc/misc/auth.texi doc/misc/gnus.texi lisp/gnus/ChangeLog lisp/gnus/gnus-demon.el lisp/gnus/gnus-group.el lisp/gnus/gnus-msg.el lisp/gnus/gnus-registry.el lisp/gnus/gnus-sum.el lisp/gnus/gnus-util.el lisp/gnus/gnus.el lisp/gnus/mm-decode.el lisp/gnus/nndoc.el lisp/gnus/nnregistry.el lisp/gnus/nnweb.el lisp/gnus/shr.el
diffstat 16 files changed, 174 insertions(+), 47 deletions(-) [+]
line wrap: on
line diff
--- a/doc/misc/ChangeLog	Fri Oct 08 19:32:14 2010 +0200
+++ b/doc/misc/ChangeLog	Fri Oct 08 23:55:33 2010 +0000
@@ -1,3 +1,17 @@
+2010-10-08  Julien Danjou  <julien@danjou.info>
+
+	* gnus.texi: add mm-shr
+
+2010-10-08  Ludovic Courtès  <ludo@gnu.org>
+
+	* gnus.texi (Finding the Parent, The Gnus Registry)
+	(Registry Article Refer Method): Update docs for nnregistry.el.
+
+2010-10-08  Daiki Ueno  <ueno@unixuser.org>
+
+	* auth.texi (Help for users)
+	(GnuPG and EasyPG Assistant Configuration): Update docs.
+
 2010-10-08  Glenn Morris  <rgm@gnu.org>
 
 	* cl.texi (Organization, Installation, Old CL Compatibility):
--- a/doc/misc/auth.texi	Fri Oct 08 19:32:14 2010 +0200
+++ b/doc/misc/auth.texi	Fri Oct 08 23:55:33 2010 +0000
@@ -59,6 +59,7 @@
 * Help for users::              
 * Secret Service API::          
 * Help for developers::         
+* GnuPG and EasyPG Assistant Configuration::  
 * Index::                       
 * Function Index::              
 * Variable Index::              
@@ -176,16 +177,8 @@
 
 If you don't customize @code{auth-sources}, you'll have to live with
 the defaults: any host and any port are looked up in the netrc
-file @code{~/.authinfo.gpg}.  This is an encrypted file if and only if
-you set up EPA, which is strongly recommended.
-
-@lisp
-(require 'epa-file)
-(epa-file-enable)
-;;; VERY important if you want symmetric encryption
-;;; irrelevant if you don't
-(setq epa-file-cache-passphrase-for-symmetric-encryption t)
-@end lisp
+file @code{~/.authinfo.gpg}, which is a GnuPG encrypted file.
+@xref{GnuPG and EasyPG Assistant Configuration}.
 
 The simplest working netrc line example is one without a port.
 
@@ -271,6 +264,54 @@
 
 @end defun
 
+@node GnuPG and EasyPG Assistant Configuration
+@appendix GnuPG and EasyPG Assistant Configuration
+
+In Emacs 23 or later there is an option @code{auto-encryption-mode} to
+automatically decrypt @code{*.gpg} files and it is enabled by default
+so there is no setting is needed.  If you are using earlier versions
+of Emacs for some reason, you will need:
+
+@lisp
+(require 'epa-file)
+(epa-file-enable)
+@end lisp
+
+If you want your GnuPG passwords to be cached, setup @code{gpg-agent}
+or EasyPG Assitant
+@pxref{Caching Passphrases, , Caching Passphrases, epa}
+
+For those who are using older vesions of Emacs, here are some portion
+copied from the EasyPG Assitant manual:
+
+Here are some questions:
+
+@enumerate
+@item Do you use GnuPG version 2 instead of GnuPG version 1?
+@item Do you use symmetric encryption rather than public key encryption?
+@item Do you want to use gpg-agent?
+@end enumerate
+
+Here are configurations depending on your answers:
+
+@multitable {111} {222} {333} {configuration configuration configuration}
+@item @b{1} @tab @b{2} @tab @b{3} @tab Configuration
+@item Yes @tab Yes @tab Yes @tab Nothing to do.
+@item Yes @tab Yes @tab No @tab You can't, without gpg-agent.
+@item Yes @tab No @tab Yes @tab Nothing to do.
+@item Yes @tab No @tab No @tab You can't, without gpg-agent.
+@item No @tab Yes @tab Yes @tab Set up elisp passphrase cache.
+@item No @tab Yes @tab No @tab Set up elisp passphrase cache.
+@item No @tab No @tab Yes @tab Nothing to do.
+@item No @tab No @tab No @tab You can't, without gpg-agent.
+@end multitable
+
+To setup gpg-agent, follow the instruction in GnuPG manual.
+@pxref{Invoking GPG-AGENT, , Invoking GPG-AGENT, gnupg}.
+
+To set up elisp passphrase cache, set
+@code{epa-file-cache-passphrase-for-symmetric-encryption}.
+
 @node Index
 @chapter Index
 @printindex cp
--- a/doc/misc/gnus.texi	Fri Oct 08 19:32:14 2010 +0200
+++ b/doc/misc/gnus.texi	Fri Oct 08 23:55:33 2010 +0000
@@ -9812,6 +9812,10 @@
 can use include:
 
 @table @code
+@item mm-shr
+Use Gnus simple html renderer.
+
+@table @code
 @item gnus-article-html
 Use Gnus rendered based on w3m.
 
@@ -10989,9 +10993,12 @@
 @code{nnbabyl}, @code{nnmaildir}, @code{nnml}, are able to locate
 articles from any groups, while @code{nnfolder}, and @code{nnimap} are
 only able to locate articles that have been posted to the current
-group.  (Anything else would be too time consuming.)  @code{nnmh} does
-not support this at all.
-
+group.  @code{nnmh} does not support this at all.
+
+Fortunately, the special @code{nnregistry} back end is able to locate
+articles in any groups, regardless of their back end (@pxref{Registry
+Article Refer Method, fetching by @code{Message-ID} using the
+registry}).
 
 @node Alternative Approaches
 @section Alternative Approaches
@@ -12452,7 +12459,7 @@
 @item mm-text-html-renderer
 @vindex mm-text-html-renderer
 If set to @code{gnus-article-html}, Gnus will use the built-in method,
-that's based on @code{curl} and @code{w3m}.
+that's based on @code{w3m}.
 
 @item gnus-blocked-images
 @vindex gnus-blocked-images
@@ -25374,6 +25381,13 @@
 available.
 
 @item
+Refer to messages by ID
+
+Commands like @code{gnus-summary-refer-parent-article} can take
+advantage of the registry to jump to the referred article, regardless
+of the group the message is in.
+
+@item
 Store custom flags and keywords
 
 The registry can store custom flags and keywords for a message.  For
@@ -25392,6 +25406,7 @@
 @menu
 * Setup::
 * Fancy splitting to parent::
+* Registry Article Refer Method::
 * Store custom flags and keywords::
 * Store arbitrary data::
 @end menu
@@ -25468,6 +25483,42 @@
 The file where the registry will be stored between Gnus sessions.
 @end defvar
 
+@node Registry Article Refer Method
+@subsection Fetching by @code{Message-ID} Using the Registry
+
+The registry knows how to map each @code{Message-ID} to the group it's
+in.  This can be leveraged to enhance the ``article refer method'',
+the thing that tells Gnus how to look up an article given its
+Message-ID (@pxref{Finding the Parent}).
+
+@vindex nnregistry
+@vindex gnus-refer-article-method
+
+The @code{nnregistry} refer method does exactly that.  It has the
+advantage that an article may be found regardless of the group it's
+in---provided its @code{Message-ID} is known to the registry.  It can
+be enabled by augmenting the start-up file with something along these
+lines:
+
+@example
+;; Keep enough entries to have a good hit rate when referring to an
+;; article using the registry.  Use long group names so that Gnus
+;; knows where the article is.
+(setq gnus-registry-max-entries 2500
+      gnus-registry-use-long-group-names t)
+
+(gnus-registry-initialize)
+
+(setq gnus-refer-article-method
+      '(current
+	(nnregistry)
+	(nnweb "gmane" (nnweb-type gmane))))
+@end example
+
+The example above instructs Gnus to first look up the article in the
+current group, or, alternatively, using the registry, and finally, if
+all else fails, using Gmane.
+
 @node Fancy splitting to parent
 @subsection Fancy splitting to parent
 
--- a/lisp/gnus/ChangeLog	Fri Oct 08 19:32:14 2010 +0200
+++ b/lisp/gnus/ChangeLog	Fri Oct 08 23:55:33 2010 +0000
@@ -1,3 +1,36 @@
+2010-10-08  Julien Danjou  <julien@danjou.info>
+
+	* mm-decode.el (mm-text-html-renderer): Add mm-shr in choice list.
+
+2010-10-08  Teodor Zlatanov  <tzz@lifelogs.com>
+
+	* gnus-util.el (gnus-alist-pull): Rename `gnus-pull'.
+
+	* gnus-sum.el (gnus-mark-article-as-unread)
+	(gnus-summary-mark-article-as-unread, gnus-summary-remove-bookmark)
+	(gnus-summary-set-bookmark): Use it.
+
+	* gnus-msg.el (gnus-setup-message): Use it.
+
+	* gnus-demon.el (gnus-demon-remove-handler): Use it.
+
+	* gnus.el (gnus-group-remove-parameter): Use it.
+
+	* gnus-group.el (gnus-group-make-web-group): Use it.
+
+	* gnus-demon.el (gnus-demon-remove-handler): Use it.
+
+	* nnregistry.el: Update docs to mention manual.
+
+	* gnus-registry.el: Update docs to mention nnregistry.el.
+	(gnus-registry-initialize): Don't install nnregistry refer method
+	automatically.
+	(gnus-registry-install-nnregistry): Remove it.
+
+2010-10-08  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* shr.el (shr-insert): Don't insert double spaces.
+
 2010-10-08  Katsumi Yamaoka  <yamaoka@jpl.org>
 
 	* gnus-gravatar.el (gnus-treat-from-gravatar)
--- a/lisp/gnus/gnus-demon.el	Fri Oct 08 19:32:14 2010 +0200
+++ b/lisp/gnus/gnus-demon.el	Fri Oct 08 23:55:33 2010 +0000
@@ -92,7 +92,7 @@
 
 (defun gnus-demon-remove-handler (function &optional no-init)
   "Remove the handler FUNCTION from the list of handlers."
-  (gnus-pull function gnus-demon-handlers)
+  (gnus-alist-pull function gnus-demon-handlers)
   (unless no-init
     (gnus-demon-init)))
 
--- a/lisp/gnus/gnus-group.el	Fri Oct 08 19:32:14 2010 +0200
+++ b/lisp/gnus/gnus-group.el	Fri Oct 08 23:55:33 2010 +0000
@@ -3027,7 +3027,7 @@
 		  (nnweb-ephemeral-p t))))
     (if solid
 	(progn
-	  (gnus-pull 'nnweb-ephemeral-p method)
+	  (gnus-alist-pull 'nnweb-ephemeral-p method)
 	  (gnus-group-make-group group method))
       (gnus-group-read-ephemeral-group
        group method t
--- a/lisp/gnus/gnus-msg.el	Fri Oct 08 19:32:14 2010 +0200
+++ b/lisp/gnus/gnus-msg.el	Fri Oct 08 23:55:33 2010 +0000
@@ -420,7 +420,7 @@
 		     ;; There may be an old " *gnus article copy*" buffer.
 		     (let (gnus-article-copy)
 		       (gnus-configure-posting-styles ,group)))))
-       (gnus-pull ',(intern gnus-draft-meta-information-header)
+       (gnus-alist-pull ',(intern gnus-draft-meta-information-header)
 		  message-required-headers)
        (when (and ,group
 		  (not (string= ,group "")))
--- a/lisp/gnus/gnus-registry.el	Fri Oct 08 19:32:14 2010 +0200
+++ b/lisp/gnus/gnus-registry.el	Fri Oct 08 23:55:33 2010 +0000
@@ -36,17 +36,18 @@
 
 ;; Put this in your startup file (~/.gnus.el for instance)
 
-;; (require 'nnregistry) ;; optional, or see below (automatically calls `gnus-registry-install-nnregistry' when `gnus-registry-initialize' is called)
 ;; (setq gnus-registry-max-entries 2500
 ;;       gnus-registry-use-long-group-names t)
 
 ;; (gnus-registry-initialize)
-;; (gnus-registry-install-nnregistry) ;; optional, or see above (loading nnregistry makes it unnecessary)
 
 ;; Then use this in your fancy-split:
 
 ;; (: gnus-registry-split-fancy-with-parent)
 
+;; You should also consider using the nnregistry backend to look up
+;; articles.  See the Gnus manual for more information.
+
 ;; TODO:
 
 ;; - get the correct group on spool actions
@@ -1131,8 +1132,6 @@
   (setq gnus-registry-install t)	; in case it was 'ask or nil
   (gnus-registry-install-hooks)
   (gnus-registry-install-shortcuts)
-  (when (featurep 'nnregistry)
-    (gnus-registry-install-nnregistry))
   (gnus-registry-read))
 
 ;;;###autoload
@@ -1149,21 +1148,6 @@
 
   (add-hook 'gnus-summary-prepare-hook 'gnus-registry-register-message-ids))
 
-;;;###autoload
-(defun gnus-registry-install-nnregistry ()
-  "Install the nnregistry refer method in `gnus-refer-article-method'."
-  (interactive)
-  (cond ((eq 'nnregistry gnus-refer-article-method))
-	((null gnus-refer-article-method)
-	 (setq gnus-refer-article-method 'nnregistry))
-	((consp gnus-refer-article-method)
-	 (unless (memq 'nnregistry gnus-refer-article-method)
-	   (setq gnus-refer-article-method
-		 (append gnus-refer-article-method '(nnregistry)))))
-	(t
-	 (setq gnus-refer-article-method
-	       (list gnus-refer-article-method 'nnregistry)))))
-
 (defun gnus-registry-unload-hook ()
   "Uninstall the registry hooks."
   (interactive)
--- a/lisp/gnus/gnus-sum.el	Fri Oct 08 19:32:14 2010 +0200
+++ b/lisp/gnus/gnus-sum.el	Fri Oct 08 23:55:33 2010 +0000
@@ -10528,7 +10528,7 @@
 	    (not (equal gnus-newsgroup-name (car gnus-article-current))))
     (error "No current article selected"))
   ;; Remove old bookmark, if one exists.
-  (gnus-pull article gnus-newsgroup-bookmarks)
+  (gnus-alist-pull article gnus-newsgroup-bookmarks)
   ;; Set the new bookmark, which is on the form
   ;; (article-number . line-number-in-body).
   (push
@@ -10549,7 +10549,7 @@
   ;; Remove old bookmark, if one exists.
   (if (not (assq article gnus-newsgroup-bookmarks))
       (gnus-message 6 "No bookmark in current article.")
-    (gnus-pull article gnus-newsgroup-bookmarks)
+    (gnus-alist-pull article gnus-newsgroup-bookmarks)
     (gnus-message 6 "Removed bookmark.")))
 
 ;; Suggested by Daniel Quinlan <quinlan@best.com>.
@@ -10675,7 +10675,7 @@
 	       (setq gnus-newsgroup-unreads
 		     (gnus-add-to-sorted-list gnus-newsgroup-unreads
 					      article))))
-	(gnus-pull article gnus-newsgroup-reads)
+	(gnus-alist-pull article gnus-newsgroup-reads)
 
 	;; See whether the article is to be put in the cache.
 	(and gnus-use-cache
@@ -10849,7 +10849,7 @@
 	    (t
 	     (setq gnus-newsgroup-unreads
 		   (gnus-add-to-sorted-list gnus-newsgroup-unreads article))))
-      (gnus-pull article gnus-newsgroup-reads)
+      (gnus-alist-pull article gnus-newsgroup-reads)
       t)))
 
 (defalias 'gnus-summary-mark-as-unread-forward
--- a/lisp/gnus/gnus-util.el	Fri Oct 08 19:32:14 2010 +0200
+++ b/lisp/gnus/gnus-util.el	Fri Oct 08 23:55:33 2010 +0000
@@ -1366,7 +1366,7 @@
 	(when (string-match r word)
 	  (throw 'found r))))))
 
-(defmacro gnus-pull (key alist &optional assoc-p)
+(defmacro gnus-alist-pull (key alist &optional assoc-p)
   "Modify ALIST to be without KEY."
   (unless (symbolp alist)
     (error "Not a symbol: %s" alist))
--- a/lisp/gnus/gnus.el	Fri Oct 08 19:32:14 2010 +0200
+++ b/lisp/gnus/gnus.el	Fri Oct 08 23:55:33 2010 +0000
@@ -3944,7 +3944,7 @@
 	(when params
 	  (setq params (delq name params))
 	  (while (assq name params)
-	    (gnus-pull name params))
+	    (gnus-alist-pull name params))
 	  (gnus-info-set-params info params))))))
 
 (defun gnus-group-add-score (group &optional score)
--- a/lisp/gnus/mm-decode.el	Fri Oct 08 19:32:14 2010 +0200
+++ b/lisp/gnus/mm-decode.el	Fri Oct 08 23:55:33 2010 +0000
@@ -115,6 +115,7 @@
   "Render of HTML contents.
 It is one of defined renderer types, or a rendering function.
 The defined renderer types are:
+`mm-shr': use Gnus simple HTML renderer;
 `gnus-article-html' : use Gnus renderer based on w3m;
 `w3m'  : use emacs-w3m;
 `w3m-standalone': use w3m;
@@ -124,7 +125,8 @@
 `html2text' : use html2text;
 nil    : use external viewer (default web browser)."
   :version "24.1"
-  :type '(choice (const gnus-article-html)
+  :type '(choice (const mm-shr)
+                 (const gnus-article-html)
                  (const w3)
                  (const w3m :tag "emacs-w3m")
 		 (const w3m-standalone :tag "standalone w3m" )
--- a/lisp/gnus/nndoc.el	Fri Oct 08 19:32:14 2010 +0200
+++ b/lisp/gnus/nndoc.el	Fri Oct 08 23:55:33 2010 +0000
@@ -1038,7 +1038,7 @@
 first definition, and if any other symbol, add after that
 symbol in the alist."
   ;; First remove any old instances.
-  (gnus-pull (car definition) nndoc-type-alist)
+  (gnus-alist-pull (car definition) nndoc-type-alist)
   ;; Then enter the new definition in the proper place.
   (cond
    ((or (null position) (eq position 'last))
--- a/lisp/gnus/nnregistry.el	Fri Oct 08 19:32:14 2010 +0200
+++ b/lisp/gnus/nnregistry.el	Fri Oct 08 23:55:33 2010 +0000
@@ -25,7 +25,8 @@
 
 ;; This file provides the `nnregistry' Gnus back-end.  It can be used
 ;; in `gnus-refer-article-method' to quickly search for a message by
-;; id, regardless of the back-end that stores it.
+;; id, regardless of the back-end that stores it.  See the Gnus manual
+;; for usage examples and more information.
 
 ;;; Code:
 
--- a/lisp/gnus/nnweb.el	Fri Oct 08 19:32:14 2010 +0200
+++ b/lisp/gnus/nnweb.el	Fri Oct 08 23:55:33 2010 +0000
@@ -207,7 +207,7 @@
 
 (deffoo nnweb-request-delete-group (group &optional force server)
   (nnweb-possibly-change-server group server)
-  (gnus-pull group nnweb-group-alist t)
+  (gnus-alist-pull group nnweb-group-alist t)
   (nnweb-write-active)
   (gnus-delete-file (nnweb-overview-file group))
   t)
--- a/lisp/gnus/shr.el	Fri Oct 08 19:32:14 2010 +0200
+++ b/lisp/gnus/shr.el	Fri Oct 08 23:55:33 2010 +0000
@@ -188,7 +188,8 @@
     (let ((first t)
 	  column)
       (when (and (string-match "\\`[ \t\n]" text)
-		 (not (bolp)))
+		 (not (bolp))
+		 (not (eq (char-after (1- (point))) ? )))
 	(insert " "))
       (dolist (elem (split-string text))
 	(when (and (bolp)