From 061ce588a34376c044200b9b37cbc7a38f8aacfb Mon Sep 17 00:00:00 2001 From: yamaoka Date: Wed, 9 Nov 2005 07:10:25 +0000 Subject: [PATCH] Synch to No Gnus 200511090700. --- lisp/ChangeLog | 13 ++++++++++ lisp/message.el | 3 ++- lisp/nntp.el | 24 ++++++++++++++---- texi/ChangeLog | 9 +++++++ texi/gnus.texi | 76 ++++++++++++++++++++++++++++++------------------------- 5 files changed, 85 insertions(+), 40 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 53ccfad..8133cb9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,16 @@ +2005-11-09 Katsumi Yamaoka + + * message.el (message-generate-headers): Downcase the argument + given to message-check-element. + +2005-11-08 Kevin Greiner + + * nntp.el (nntp-authinfo-rejected): New error condition. + (nntp-wait-for): Use new error condition to signal authentication + error. + (nntp-retrieve-data): Rethrow new error condition to break out of + recursive call to nntp-send-authinfo. + 2005-11-08 Romain Francoise * gnus-sum.el (gnus-summary-catchup-and-goto-prev-group): New function. diff --git a/lisp/message.el b/lisp/message.el index 929c9a4..efd3a3f 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -5771,7 +5771,8 @@ Headers already prepared in the buffer are not modified." ;; The element is a symbol. We insert the value ;; of this symbol, if any. (symbol-value header)) - ((not (message-check-element header)) + ((not (message-check-element + (intern (downcase (symbol-name header))))) ;; We couldn't generate a value for this header, ;; so we just ask the user. (read-from-minibuffer diff --git a/lisp/nntp.el b/lisp/nntp.el index e8be835..e568cf4 100644 --- a/lisp/nntp.el +++ b/lisp/nntp.el @@ -313,6 +313,13 @@ Within a string, %s is replaced with the server address and %p with port number on server. The program should accept IMAP commands on stdin and return responses to stdout.") +(defvar nntp-authinfo-rejected nil +"A custom error condition used to report 'Authentication Rejected' errors. +Condition handlers that match just this condition ensure that the nntp +backend doesn't catch this error.") +(put 'nntp-authinfo-rejected 'error-conditions '(error nntp-authinfo-rejected)) +(put 'nntp-authinfo-rejected 'error-message "Authorization Rejected") + ;;; Internal functions. @@ -363,16 +370,21 @@ be restored and the command retried." (defsubst nntp-wait-for (process wait-for buffer &optional decode discard) "Wait for WAIT-FOR to arrive from PROCESS." + (save-excursion (set-buffer (process-buffer process)) (goto-char (point-min)) + (while (and (or (not (memq (char-after (point)) '(?2 ?3 ?4 ?5))) - (looking-at "480")) + (looking-at "48[02]")) (memq (process-status process) '(open run))) - (when (looking-at "480") - (nntp-handle-authinfo process)) - (when (looking-at "^.*\n") - (delete-region (point) (progn (forward-line 1) (point)))) + (cond ((looking-at "480") + (nntp-handle-authinfo process)) + ((looking-at "482") + (nnheader-report 'nntp (get 'nntp-authinfo-rejected 'error-message)) + (signal 'nntp-authinfo-rejected nil)) + ((looking-at "^.*\n") + (delete-region (point) (progn (forward-line 1) (point))))) (nntp-accept-process-output process) (goto-char (point-min))) (prog1 @@ -468,6 +480,8 @@ be restored and the command retried." (wait-for (nntp-wait-for process wait-for buffer decode)) (t t))) + (nntp-authinfo-rejected + (signal 'nntp-authinfo-rejected (cdr err))) (error (nnheader-report 'nntp "Couldn't open connection to %s: %s" address err)) diff --git a/texi/ChangeLog b/texi/ChangeLog index f8bcaf5..4119cd1 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,12 @@ +2005-11-08 Kevin Greiner + + * gnus.texi (nntp-open-via-telnet-and-telnet): Fixed grammer. + (Agent Parameters): Updated parameter names to match code. + (Group Agent Commands): Corrected 'gnus-agent-fetch-series' as 'gnus-agent-summary-fetch-series'. + (Agent and flags): New section providing a generalized discussion of flag handling. + (Agent and IMAP): Removed flag discussion. + (Agent Variables): Added 'gnus-agent-synchronize-flags' + 2005-11-08 Romain Francoise * gnus.texi (Exiting the Summary Buffer): Add new function diff --git a/texi/gnus.texi b/texi/gnus.texi index 66fddd0..2667b54 100644 --- a/texi/gnus.texi +++ b/texi/gnus.texi @@ -13039,7 +13039,7 @@ List of strings to be used as the switches to @item nntp-open-via-telnet-and-telnet @findex nntp-open-via-telnet-and-telnet -Does essentially also the same, but uses @samp{telnet} instead of +Does essentially the same, but uses @samp{telnet} instead of @samp{rlogin} to connect to the intermediate host. @code{nntp-open-via-telnet-and-telnet}-specific variables: @@ -18359,9 +18359,6 @@ listed below. @cindex Agent Parameters @table @code -@item agent-cat-name -The name of the category. - @item agent-groups The list of groups that are in this category. @@ -18369,7 +18366,7 @@ The list of groups that are in this category. A predicate which (generally) gives a rough outline of which articles are eligible for downloading; and -@item agent-score-file +@item agent-score a score rule which (generally) gives you a finer granularity when deciding what articles to download. (Note that this @dfn{download score} is not necessarily related to normal scores.) @@ -18390,11 +18387,11 @@ an integer that overrides the value of @code{gnus-agent-low-score}. @item agent-high-score an integer that overrides the value of @code{gnus-agent-high-score}. -@item agent-length-when-short +@item agent-short-article an integer that overrides the value of @code{gnus-agent-short-article}. -@item agent-length-when-long +@item agent-long-article an integer that overrides the value of @code{gnus-agent-long-article}. @item agent-enable-undownloaded-faces @@ -18906,9 +18903,9 @@ Download all eligible (@pxref{Agent Categories}) articles in this group. @item J s @kindex J s (Agent Summary) -@findex gnus-agent-fetch-series +@findex gnus-agent-summary-fetch-series Download all processable articles in this group. -(@code{gnus-agent-fetch-series}). +(@code{gnus-agent-summary-fetch-series}). @item J u @kindex J u (Agent Summary) @@ -19101,23 +19098,19 @@ then updates the internal data structures that document which articles are stored locally. An optional argument will mark articles in the agent as unread. -@node Agent and IMAP -@subsection Agent and IMAP - -The Agent works with any Gnus back end, including nnimap. However, -since there are some conceptual differences between @acronym{NNTP} and -@acronym{IMAP}, this section (should) provide you with some information to -make Gnus Agent work smoother as a @acronym{IMAP} Disconnected Mode client. +@node Agent and flags +@subsection Agent and flags -The first thing to keep in mind is that all flags (read, ticked, etc) -are kept on the @acronym{IMAP} server, rather than in @file{.newsrc} as is the -case for nntp. Thus Gnus need to remember flag changes when -disconnected, and synchronize these flags when you plug back in. +The Agent works with any Gnus back end including those, such as +nnimap, that store flags (read, ticked, etc) on the server. Sadly, +the Agent does not actually know which backends keep their flags in +the backend server rather than in @file{.newsrc}. This means that the +Agent, while unplugged or disconnected, will always record all changes +to the flags in its own files. -Gnus keeps track of flag changes when reading nnimap groups under the -Agent. When you plug back in, Gnus will check if you have any changed -any flags and ask if you wish to synchronize these with the server. -The behavior is customizable by @code{gnus-agent-synchronize-flags}. +When you plug back in, Gnus will then check to see if you have any +changed any flags and ask if you wish to synchronize these with the +server. This behavior is customizable by @code{gnus-agent-synchronize-flags}. @vindex gnus-agent-synchronize-flags If @code{gnus-agent-synchronize-flags} is @code{nil}, the Agent will @@ -19131,6 +19124,23 @@ re-connect, you can do it manually with the @code{gnus-agent-synchronize-flags} command that is bound to @kbd{J Y} in the group buffer. +Technical note: the synchronization algorithm does not work by ``pushing'' +all local flags to the server, but rather by incrementally updated the +server view of flags by changing only those flags that were changed by +the user. Thus, if you set one flag on an article, quit the group then +re-select the group and remove the flag; the flag will be set and +removed from the server when you ``synchronize''. The queued flag +operations can be found in the per-server @code{flags} file in the Agent +directory. It's emptied when you synchronize flags. + +@node Agent and IMAP +@subsection Agent and IMAP + +The Agent works with any Gnus back end, including nnimap. However, +since there are some conceptual differences between @acronym{NNTP} and +@acronym{IMAP}, this section (should) provide you with some information to +make Gnus Agent work smoother as a @acronym{IMAP} Disconnected Mode client. + Some things are currently not implemented in the Agent that you'd might expect from a disconnected @acronym{IMAP} client, including: @@ -19144,16 +19154,6 @@ Creating/deleting nnimap groups when unplugged. @end itemize -Technical note: the synchronization algorithm does not work by ``pushing'' -all local flags to the server, but rather incrementally update the -server view of flags by changing only those flags that were changed by -the user. Thus, if you set one flag on an article, quit the group and -re-select the group and remove the flag; the flag will be set and -removed from the server when you ``synchronize''. The queued flag -operations can be found in the per-server @code{flags} file in the Agent -directory. It's emptied when you synchronize flags. - - @node Outgoing Messages @subsection Outgoing Messages @@ -19237,6 +19237,14 @@ mark articles as unread after downloading. This is usually a safe thing to do as the newly downloaded article has obviously not been read. The default is @code{t}. +@item gnus-agent-synchronize-flags +@vindex gnus-agent-synchronize-flags +If @code{gnus-agent-synchronize-flags} is @code{nil}, the Agent will +never automatically synchronize flags. If it is @code{ask}, which is +the default, the Agent will check if you made any changes and if so +ask if you wish to synchronize these when you re-connect. If it has +any other value, all flags will be synchronized automatically. + @item gnus-agent-consider-all-articles @vindex gnus-agent-consider-all-articles If @code{gnus-agent-consider-all-articles} is non-@code{nil}, the -- 1.7.10.4