From 36d3245fbc0ad82c81da146e0fa21bd6843f2795 Mon Sep 17 00:00:00 2001 From: Gnus developers Date: Fri, 8 Oct 2010 23:55:33 +0000 Subject: [PATCH] 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. --- doc/misc/ChangeLog | 14 +++++++++++ doc/misc/auth.texi | 61 ++++++++++++++++++++++++++++++++++++++-------- doc/misc/gnus.texi | 57 ++++++++++++++++++++++++++++++++++++++++--- lisp/gnus/ChangeLog | 33 +++++++++++++++++++++++++ lisp/gnus/gnus-demon.el | 2 +- lisp/gnus/gnus-group.el | 2 +- lisp/gnus/gnus-msg.el | 2 +- lisp/gnus/gnus-registry.el | 22 +++-------------- lisp/gnus/gnus-sum.el | 8 +++--- lisp/gnus/gnus-util.el | 2 +- lisp/gnus/gnus.el | 2 +- lisp/gnus/mm-decode.el | 4 ++- lisp/gnus/nndoc.el | 2 +- lisp/gnus/nnregistry.el | 3 ++- lisp/gnus/nnweb.el | 2 +- lisp/gnus/shr.el | 3 ++- 16 files changed, 173 insertions(+), 46 deletions(-) diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index b06cfe1394b..aa1715551c8 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,17 @@ +2010-10-08 Julien Danjou + + * gnus.texi: add mm-shr + +2010-10-08 Ludovic Courtès + + * gnus.texi (Finding the Parent, The Gnus Registry) + (Registry Article Refer Method): Update docs for nnregistry.el. + +2010-10-08 Daiki Ueno + + * auth.texi (Help for users) + (GnuPG and EasyPG Assistant Configuration): Update docs. + 2010-10-08 Glenn Morris * cl.texi (Organization, Installation, Old CL Compatibility): diff --git a/doc/misc/auth.texi b/doc/misc/auth.texi index ed04d98ef92..f7ee7b9f3de 100644 --- a/doc/misc/auth.texi +++ b/doc/misc/auth.texi @@ -59,6 +59,7 @@ It is a way for multiple applications to share a single configuration * Help for users:: * Secret Service API:: * Help for developers:: +* GnuPG and EasyPG Assistant Configuration:: * Index:: * Function Index:: * Variable Index:: @@ -176,16 +177,8 @@ for details. 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 @@ users' netrc files. @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 diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 1f78e8c563f..74db0e3d620 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -9812,6 +9812,10 @@ Customization, emacs-mime, The Emacs MIME Manual}) to convert the 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 @@ do not do a particularly excellent job at it. That is, @code{nnmbox}, @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 @@ section only describes the default method. @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 @@ the sender in addition to the Message-ID. Several strategies are 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 @@ of all messages matching a particular set of criteria. @menu * Setup:: * Fancy splitting to parent:: +* Registry Article Refer Method:: * Store custom flags and keywords:: * Store arbitrary data:: @end menu @@ -25468,6 +25483,42 @@ registry will keep. 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 diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 8859ce8c4ad..744601b8bc9 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,36 @@ +2010-10-08 Julien Danjou + + * mm-decode.el (mm-text-html-renderer): Add mm-shr in choice list. + +2010-10-08 Teodor Zlatanov + + * 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 + + * shr.el (shr-insert): Don't insert double spaces. + 2010-10-08 Katsumi Yamaoka * gnus-gravatar.el (gnus-treat-from-gravatar) diff --git a/lisp/gnus/gnus-demon.el b/lisp/gnus/gnus-demon.el index c4e439c3bf4..9f992d567d7 100644 --- a/lisp/gnus/gnus-demon.el +++ b/lisp/gnus/gnus-demon.el @@ -92,7 +92,7 @@ time Emacs has been idle for IDLE `gnus-demon-timestep's." (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))) diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index b2285569167..b92b608e5db 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -3027,7 +3027,7 @@ If SOLID (the prefix), create a solid group." (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 diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index 891718e65b8..a3c5112ee41 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el @@ -420,7 +420,7 @@ Thank you for your help in stamping out bugs. ;; 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 ""))) diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el index 45fa9561782..6c2233f9c40 100644 --- a/lisp/gnus/gnus-registry.el +++ b/lisp/gnus/gnus-registry.el @@ -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 @@ Returns the first place where the trail finds a group name." (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 @@ Returns the first place where the trail finds a group name." (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) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index c45536c25c0..a0566900757 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -10528,7 +10528,7 @@ ARTICLE can also be a list of articles." (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 @@ ARTICLE can also be a list of articles." ;; 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 . @@ -10675,7 +10675,7 @@ If NO-EXPIRE, auto-expiry will be inhibited." (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 @@ If NO-EXPIRE, auto-expiry will be inhibited." (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 diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index 932b0a1f1e7..503ec47e39c 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -1366,7 +1366,7 @@ Return the modified alist." (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)) diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index b62bf051c5d..f6ffdf64ffb 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -3944,7 +3944,7 @@ If ALLOW-LIST, also allow list as a result." (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) diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index 1006c850ae5..07249bf0727 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -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 @@ The defined renderer types are: `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" ) diff --git a/lisp/gnus/nndoc.el b/lisp/gnus/nndoc.el index 46d775a345f..6c9ef1cef87 100644 --- a/lisp/gnus/nndoc.el +++ b/lisp/gnus/nndoc.el @@ -1038,7 +1038,7 @@ as the last checked definition, if t or `first', add as the 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)) diff --git a/lisp/gnus/nnregistry.el b/lisp/gnus/nnregistry.el index b2d80503479..03ff5e716aa 100644 --- a/lisp/gnus/nnregistry.el +++ b/lisp/gnus/nnregistry.el @@ -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: diff --git a/lisp/gnus/nnweb.el b/lisp/gnus/nnweb.el index 1cfa7a4cbc3..ac643f9ed1f 100644 --- a/lisp/gnus/nnweb.el +++ b/lisp/gnus/nnweb.el @@ -207,7 +207,7 @@ Valid types include `google', `dejanews', and `gmane'.") (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) diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el index ffc27e92ccd..daafa61d372 100644 --- a/lisp/gnus/shr.el +++ b/lisp/gnus/shr.el @@ -188,7 +188,8 @@ redirects somewhere else." (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) -- 2.11.4.GIT