(gnus-auto-select-on-ephemeral-exit): New variable.
authorKatsumi Yamaoka <yamaoka@jpl.org>
Wed, 9 May 2007 08:23:42 +0000 (08:23 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Wed, 9 May 2007 08:23:42 +0000 (08:23 +0000)
(gnus-handle-ephemeral-exit): Select article according to it.

lisp/ChangeLog
lisp/gnus-sum.el

index 5d2516b..b3b5828 100644 (file)
@@ -1,3 +1,8 @@
+2007-05-09  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-sum.el (gnus-auto-select-on-ephemeral-exit): New variable.
+       (gnus-handle-ephemeral-exit): Select article according to it.
+
 2007-05-08  Reiner Steib  <Reiner.Steib@gmx.de>
 
        * message.el (message-insert-formated-citation-line): Remove newline.
index 5dd6704..2b13a08 100644 (file)
@@ -370,6 +370,28 @@ the first unread article."
   :group 'gnus-summary-maneuvering
   :type 'boolean)
 
+(defcustom gnus-auto-select-on-ephemeral-exit 'next-noselect
+  "What article should be selected after exiting an ephemeral group.
+Valid values include:
+
+`next'
+  Select the next article.
+`next-unread'
+  Select the next unread article.
+`next-noselect'
+  Move the cursor to the next article.  This is the default.
+`next-unread-noselect'
+  Move the cursor to the next unread article.
+
+If it has any other value or there is no next (unread) article, the
+article selected before entering to the ephemeral group will appear."
+  :version "23.0" ;; No Gnus
+  :group 'gnus-summary-maneuvering
+  :type '(choice :format "%{%t%}:\n %[Value Menu%] %v"
+                (const next) (const next-unread)
+                (const next-noselect) (const next-unread-noselect)
+                (sexp :tag "other" :value nil)))
+
 (defcustom gnus-auto-goto-ignores 'unfetched
   "*Says how to handle unfetched articles when maneuvering.
 
@@ -7051,6 +7073,21 @@ The state which existed when entering the ephemeral is reset."
          (gnus-configure-windows (cdr quit-config) 'force))
       (gnus-configure-windows (cdr quit-config) 'force))
     (when (eq major-mode 'gnus-summary-mode)
+      (if (memq gnus-auto-select-on-ephemeral-exit '(next-noselect
+                                                    next-unread-noselect))
+         (when (zerop (cond ((eq gnus-auto-select-on-ephemeral-exit
+                                 'next-noselect)
+                             (gnus-summary-next-subject 1 nil t))
+                            ((eq gnus-auto-select-on-ephemeral-exit
+                                 'next-unread-noselect)
+                             (gnus-summary-next-subject 1 t t))))
+           ;; Hide the article buffer which displays the article different
+           ;; from the one that the cursor points to in the summary buffer.
+           (gnus-configure-windows 'summary 'force))
+       (cond ((eq gnus-auto-select-on-ephemeral-exit 'next)
+              (gnus-summary-next-subject 1))
+             ((eq gnus-auto-select-on-ephemeral-exit 'next-unread)
+              (gnus-summary-next-subject 1 t))))
       (gnus-summary-recenter)
       (gnus-summary-position-point))))