\f
* Changes in Oort Gnus
+** Unread count correct in nnimap groups.
+
+The estimated number of unread articles in the group buffer should now
+be correct for nnimap groups. This is achieved by calling
+`nnimap-fixup-unread-after-getting-new-news' from the
+`gnus-setup-news-hook' (called on startup) and
+gnus-after-getting-new-news-hook. (called after getting new mail). If
+you have modified those variables from the default, you may want to
+add n-f-u-a-g-n-n again. If you were happy with the estimate and want
+to save some (minimal) time when getting new mail, remove the
+function.
+
** Group Carbon Copy (GCC) quoting
To support groups that contains SPC and other weird characters, groups
+2002-09-27 Simon Josefsson <jas@extundo.com>
+
+ * nnimap.el (nnimap-fixup-unread-after-getting-new-news): Autoload
+ it just in case.
+ (nnimap-update-unseen): New function; update unseen count in
+ `n-m-info'.
+ (nnimap-close-group): Call it.
+
+ * gnus-start.el (gnus-setup-news-hook): Add n-f-u-a-g-n-n.
+ (gnus-after-getting-new-news-hook): Ditto.
+
+ * nnimap.el (nnimap-retrieve-groups): Move the quick mail check
+ message into verboselevel 9. Change slow mail check message.
+ (nnimap-retrieve-groups): Use prefixed names in n-mailbox-info.
+ (nnimap-fixup-unread-after-getting-new-news): New function, to be
+ used as a hook after getting new mail.
+
+2002-09-26 Simon Josefsson <jas@extundo.com>
+
+ * imap.el (imap-parse-resp-text-code): The UNSEEN value in
+ SELECT/EXAMINE is first unseen article, not number of unseen
+ articles. Make them distinct by renaming the former to
+ `first-unseen' instead of `unseen'.
+
+ * nnimap.el (nnimap-retrieve-groups): Get uidvalidity and unseen
+ too.
+ (nnimap-retrieve-groups): Don't used cached data if uidvalidity
+ changed.
+ (nnimap-retrieve-groups): Store uidvalidity and unseen data too.
+
+ * gnus-int.el (gnus-server-unopen-status): Defcustom.
+
+ * mml-sec.el (mml-signencrypt-style): Docstring to font-lock
+ better.
+
+ * mml2015.el (mml2015-pgg-decrypt): Only add security information
+ if dissecting resulting buffer actually had any information.
+
2002-09-26 Katsumi Yamaoka <yamaoka@jpl.org>
* gnus-group.el (gnus-group-sort-by-method): Remove `symbol-name'
:group 'gnus-start
:type 'hook)
-(defvar gnus-server-unopen-status nil
+(defcustom gnus-server-unopen-status nil
"The default status if the server is not able to open.
If the server is covered by Gnus agent, the possible values are
`denied', set the server denied; `offline', set the server offline;
`nil', ask user. If the server is not covered by Gnus agent, set the
-server denied.")
+server denied."
+ :group 'gnus-start
+ :type '(choice (const :tag "Ask" nil)
+ (const :tag "Deny server" denied)
+ (const :tag "Unplugg Agent" offline)))
;;;
;;; Server Communication
:group 'gnus-start
:type 'hook)
-(defcustom gnus-setup-news-hook nil
+(defcustom gnus-setup-news-hook '(nnimap-fixup-unread-after-getting-new-news)
"A hook after reading the .newsrc file, but before generating the buffer."
:group 'gnus-start
:type 'hook)
:type 'hook)
(defcustom gnus-after-getting-new-news-hook
- '(gnus-display-time-event-handler)
+ '(gnus-display-time-event-handler
+ nnimap-fixup-unread-after-getting-new-news)
"A hook run after Gnus checks for new news when Gnus is already running."
:group 'gnus-group-new
:type 'hook)
((search-forward "UIDNEXT \\([0-9]+\\)" nil t)
(imap-mailbox-put 'uidnext (match-string 1)))
((search-forward "UNSEEN " nil t)
- (imap-mailbox-put 'unseen (read (current-buffer))))
+ (imap-mailbox-put 'first-unseen (read (current-buffer))))
((looking-at "UIDVALIDITY \\([0-9]+\\)")
(imap-mailbox-put 'uidvalidity (match-string 1)))
((search-forward "READ-ONLY" nil t)
(defun mml-signencrypt-style (method &optional style)
"Function for setting/getting the signencrypt-style used. Takes two
arguments, the method (e.g. \"pgp\") and optionally the mode
-(e.g. combined). If the mode is omitted, the current value is returned.
+\(e.g. combined). If the mode is omitted, the current value is returned.
For example, if you prefer to use combined sign & encrypt with
smime, putting the following in your Gnus startup file will
enable that behavior:
- (mml-set-signencrypt-style \"smime\" combined)"
+\(mml-set-signencrypt-style \"smime\" combined)"
(let ((style-item (assoc method mml-signencrypt-style-alist)))
(if style-item
(if (or (eq style 'separate)
(if (condition-case err
(prog1
(pgg-decrypt-region (point-min) (point-max))
- (setq decrypt-status (with-current-buffer mml2015-result-buffer
- (buffer-string))))
+ (setq decrypt-status
+ (with-current-buffer mml2015-result-buffer
+ (buffer-string))))
(error
(mm-set-handle-multipart-parameter
mm-security-handle 'gnus-details (mml2015-format-error err))
mm-security-handle 'gnus-info "OK")
(mm-set-handle-multipart-parameter
mm-security-handle 'gnus-details
- (concat decrypt-status "\n" (mm-handle-multipart-ctl-parameter handles 'gnus-details)))
+ (concat decrypt-status
+ (when (stringp (car handles))
+ "\n" (mm-handle-multipart-ctl-parameter
+ handles 'gnus-details))))
(if (listp (car handles))
handles
(list handles)))
(nnheader-report 'nnimap "Group %s selected" group)
t)))))
+(defun nnimap-update-unseen (group &optional server)
+ "Update the unseen count in `nnimap-mailbox-info'."
+ (gnus-sethash
+ (gnus-group-prefixed-name group server)
+ (let ((old (gnus-gethash (gnus-group-prefixed-name group server)
+ nnimap-mailbox-info)))
+ (list (nth 0 old) (nth 1 old)
+ (imap-mailbox-status group 'unseen nnimap-server-buffer)
+ (nth 3 old)))
+ nnimap-mailbox-info))
+
(defun nnimap-close-group (group &optional server)
(with-current-buffer nnimap-server-buffer
(when (and (imap-opened)
(nnimap-possibly-change-group group server))
+ (nnimap-update-unseen group server)
(case nnimap-expunge-on-close
(always (progn
(imap-mailbox-expunge nnimap-close-asynchronous)
(if (null nnimap-retrieve-groups-asynchronous)
(setq slowgroups groups)
(dolist (group groups)
- (gnus-message 7 "nnimap: Checking mailbox %s" group)
- (add-to-list (if (gnus-gethash-safe (concat server group)
- nnimap-mailbox-info)
+ (gnus-message 9 "nnimap: Quickly checking mailbox %s" group)
+ (add-to-list (if (gnus-gethash-safe
+ (gnus-group-prefixed-name group server)
+ nnimap-mailbox-info)
'asyncgroups
'slowgroups)
(list group (imap-mailbox-status-asynch
- group 'uidnext nnimap-server-buffer))))
+ group '(uidvalidity uidnext unseen)
+ nnimap-server-buffer))))
(dolist (asyncgroup asyncgroups)
(let ((group (nth 0 asyncgroup))
(tag (nth 1 asyncgroup))
new old)
(when (imap-ok-p (imap-wait-for-tag tag nnimap-server-buffer))
- (if (nnimap-string-lessp-numerical
- (car (gnus-gethash
- (concat server group) nnimap-mailbox-info))
- (imap-mailbox-get 'uidnext group nnimap-server-buffer))
+ (if (or (not (string=
+ (nth 0 (gnus-gethash (gnus-group-prefixed-name
+ group server)
+ nnimap-mailbox-info))
+ (imap-mailbox-get 'uidvalidity group
+ nnimap-server-buffer)))
+ (not (string=
+ (nth 1 (gnus-gethash (gnus-group-prefixed-name
+ group server)
+ nnimap-mailbox-info))
+ (imap-mailbox-get 'uidnext group
+ nnimap-server-buffer))))
(push (list group) slowgroups)
- (insert (cdr (gnus-gethash (concat server group)
- nnimap-mailbox-info))))))))
+ (insert (nth 3 (gnus-gethash (gnus-group-prefixed-name
+ group server)
+ nnimap-mailbox-info))))))))
(dolist (group slowgroups)
(if nnimap-retrieve-groups-asynchronous
(setq group (car group)))
- (gnus-message 7 "nnimap: Rechecking mailbox %s" group)
+ (gnus-message 7 "nnimap: Mailbox %s modified" group)
(imap-mailbox-put 'uidnext nil group nnimap-server-buffer)
(or (member "\\NoSelect" (imap-mailbox-get 'list-flags group
nnimap-server-buffer))
(insert str)
(when nnimap-retrieve-groups-asynchronous
(gnus-sethash
- (concat server group)
- (cons (or (imap-mailbox-get
+ (gnus-group-prefixed-name group server)
+ (list (or (imap-mailbox-get
+ 'uidvalidity group nnimap-server-buffer)
+ (imap-mailbox-status
+ group 'uidvalidity nnimap-server-buffer))
+ (or (imap-mailbox-get
'uidnext group nnimap-server-buffer)
(imap-mailbox-status
group 'uidnext nnimap-server-buffer))
+ (or (imap-mailbox-get
+ 'unseen group nnimap-server-buffer)
+ (imap-mailbox-status
+ group 'unseen nnimap-server-buffer))
str)
nnimap-mailbox-info)))))))
(gnus-message 5 "nnimap: Checking mailboxes...done")
"Return t iff MARK can be permanently (between IMAP sessions) saved on articles, in GROUP."
(imap-message-flag-permanent-p (nnimap-mark-to-flag mark)))
+;;;###autoload
+(defun nnimap-fixup-unread-after-getting-new-news ()
+ (let (server group info)
+ (mapatoms
+ (lambda (sym)
+ (when (and (setq group (symbol-name sym))
+ (gnus-group-entry group)
+ (setq info (symbol-value sym)))
+ (gnus-sethash group (cons (nth 2 info) (cdr (gnus-group-entry group)))
+ gnus-newsrc-hashtb)))
+ nnimap-mailbox-info)))
+
(when nnimap-debug
(require 'trace)
(buffer-disable-undo (get-buffer-create nnimap-debug))
+2002-09-26 Simon Josefsson <jas@extundo.com>
+
+ * gnus.texi (Agent Variables): Add.
+
2002-09-25 Simon Josefsson <jas@extundo.com>
* gnus.texi (Troubleshooting): Add.
\e$B$,%G%#%U%)%k%H$G$9$,!"%(!<%8%'%s%H$O:F@\B3$9$k$H$-$K%*%U%i%$%s>uBV$N%5!<\e(B
\e$B%P!<$r%*%s%i%$%s>uBV$K$9$k$+$I$&$+$r?R$M$^$9!#$=$l0J30$NCM$@$C$?$i!"%*%U\e(B
\e$B%i%$%s>uBV$N%5!<%P!<$O<+F0E*$K%*%s%i%$%s>uBV$K$J$j$^$9!#\e(B
+
+@item gnus-server-unopen-status
+@vindex gnus-server-unopen-status
+\e$B$?$V$s%(!<%8%'%s%HJQ?t$G$O$J$$$,%(!<%8%'%s%H$KL)@\$K4XO"$9$k$3$NJQ?t$O!"\e(B
+gnus \e$B$,%5!<%P!<$K@\B3$G$-$J$H$-$K2?$,5/$-$?$+$rJ*8l$j$^$9!#%(!<%8%'%s%H\e(B
+\e$B$,3h@-2=$5$l$k$H!"%G%U%)%k%H$N\e(B @code{nil} \e$B$G$O!"%f!<%6!<$,%5!<%P!<$H$N@\\e(B
+\e$BB3$r@d$D$+%(!<%8%'%s%H$r\e(B unplug \e$B$K$9$k$+$r\e(B gnus \e$B$K?R$M$5$;$^$9!#%(!<%8%'\e(B
+\e$B%s%H$,IT3h@-2=$5$l$k$H!"\e(Bgnus \e$B$O$$$D$bC1$K%5!<%P!<$H$N@\B3$r@d$A$^$9!#$3\e(B
+\e$B$NJQ?t$NB>$NA*Br;h$K$O\e(B @code{denied} \e$B$H\e(B @code{offline} \e$B$,$"$j!"%(!<%8%'\e(B
+\e$B%s%H$,;H$o$l$k>l9g$O8e<T$@$1$,M-8z$G$9!#\e(B
@end table
@node Example Setup
other value, all offline servers will be automatically switched into
online status.
+@item gnus-server-unopen-status
+@vindex gnus-server-unopen-status
+Perhaps not a Agent variable, but closely related to the Agent, this
+variable says what will happen if Gnus cannot open a server. If the
+Agent is enabled, the default, @code{nil}, makes Gnus ask the user
+whether to deny the server or whether to unplug the agent. If the
+Agent is disabled, Gnus always simply deny the server. Other choices
+for this variable include @code{denied} and @code{offline} the latter
+is only valid if the Agent is used.
+
@end table