*** empty log message ***
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 4 Mar 1997 02:49:40 +0000 (02:49 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 4 Mar 1997 02:49:40 +0000 (02:49 +0000)
14 files changed:
lisp/ChangeLog
lisp/Makefile
lisp/custom.el
lisp/gnus-cache.el
lisp/gnus-ems.el
lisp/gnus-msg.el
lisp/gnus-uu.el
lisp/gnus-vis.el
lisp/gnus.el
lisp/nnbabyl.el
lisp/nndoc.el
lisp/nnfolder.el
lisp/nnmbox.el
texi/gnus.texi

index 7388dc6..330178a 100644 (file)
@@ -1,9 +1,74 @@
-Sat Jul 15 20:08:47 1995  Lars Magne Ingebrigtsen  <lingebri@sunscipw.cern.ch>
+Mon Jul 17 12:28:36 1995  Lars Magne Ingebrigtsen  <lingebri@sunscipw.cern.ch>
+
+       * gnus.el (gnus-summary-prepare-threads): New implementation.
+
+       * gnus-vis.el (gnus-netscape-open-url): Used 10.29isms. 
+
+       * gnus.el (gnus-summary-exit-no-update): Removed call to the cache
+       removal company.
+       (gnus-summary-prepare-untreaded): New function to prepare an
+       unthreaded summary buffer faster.
+       (gnus-summary-mode-map): Bound hide-citation-maybe to `W C'. 
+
+Mon Jul 17 04:24:40 1995  Sudish Joseph <joseph@cis.ohio-state.edu>
+
+       * gnus-cache.el (gnus-cache-save-buffers): Only save the overview
+         file if absolutely necessary.  Delete cache subdirectories when
+         the overview file is empty...actually when the buffer to be saved
+         is empty, so it doesn't delete any existing empty subdirs.
+
+       * gnus-cache.el (gnus-cache-change-buffer): All saving of
+         overviews is through gnus-cache-save-buffers now.  More careful
+         about modification flags on overview buffers to save redundant
+         file reads/writes.
+
+       * gnus-cache.el (gnus-cache-possibly-remove-articles): Added call
+         to gnus-cache-save-buffers to ensure that overviews are written
+         out on group exit.
+
+Mon Jul 17 10:15:35 1995  Lars Magne Ingebrigtsen  <lingebri@sunscipw.cern.ch>
+
+       * gnus.el (gnus-summary-update-lines): Faster implementation.
+
+       * gnus-uu.el (gnus-uu-command): Also escape &'s.
+
+       * gnus-vis.el (gnus-article-make-menu-bar): Only the first menu
+       bar item was defined.
+
+Sun Jul 16 15:15:01 1995  Lars Magne Ingebrigtsen  <lingebri@sunscipw.cern.ch>
+
+       * gnus-msg.el (gnus-summary-supersede-article): Reversed comaprison.
+
+       * gnus.el (gnus-read-old-newsrc-el-file): Add "options" to the
+       options string.
+
+       * nndoc.el (nndoc-insert-article): Weed out babyl extra headers. 
+
+       * gnus-msg.el (gnus-summary-mail-other-window): Configure windows
+       better. 
+
+       * gnus-ems.el (gnus-ems-redefine): Redefine gnus-rebuild-thread
+       for XEmacs. 
+
+       * gnus.el (gnus-all-windows-visible-p): New function. Don't
+       configure windows if all buffers are visible. 
+       (gnus-summary-expand-window): Allow forcing of `article' config. 
+
+       * nnbabyl.el (nnbabyl-active-number): Create new groups on the
+       fly. 
+       * nnfolder.el (nnfolder-active-number): Ditto.
+       * nnmbox.el (nnmbox-active-number): Ditto.
+       
+       * gnus.el (gnus-summary-expire-articles): Didn't use total-expire.
+
+Sat Jul 15 20:08:47 1995  Lars Magne Ingebrigtsen  <lingebri@sunsci4.cern.ch>
 
        * gnus-kill.el (gnus-kill-save-kill-file): New variable.
        (gnus-kill-parse-gnus-kill-file): Don't save kill files unless you
        really want to.
 
+       * gnus.el: 0.96 is released.
+
 Sat Jul 15 03:54:00 1995  Sudish Joseph <joseph@cis.ohio-state.edu>
 
        * gnus-vis.el (gnus-article-add-button): Use overlays for
@@ -68,6 +133,8 @@ Thu Jul 13 12:12:15 1995  Scott Byer  <byer@mv.us.adobe.com>
 
 Thu Jul 13 00:14:09 1995  Lars Magne Ingebrigtsen  <lingebri@sunscipw.cern.ch>
 
+       * 0.95 is released.
+
        * nndoc.el (nndoc-type-to-regexp): Some digests do not start with
        the required over-long --- line.
 
index 7a78744..ce85640 100644 (file)
@@ -2,7 +2,7 @@ EMACS=emacs
 FLAGS=-batch -q -no-site-file -l ./dgnushack.el
 
 all:
-       $(EMACS) $(FLAGS) -f batch-byte-compile *.el
+       rm *.elc ; $(EMACS) $(FLAGS) -f batch-byte-compile *.el
 
 some:
        $(EMACS) $(FLAGS) -f dgnushack-recompile
index e210e50..f0067b2 100644 (file)
@@ -135,8 +135,10 @@ STRING should be given if the last search was by `string-match' on STRING."
 (defvar custom-mouse-face nil)
 (defvar custom-field-active-face nil)
 
-(or (fboundp 'modify-face)
-    ;; Introduced in Emacs 19.29.
+(or (and (fboundp 'modify-face) (not (featurep 'face-lock)))
+    ;; Introduced in Emacs 19.29.  Incompatible definition also introduced
+    ;; by face-lock.el version 3.00 and above for Emacs 19.28 and below.
+    ;; face-lock does not call modify-face, so we can safely redefine it.
     (defun modify-face (face foreground background stipple
                             bold-p italic-p underline-p)
   "Change the display attributes for face FACE.
index 38999e4..9fe6b9e 100644 (file)
 \f
 
 (defun gnus-cache-change-buffer (group)
-  (save-excursion
-    (cond ((null gnus-cache-buffer)
-          ;; No current cache, so we create and init the buffer.
-          (setq gnus-cache-buffer
-                (cons group (get-buffer-create " *gnus-cache-overview*")))
-          (set-buffer (cdr gnus-cache-buffer))
-          (buffer-disable-undo (current-buffer))
-          (erase-buffer)
-          (gnus-add-current-to-buffer-list)
-          (let ((file (gnus-cache-file-name group ".overview")))
-            (and (file-exists-p file)
-                 (insert-file-contents file))))
-         ((not (string= group (car gnus-cache-buffer)))
-          ;; If a different overview cache is the current, we
-          ;; (possibly) save it and change to this groups.
-          (set-buffer (cdr gnus-cache-buffer))
-          (and (buffer-modified-p)
-               (write-region (point-min) (point-max)
-                             (gnus-cache-file-name
-                              (car gnus-cache-buffer) ".overview")
-                             nil 'quiet))
-          (erase-buffer)
-          (setcar gnus-cache-buffer group)
-          (let ((file (gnus-cache-file-name group ".overview")))
-            (and (file-exists-p file)
-                 (insert-file-contents file)))))))
+  (and gnus-cache-buffer
+       ;; see if the current group's overview cache has been loaded 
+       (or (string= group (car gnus-cache-buffer))
+          ;; another overview cache is current, save it
+          (gnus-cache-save-buffers)))
+  ;; if gnus-cache buffer is nil, create it
+  (or gnus-cache-buffer
+      ;; create cache buffer
+      (save-excursion
+       (setq gnus-cache-buffer
+             (cons group
+                   (set-buffer (get-buffer-create " *gnus-cache-overview*"))))
+       (buffer-disable-undo (current-buffer))
+       ;; insert the contents of this groups cache overview
+       (erase-buffer)
+       (let ((file (gnus-cache-file-name group ".overview")))
+         (and (file-exists-p file)
+              (insert-file-contents file)))
+       ;; we have a fresh (empty/just loaded) buffer, 
+       ;; mark it as unmodified to save a redundant write later.
+       (set-buffer-modified-p nil))))
 
 
-;; Just save the overview buffer.
 (defun gnus-cache-save-buffers ()
-  (and gnus-cache-buffer
-       (save-excursion
-        (set-buffer (cdr gnus-cache-buffer))
-        (and (buffer-modified-p)
-             (write-region (point-min) (point-max)
-                           (gnus-cache-file-name (car gnus-cache-buffer)
-                                                 ".overview")
-                           nil 'quiet))))
-  (setq gnus-cache-buffer nil))
+;; save the overview buffer if it exists and has been modified
+;; delete empty cache subdirectories
+  (if (null gnus-cache-buffer)
+      ()
+    (let ((buffer (cdr gnus-cache-buffer))
+         (overview-file (gnus-cache-file-name
+                         (car gnus-cache-buffer) ".overview")))
+      ;; write the overview only if it was modified
+      (if (buffer-modified-p buffer)
+         (save-excursion
+           (set-buffer buffer)
+           (if (> (buffer-size) 0)
+               ;; non-empty overview, write it out
+               (write-region (point-min) (point-max)
+                             overview-file nil 'quietly)
+             ;; empty overview file, remove it
+             (and (file-exists-p overview-file)
+                  (delete-file overview-file))
+             ;; if possible, remove group's cache subdirectory
+             (condition-case nil
+                 ;; FIXME: we can detect the error type and warn the user
+                 ;; of any inconsistencies (articles w/o nov entries?).
+                 ;; for now, just be conservative...delete only if safe -- sj
+                 (delete-directory (file-name-directory overview-file))
+               (error nil)))))
+      ;; kill the buffer, it's either unmodified or saved
+      (gnus-kill-buffer buffer)
+      (setq gnus-cache-buffer nil))))
+
 
 ;; Return whether an article is a member of a class.
 (defun gnus-cache-member-of-class (class ticked dormant unread)
   (setq gnus-cache-removeable-articles
        (cons article gnus-cache-removeable-articles)))
 
+(defsubst gnus-cache-possibly-remove-article 
+  (article ticked dormant unread)
+  (let ((file (gnus-cache-file-name gnus-newsgroup-name article)))
+    (if (or (not (file-exists-p file))
+           (not (gnus-cache-member-of-class
+                 gnus-cache-remove-articles ticked dormant unread)))
+       nil
+      (save-excursion
+       (delete-file file)
+       (set-buffer (cdr gnus-cache-buffer))
+       (goto-char (point-min))
+       (if (or (looking-at (concat (int-to-string article) "\t"))
+               (search-forward (concat "\n" (int-to-string article) "\t")
+                               (point-max) t))
+           (delete-region (progn (beginning-of-line) (point))
+                          (progn (forward-line 1) (point))))))))
+
 (defun gnus-cache-possibly-remove-articles ()
   (let ((articles gnus-cache-removeable-articles)
        (cache-articles (gnus-cache-articles-in-group gnus-newsgroup-name))
           article (memq article gnus-newsgroup-marked)
           (memq article gnus-newsgroup-dormant)
           (or (memq article gnus-newsgroup-unreads)
-              (memq article gnus-newsgroup-unselected)))))))
+              (memq article gnus-newsgroup-unselected))))))
+  ;; the overview file might have been modified, save it
+  ;; safe because we're only called at group exit anyway
+  (gnus-cache-save-buffers))
 
-(defun gnus-cache-possibly-remove-article 
-  (article ticked dormant unread)
-  (let ((file (gnus-cache-file-name gnus-newsgroup-name article)))
-    (if (or (not (file-exists-p file))
-           (not (gnus-cache-member-of-class
-                 gnus-cache-remove-articles ticked dormant unread)))
-       nil
-      (save-excursion
-       (delete-file file)
-       (set-buffer (cdr gnus-cache-buffer))
-       (goto-char (point-min))
-       (if (or (looking-at (concat (int-to-string article) "\t"))
-               (search-forward (concat "\n" (int-to-string article) "\t")
-                               (point-max) t))
-           (delete-region (progn (beginning-of-line) (point))
-                          (progn (forward-line 1) (point))))))))
 
 (defun gnus-cache-request-article (article group)
   (let ((file (gnus-cache-file-name group article)))
index 974fb67..5501cd6 100644 (file)
    ((string-match "XEmacs\\|Lucid" emacs-version)
     ;; XEmacs definitions.
 
-    (defvar gnus-summary-highlight
-      '(((> score default) . bold)
-       ((< score default) . italic))
-      "*Alist of `(FORM . FACE)'.
-Summary lines are highlighted with the FACE for the first FORM which
-evaluate to a non-nil value.  
-
-Point will be at the beginning of the line when FORM is evaluated.
-The following can be used for convenience:
-
-score:   (gnus-summary-article-score)
-default: gnus-summary-default-score
-below:   gnus-summary-mark-below
-
-To check for marks, e.g. to underline replied articles, use
-`gnus-summary-article-mark': 
-
-   ((= (gnus-summary-article-mark) gnus-replied-mark) . underline)")
-
     (setq gnus-mouse-2 [button2])
     (setq gnus-easymenu 'auc-menu)
 
@@ -85,23 +66,25 @@ To check for marks, e.g. to underline replied articles, use
     (or (boundp 'standard-display-table) (setq standard-display-table nil))
     (or (boundp 'read-event) (fset 'read-event 'next-command-event))
 
-    (setq gnus-display-type 
-         (let ((display-resource 
-                (x-get-resource ".displayType" "DisplayType" 'string)))
-           (cond (display-resource (intern (downcase display-resource)))
-                 ((x-display-color-p) 'color)
-                 ((x-display-grayscale-p) 'grayscale)
-                 (t 'mono))))
+    ;; Fix by "jeff (j.d.) sparkes" <jsparkes@bnr.ca>.
+    (setq gnus-display-type (device-class))
 
+    (or (fboundp 'x-color-values)
+       (fset 'x-color-values 
+             (lambda (color)
+               (color-instance-rgb-components
+                (make-color-instance color)))))
+    
     (setq gnus-background-mode 
          (let ((bg-resource 
                 (x-get-resource ".backgroundMode" "BackgroundMode" 'string))
                (params (frame-parameters)))
            (cond (bg-resource (intern (downcase bg-resource)))
-;                ((< (apply '+ (x-color-values
-;                               (cdr (assq 'background-color params))))
-;                    (/ (apply '+ (x-color-values "white")) 3))
-;                 'dark)
+                 ((and (assq 'background-color params)
+                       (< (apply '+ (x-color-values
+                                     (cdr (assq 'background-color params))))
+                          (/ (apply '+ (x-color-values "white")) 3)))
+                  'dark)
                  (t 'light))))
 
     (if (not gnus-visual)
@@ -380,8 +363,9 @@ NOTE: This command only works with newsgroups that use real or simulated NNTP."
                              'gnus-mark gnus-unread-mark 
                              'gnus-level 0
                              'gnus-pseudo (car pslist)))
-             (remove-text-properties (b) (gnus-point-at-eol)
-                                     '(gnus-number nil gnus-mark nil gnus-level nil))
+             (remove-text-properties
+              b (gnus-point-at-eol)
+              '(gnus-number nil gnus-mark nil gnus-level nil))
              (forward-line -1)
              (gnus-sethash (int-to-string gnus-reffed-article-number)
                            (car pslist) gnus-newsgroup-headers-hashtb-by-number)
@@ -400,6 +384,30 @@ call it with the value of the `gnus-data' text property."
             (fun (get-text-property pos 'gnus-callback)))
        (if fun (funcall fun data))))
 
+    ;; Re-build the thread containing ID.
+    (defun gnus-rebuild-thread (id)
+      (let ((dep gnus-newsgroup-dependencies)
+           (buffer-read-only nil)
+           parent headers refs thread art)
+       (while (and id (setq headers
+                            (car (setq art (gnus-gethash (downcase id) dep)))))
+         (setq parent art)
+         (setq id (and (setq refs (header-references headers))
+                       (string-match "\\(<[^>]+>\\) *$" refs)
+                       (substring refs (match-beginning 1) (match-end 1)))))
+       (setq thread (gnus-make-sub-thread (car parent)))
+       (gnus-rebuild-remove-articles thread)
+       (let ((beg (point)))
+         (gnus-summary-prepare-threads (list thread) 0)
+         (save-excursion
+           (while (>= (point) beg)
+             (remove-text-properties
+              (1+ (gnus-point-at-bol)) (1+ (gnus-point-at-eol))
+              '(gnus-number nil gnus-mark nil gnus-level nil))
+             (forward-line -1)))
+         (gnus-summary-update-lines beg (point)))))
+
+
     )
 
    ((boundp 'MULE)
index 696a8c4..6ec1751 100644 (file)
@@ -340,7 +340,7 @@ header line with the old Message-ID."
   (interactive)
   (gnus-set-global-variables)
   (gnus-summary-select-article t)
-  (if (or
+  (if (not
        (string-equal
        (downcase (mail-strip-quoted-names 
                   (header-from gnus-current-headers)))
@@ -1403,6 +1403,8 @@ Customize the variable `gnus-mail-other-window-method' to use another
 mailer."
   (interactive)
   (gnus-set-global-variables)
+  (let ((gnus-mail-buffer nntp-server-buffer))
+    (gnus-configure-windows 'summary-mail))
   (let ((gnus-newsgroup-name gnus-newsgroup-name))
     (funcall gnus-mail-other-window-method)))
 
index 6b79c8f..e7fe380 100644 (file)
@@ -1534,7 +1534,7 @@ The headers will be included in the sequence they are matched.")
 ;; quotes round the file name and escaping any quotes in the file name.
 (defun gnus-uu-command (action file)
   (let ((ofile ""))
-    (while (string-match "!\\|`\\|\"\\|\\$\\|\\\\" file)
+    (while (string-match "!\\|`\\|\"\\|\\$\\|\\\\\\|&" file)
       (progn
        (setq ofile
              (concat ofile (substring file 0 (match-beginning 0)) "\\"
index 02f5601..1e0be55 100644 (file)
@@ -218,107 +218,107 @@ gnus-netscape-start-url:
 
 (defun gnus-group-make-menu-bar ()
   (gnus-visual-turn-off-edit-menu 'group)
-  (and 
-   (not (boundp 'gnus-group-reading-menu)) ;JMP
-   (easy-menu-define
-    gnus-group-reading-menu
-    gnus-group-mode-map
-    ""
-    '("Group"
-      ["Read" gnus-group-read-group t]
-      ["Select" gnus-group-select-group t]
-      ["Catch up" gnus-group-catchup-current t]
-      ["Catch up all articles" gnus-group-catchup-current-all t]
-      ["Check for new articles" gnus-group-get-new-news-this-group t]
-      ["Toggle subscription" gnus-group-unsubscribe-current-group t]
-      ["Kill" gnus-group-kill-group t]
-      ["Yank" gnus-group-yank-group t]
-      ["Describe" gnus-group-describe-group t]
-      ["Fetch FAQ" gnus-group-fetch-faq t]
-      ["Edit kill file" gnus-group-edit-local-kill t]
-      ["Expire articles" gnus-group-expire-articles t]
-      ["Set group level" gnus-group-set-current-level t]
-      ))
+  (or 
+   (boundp 'gnus-group-reading-menu)
+   (progn
+     (easy-menu-define
+      gnus-group-reading-menu
+      gnus-group-mode-map
+      ""
+      '("Group"
+       ["Read" gnus-group-read-group t]
+       ["Select" gnus-group-select-group t]
+       ["Catch up" gnus-group-catchup-current t]
+       ["Catch up all articles" gnus-group-catchup-current-all t]
+       ["Check for new articles" gnus-group-get-new-news-this-group t]
+       ["Toggle subscription" gnus-group-unsubscribe-current-group t]
+       ["Kill" gnus-group-kill-group t]
+       ["Yank" gnus-group-yank-group t]
+       ["Describe" gnus-group-describe-group t]
+       ["Fetch FAQ" gnus-group-fetch-faq t]
+       ["Edit kill file" gnus-group-edit-local-kill t]
+       ["Expire articles" gnus-group-expire-articles t]
+       ["Set group level" gnus-group-set-current-level t]
+       ))
   
-   (easy-menu-define
-    gnus-group-group-menu
-    gnus-group-mode-map
-    ""
-    '("Groups"
-      ("Listing"
-       ["List subscribed groups" gnus-group-list-groups t]
-       ["List all groups" gnus-group-list-all-groups t]
-       ["List groups matching..." gnus-group-list-matching t]
-       ["List killed groups" gnus-group-list-killed t]
-       ["List zombie groups" gnus-group-list-zombies t]
-       ["Describe all groups" gnus-group-describe-all-groups t]
-       ["Group apropos" gnus-group-apropos t]
-       ["Group and description apropos" gnus-group-description-apropos t]
-       ["List groups matching..." gnus-group-list-matching t])
-      ("Mark"
-       ["Mark group" gnus-group-mark-group t]
-       ["Unmark group" gnus-group-unmark-group t]
-       ["Mark region" gnus-group-mark-region t])
-      ("Subscribe"
-       ["Subscribe to random group" gnus-group-unsubscribe-group t]
-       ["Kill all newsgroups in region" gnus-group-kill-region t]
-       ["Kill all zombie groups" gnus-group-kill-all-zombies t])
-      ("Foreign groups"
-       ["Make a foreign group" gnus-group-make-group t]
-       ["Edit a group entry" gnus-group-edit-group t]
-       ["Add a directory group" gnus-group-make-directory-group t]
-       ["Add the help group" gnus-group-make-help-group t]
-       ["Add the archive group" gnus-group-make-archive-group t]
-       ["Make a doc group" gnus-group-make-doc-group t]
-       ["Make a kiboze group" gnus-group-make-kiboze-group t]
-       ["Make a virtual group" gnus-group-make-empty-virtual t]
-       ["Add a group to a virtual" gnus-group-add-to-virtual t])
-      ["Read a directory as a group" gnus-group-enter-directory t]
-      ["Jump to group" gnus-group-jump-to-group t]
-      ["Best unread group" gnus-group-best-unread-group t]
-      ))
-
-   (easy-menu-define
-    gnus-group-post-menu
-    gnus-group-mode-map
-    ""
-    '("Post"
-      ["Send a mail" gnus-group-mail t]
-      ["Post an article" gnus-group-post-news t]
-      ))
+     (easy-menu-define
+      gnus-group-group-menu
+      gnus-group-mode-map
+      ""
+      '("Groups"
+       ("Listing"
+        ["List subscribed groups" gnus-group-list-groups t]
+        ["List all groups" gnus-group-list-all-groups t]
+        ["List groups matching..." gnus-group-list-matching t]
+        ["List killed groups" gnus-group-list-killed t]
+        ["List zombie groups" gnus-group-list-zombies t]
+        ["Describe all groups" gnus-group-describe-all-groups t]
+        ["Group apropos" gnus-group-apropos t]
+        ["Group and description apropos" gnus-group-description-apropos t]
+        ["List groups matching..." gnus-group-list-matching t])
+       ("Mark"
+        ["Mark group" gnus-group-mark-group t]
+        ["Unmark group" gnus-group-unmark-group t]
+        ["Mark region" gnus-group-mark-region t])
+       ("Subscribe"
+        ["Subscribe to random group" gnus-group-unsubscribe-group t]
+        ["Kill all newsgroups in region" gnus-group-kill-region t]
+        ["Kill all zombie groups" gnus-group-kill-all-zombies t])
+       ("Foreign groups"
+        ["Make a foreign group" gnus-group-make-group t]
+        ["Edit a group entry" gnus-group-edit-group t]
+        ["Add a directory group" gnus-group-make-directory-group t]
+        ["Add the help group" gnus-group-make-help-group t]
+        ["Add the archive group" gnus-group-make-archive-group t]
+        ["Make a doc group" gnus-group-make-doc-group t]
+        ["Make a kiboze group" gnus-group-make-kiboze-group t]
+        ["Make a virtual group" gnus-group-make-empty-virtual t]
+        ["Add a group to a virtual" gnus-group-add-to-virtual t])
+       ["Read a directory as a group" gnus-group-enter-directory t]
+       ["Jump to group" gnus-group-jump-to-group t]
+       ["Best unread group" gnus-group-best-unread-group t]
+       ))
+
+     (easy-menu-define
+      gnus-group-post-menu
+      gnus-group-mode-map
+      ""
+      '("Post"
+       ["Send a mail" gnus-group-mail t]
+       ["Post an article" gnus-group-post-news t]
+       ))
   
-   (easy-menu-define
-    gnus-group-misc-menu
-    gnus-group-mode-map
-    ""
-    '("Misc"
-      ["Send a bug report" gnus-bug t]
-      ["Check for new news" gnus-group-get-new-news t]     
-      ["Delete bogus groups" gnus-group-check-bogus-groups t]
-      ["Find new newsgroups" gnus-find-new-newsgroups t]
-      ["Restart Gnus" gnus-group-restart t]
-      ["Read init file" gnus-group-read-init-file t]
-      ["Browse foreign server" gnus-group-browse-foreign-server t]
-      ["Enter server buffer" gnus-group-enter-server-mode t]
-      ["Expire expirable articles" gnus-group-expire-all-groups t]
-      ["Generate any kiboze groups" nnkiboze-generate-groups t]
-      ["Gnus version" gnus-version t]
-      ["Save .newsrc files" gnus-group-save-newsrc t]
-      ["Suspend Gnus" gnus-group-suspend t]
-      ["Clear dribble buffer" gnus-group-clear-dribble t]
-      ["Exit from Gnus" gnus-group-exit t]
-      ["Exit without saving" gnus-group-quit t]
-      ["Edit global kill file" gnus-group-edit-global-kill t]
-      ["Sort group buffer" gnus-group-sort-groups t]
-      ))
-   )                                   ;JMP
-  )
+     (easy-menu-define
+      gnus-group-misc-menu
+      gnus-group-mode-map
+      ""
+      '("Misc"
+       ["Send a bug report" gnus-bug t]
+       ["Check for new news" gnus-group-get-new-news t]     
+       ["Delete bogus groups" gnus-group-check-bogus-groups t]
+       ["Find new newsgroups" gnus-find-new-newsgroups t]
+       ["Restart Gnus" gnus-group-restart t]
+       ["Read init file" gnus-group-read-init-file t]
+       ["Browse foreign server" gnus-group-browse-foreign-server t]
+       ["Enter server buffer" gnus-group-enter-server-mode t]
+       ["Expire expirable articles" gnus-group-expire-all-groups t]
+       ["Generate any kiboze groups" nnkiboze-generate-groups t]
+       ["Gnus version" gnus-version t]
+       ["Save .newsrc files" gnus-group-save-newsrc t]
+       ["Suspend Gnus" gnus-group-suspend t]
+       ["Clear dribble buffer" gnus-group-clear-dribble t]
+       ["Exit from Gnus" gnus-group-exit t]
+       ["Exit without saving" gnus-group-quit t]
+       ["Edit global kill file" gnus-group-edit-global-kill t]
+       ["Sort group buffer" gnus-group-sort-groups t]
+       ))
+     )))
 
 ;; Server mode
 (defun gnus-server-make-menu-bar ()
   (gnus-visual-turn-off-edit-menu 'server)
-  (and 
-   (not (boundp 'gnus-server-menu))    ;JMP
+  (or
+   (boundp 'gnus-server-menu)
    (easy-menu-define
     gnus-server-menu
     gnus-server-mode-map
@@ -337,8 +337,8 @@ gnus-netscape-start-url:
 ;; Browse mode
 (defun gnus-browse-make-menu-bar ()
   (gnus-visual-turn-off-edit-menu 'browse)
-  (and 
-   (not (boundp 'gnus-browse-menu))    ;JMP
+  (or
+   (boundp 'gnus-browse-menu)
    (easy-menu-define
     gnus-browse-menu
     gnus-browse-mode-map
@@ -353,203 +353,203 @@ gnus-netscape-start-url:
 (defun gnus-summary-make-menu-bar ()
   (gnus-visual-turn-off-edit-menu 'summary)
 
-  (and 
-   (not (boundp 'gnus-summary-mark-menu)) ;JMP
-   (easy-menu-define
-    gnus-summary-mark-menu
-    gnus-summary-mode-map
-    ""
-    '("Mark"
-      ("Read"
-       ["Mark as read" gnus-summary-mark-as-read-forward t]
-       ["Mark same subject and select" gnus-summary-kill-same-subject-and-select t]
-       ["Mark same subject" gnus-summary-kill-same-subject t]
-       ["Catchup" gnus-summary-catchup t]
-       ["Catchup all" gnus-summary-catchup-all t]
-       ["Catchup to here" gnus-summary-catchup-to-here t]
-       ["Catchup region" gnus-summary-mark-region-as-read t])
-      ("Various"
-       ["Tick" gnus-summary-tick-article-forward t]
-       ["Mark as dormant" gnus-summary-mark-as-dormant t]
-       ["Remove marks" gnus-summary-clear-mark-forward t]
-       ["Set expirable mark" gnus-summary-mark-as-expirable t]
-       ["Set bookmark" gnus-summary-set-bookmark t]
-       ["Remove bookmark" gnus-summary-remove-bookmark t])
-      ("Display"
-       ["Remove lines marked as read" gnus-summary-remove-lines-marked-as-read t]
-       ["Remove lines marked with..." gnus-summary-remove-lines-marked-with t]
-       ["Show dormant articles" gnus-summary-show-all-dormant t]
-       ["Hide dormant articles" gnus-summary-hide-all-dormant t]
-       ["Show expunged articles" gnus-summary-show-all-expunged t])
-      ("Process mark"
-       ["Set mark" gnus-summary-mark-as-processable t]
-       ["Remove mark" gnus-summary-unmark-as-processable t]
-       ["Remove all marks" gnus-summary-unmark-all-processable t]
-       ["Mark series" gnus-uu-mark-series t]
-       ["Mark region" gnus-uu-mark-region t]
-       ["Mark by regexp" gnus-uu-mark-by-regexp t]
-       ["Mark all" gnus-uu-mark-all t]
-       ["Mark sparse" gnus-uu-mark-sparse t]
-       ["Mark thread" gnus-uu-mark-thread t]
-       )
-      ))
-
-   (easy-menu-define
-    gnus-summary-move-menu
-    gnus-summary-mode-map
-    ""
-    '("Move"
-      ["Scroll article forwards" gnus-summary-next-page t]
-      ["Next unread article" gnus-summary-next-unread-article t]
-      ["Previous unread article" gnus-summary-prev-unread-article t]
-      ["Next article" gnus-summary-next-article t]
-      ["Previous article" gnus-summary-prev-article t]
-      ["Next article same subject" gnus-summary-next-same-subject t]
-      ["Previous article same subject" gnus-summary-prev-same-subject t]
-      ["First unread article" gnus-summary-first-unread-article t]
-      ["Go to subject number..." gnus-summary-goto-subject t]
-      ["Go to the last article" gnus-summary-goto-last-article t]
-      ["Pop article off history" gnus-summary-pop-article t]
-      ))
-
-   (easy-menu-define
-    gnus-summary-article-menu
-    gnus-summary-mode-map
-    ""
-    '("Article"
-      ("Hide"
-       ("Date"
-       ["Local" gnus-article-date-local t]
-       ["UT" gnus-article-date-local t]
-       ["Lapsed" gnus-article-date-local t])
-       ["Headers" gnus-article-hide-headers t]
-       ["Signature" gnus-article-hide-signature t]
-       ["Citation" gnus-article-hide-citation t]
-       ["Overstrike" gnus-article-treat-overstrike t]
-       ["Word wrap" gnus-article-word-wrap t]
-       ["CR" gnus-article-remove-cr t]
-       ["Show X-Face" gnus-article-display-x-face t]
-       ["Quoted-Printable" gnus-article-de-quoted-unreadable t])
-      ("Extract"
-       ["Uudecode" gnus-uu-decode-uu t]
-       ["Uudecode and save" gnus-uu-decode-uu-and-save t]
-       ["Unshar" gnus-uu-decode-unshar t]
-       ["Unshar and save" gnus-uu-decode-unshar-and-save t]
-       ["Save" gnus-uu-decode-save t]
-       ["Binhex" gnus-uu-decode-binhex t])
-      ["Enter digest buffer" gnus-summary-enter-digest-group t]
-      ["Isearch article" gnus-summary-isearch-article t]
-      ["Search all articles" gnus-summary-search-article-forward t]
-      ["Beginning of the article" gnus-summary-beginning-of-article t]
-      ["End of the article" gnus-summary-end-of-article t]
-      ["Fetch parent of article" gnus-summary-refer-parent-article t]
-      ["Fetch article with id..." gnus-summary-refer-article t]
-      ["Stop page breaking" gnus-summary-stop-page-breaking t]
-      ["Rot 13" gnus-summary-caesar-message t]
-      ["Redisplay" gnus-summary-show-article t]
-      ["Toggle header" gnus-summary-toggle-header t]
-      ["Toggle MIME" gnus-summary-toggle-mime t]
-      ["Save" gnus-summary-save-article t]
-      ["Save in mail format" gnus-summary-save-article-mail t]
-      ["Pipe through a filter" gnus-summary-pipe-output t]
-      ("Mail articles"
-       ["Respool article" gnus-summary-respool-article t]
-       ["Move article" gnus-summary-move-article t]
-       ["Copy article" gnus-summary-copy-article t]
-       ["Import file" gnus-summary-import-article t]
-       ["Edit article" gnus-summary-edit-article t]
-       ["Delete article" gnus-summary-delete-article t])
-      ))
-
-   (easy-menu-define
-    gnus-summary-thread-menu
-    gnus-summary-mode-map
-    ""
-    '("Threads"
-      ["Toggle threading" gnus-summary-toggle-threads t]
-      ["Display hidden thread" gnus-summary-show-thread t]
-      ["Hide thread" gnus-summary-hide-thread t]
-      ["Go to next thread" gnus-summary-next-thread t]
-      ["Go to previous thread" gnus-summary-prev-thread t]
-      ["Go down thread" gnus-summary-down-thread t]
-      ["Go up thread" gnus-summary-up-thread t]
-      ["Mark thread as read" gnus-summary-kill-thread t]
-      ["Lower thread score" gnus-summary-lower-thread t]
-      ["Raise thread score" gnus-summary-raise-thread t]
-      ))
-
-   (easy-menu-define
-    gnus-summary-misc-menu
-    gnus-summary-mode-map
-    ""
-    '("Misc"
-      ("Sort"
-       ["Sort by number" gnus-summary-sort-by-number t]
-       ["Sort by author" gnus-summary-sort-by-author t]
-       ["Sort by subject" gnus-summary-sort-by-subject t]
-       ["Sort by date" gnus-summary-sort-by-date t]
-       ["Sort by score" gnus-summary-sort-by-score t])
-      ("Exit"
-       ["Catchup and exit" gnus-summary-catchup-and-exit t]
-       ["Catchup and goto next" gnus-summary-catchup-and-goto-next-group t]
-       ["Exit group" gnus-summary-exit t]
-       ["Exit group without updating" gnus-summary-exit-no-update t]
-       ["Reselect group" gnus-summary-reselect-current-group t]
-       ["Rescan group" gnus-summary-rescan-group t])
-      ["Fetch group FAQ" gnus-summary-fetch-faq t]
-      ["Filter articles" gnus-summary-execute-command t]
-      ["Toggle line truncation" gnus-summary-toggle-truncation t]
-      ["Expire expirable articles" gnus-summary-expire-articles t]
-      ["Describe group" gnus-summary-describe-group t]
-      ["Edit local kill file" gnus-summary-edit-local-kill t]
-      ))
-
-   (easy-menu-define
-    gnus-summary-post-menu
-    gnus-summary-mode-map
-    ""
-    '("Post"
-      ["Post an article" gnus-summary-post-news t]
-      ["Followup" gnus-summary-followup t]
-      ["Followup and yank" gnus-summary-followup-with-original t]
-      ["Supersede article" gnus-summary-supersede-article t]
-      ["Cancel article" gnus-summary-cancel-article t]
-      ["Reply" gnus-summary-reply t]
-      ["Reply and yank" gnus-summary-reply-with-original t]
-      ["Mail forward" gnus-summary-mail-forward t]
-      ["Post forward" gnus-summary-post-forward t]
-      ["Digest and mail" gnus-uu-digest-mail-forward t]
-      ["Digest and post" gnus-uu-digest-post-forward t]
-      ["Send a mail" gnus-summary-mail-other-window t]
-      ["Reply & followup" gnus-summary-followup-and-reply t]
-      ["Reply & followup and yank" gnus-summary-followup-and-reply-with-original t]
-      ["Uuencode and post" gnus-uu-post-news t]
-      ))
-
-   (easy-menu-define
-    gnus-summary-kill-menu
-    gnus-summary-mode-map
-    ""
-    (cons
-     "Score"
-     (nconc
-      (list
-       ["Enter score" gnus-summary-score-entry t])
-      (gnus-visual-score-map 'increase)
-      (gnus-visual-score-map 'lower)
-      '(["Current score" gnus-summary-current-score t]
-       ["Set score" gnus-summary-set-score t]
-       ("Score file"
-        ["Customize score file" gnus-score-customize t]
-        ["Switch current score file" gnus-score-change-score-file t]
-        ["Set mark below" gnus-score-set-mark-below t]
-        ["Set expunge below" gnus-score-set-expunge-below t]
-        ["Edit current score file" gnus-score-edit-alist t]
-        ["Edit score file" gnus-score-edit-file t]
-        ["Trace score" gnus-score-find-trace t])
-       ))))
-   )                                   ; not done already - JMP
-  )
+  (or
+   (boundp 'gnus-summary-mark-menu)
+   (progn
+     (easy-menu-define
+      gnus-summary-mark-menu
+      gnus-summary-mode-map
+      ""
+      '("Mark"
+       ("Read"
+        ["Mark as read" gnus-summary-mark-as-read-forward t]
+        ["Mark same subject and select" gnus-summary-kill-same-subject-and-select t]
+        ["Mark same subject" gnus-summary-kill-same-subject t]
+        ["Catchup" gnus-summary-catchup t]
+        ["Catchup all" gnus-summary-catchup-all t]
+        ["Catchup to here" gnus-summary-catchup-to-here t]
+        ["Catchup region" gnus-summary-mark-region-as-read t])
+       ("Various"
+        ["Tick" gnus-summary-tick-article-forward t]
+        ["Mark as dormant" gnus-summary-mark-as-dormant t]
+        ["Remove marks" gnus-summary-clear-mark-forward t]
+        ["Set expirable mark" gnus-summary-mark-as-expirable t]
+        ["Set bookmark" gnus-summary-set-bookmark t]
+        ["Remove bookmark" gnus-summary-remove-bookmark t])
+       ("Display"
+        ["Remove lines marked as read" gnus-summary-remove-lines-marked-as-read t]
+        ["Remove lines marked with..." gnus-summary-remove-lines-marked-with t]
+        ["Show dormant articles" gnus-summary-show-all-dormant t]
+        ["Hide dormant articles" gnus-summary-hide-all-dormant t]
+        ["Show expunged articles" gnus-summary-show-all-expunged t])
+       ("Process mark"
+        ["Set mark" gnus-summary-mark-as-processable t]
+        ["Remove mark" gnus-summary-unmark-as-processable t]
+        ["Remove all marks" gnus-summary-unmark-all-processable t]
+        ["Mark series" gnus-uu-mark-series t]
+        ["Mark region" gnus-uu-mark-region t]
+        ["Mark by regexp" gnus-uu-mark-by-regexp t]
+        ["Mark all" gnus-uu-mark-all t]
+        ["Mark sparse" gnus-uu-mark-sparse t]
+        ["Mark thread" gnus-uu-mark-thread t]
+        )
+       ))
+
+     (easy-menu-define
+      gnus-summary-move-menu
+      gnus-summary-mode-map
+      ""
+      '("Move"
+       ["Scroll article forwards" gnus-summary-next-page t]
+       ["Next unread article" gnus-summary-next-unread-article t]
+       ["Previous unread article" gnus-summary-prev-unread-article t]
+       ["Next article" gnus-summary-next-article t]
+       ["Previous article" gnus-summary-prev-article t]
+       ["Next article same subject" gnus-summary-next-same-subject t]
+       ["Previous article same subject" gnus-summary-prev-same-subject t]
+       ["First unread article" gnus-summary-first-unread-article t]
+       ["Go to subject number..." gnus-summary-goto-subject t]
+       ["Go to the last article" gnus-summary-goto-last-article t]
+       ["Pop article off history" gnus-summary-pop-article t]
+       ))
+
+     (easy-menu-define
+      gnus-summary-article-menu
+      gnus-summary-mode-map
+      ""
+      '("Article"
+       ("Hide"
+        ("Date"
+         ["Local" gnus-article-date-local t]
+         ["UT" gnus-article-date-local t]
+         ["Lapsed" gnus-article-date-local t])
+        ["Headers" gnus-article-hide-headers t]
+        ["Signature" gnus-article-hide-signature t]
+        ["Citation" gnus-article-hide-citation t]
+        ["Overstrike" gnus-article-treat-overstrike t]
+        ["Word wrap" gnus-article-word-wrap t]
+        ["CR" gnus-article-remove-cr t]
+        ["Show X-Face" gnus-article-display-x-face t]
+        ["Quoted-Printable" gnus-article-de-quoted-unreadable t])
+       ("Extract"
+        ["Uudecode" gnus-uu-decode-uu t]
+        ["Uudecode and save" gnus-uu-decode-uu-and-save t]
+        ["Unshar" gnus-uu-decode-unshar t]
+        ["Unshar and save" gnus-uu-decode-unshar-and-save t]
+        ["Save" gnus-uu-decode-save t]
+        ["Binhex" gnus-uu-decode-binhex t])
+       ["Enter digest buffer" gnus-summary-enter-digest-group t]
+       ["Isearch article" gnus-summary-isearch-article t]
+       ["Search all articles" gnus-summary-search-article-forward t]
+       ["Beginning of the article" gnus-summary-beginning-of-article t]
+       ["End of the article" gnus-summary-end-of-article t]
+       ["Fetch parent of article" gnus-summary-refer-parent-article t]
+       ["Fetch article with id..." gnus-summary-refer-article t]
+       ["Stop page breaking" gnus-summary-stop-page-breaking t]
+       ["Rot 13" gnus-summary-caesar-message t]
+       ["Redisplay" gnus-summary-show-article t]
+       ["Toggle header" gnus-summary-toggle-header t]
+       ["Toggle MIME" gnus-summary-toggle-mime t]
+       ["Save" gnus-summary-save-article t]
+       ["Save in mail format" gnus-summary-save-article-mail t]
+       ["Pipe through a filter" gnus-summary-pipe-output t]
+       ("Mail articles"
+        ["Respool article" gnus-summary-respool-article t]
+        ["Move article" gnus-summary-move-article t]
+        ["Copy article" gnus-summary-copy-article t]
+        ["Import file" gnus-summary-import-article t]
+        ["Edit article" gnus-summary-edit-article t]
+        ["Delete article" gnus-summary-delete-article t])
+       ))
+
+     (easy-menu-define
+      gnus-summary-thread-menu
+      gnus-summary-mode-map
+      ""
+      '("Threads"
+       ["Toggle threading" gnus-summary-toggle-threads t]
+       ["Display hidden thread" gnus-summary-show-thread t]
+       ["Hide thread" gnus-summary-hide-thread t]
+       ["Go to next thread" gnus-summary-next-thread t]
+       ["Go to previous thread" gnus-summary-prev-thread t]
+       ["Go down thread" gnus-summary-down-thread t]
+       ["Go up thread" gnus-summary-up-thread t]
+       ["Mark thread as read" gnus-summary-kill-thread t]
+       ["Lower thread score" gnus-summary-lower-thread t]
+       ["Raise thread score" gnus-summary-raise-thread t]
+       ))
+
+     (easy-menu-define
+      gnus-summary-misc-menu
+      gnus-summary-mode-map
+      ""
+      '("Misc"
+       ("Sort"
+        ["Sort by number" gnus-summary-sort-by-number t]
+        ["Sort by author" gnus-summary-sort-by-author t]
+        ["Sort by subject" gnus-summary-sort-by-subject t]
+        ["Sort by date" gnus-summary-sort-by-date t]
+        ["Sort by score" gnus-summary-sort-by-score t])
+       ("Exit"
+        ["Catchup and exit" gnus-summary-catchup-and-exit t]
+        ["Catchup and goto next" gnus-summary-catchup-and-goto-next-group t]
+        ["Exit group" gnus-summary-exit t]
+        ["Exit group without updating" gnus-summary-exit-no-update t]
+        ["Reselect group" gnus-summary-reselect-current-group t]
+        ["Rescan group" gnus-summary-rescan-group t])
+       ["Fetch group FAQ" gnus-summary-fetch-faq t]
+       ["Filter articles" gnus-summary-execute-command t]
+       ["Toggle line truncation" gnus-summary-toggle-truncation t]
+       ["Expire expirable articles" gnus-summary-expire-articles t]
+       ["Describe group" gnus-summary-describe-group t]
+       ["Edit local kill file" gnus-summary-edit-local-kill t]
+       ))
+
+     (easy-menu-define
+      gnus-summary-post-menu
+      gnus-summary-mode-map
+      ""
+      '("Post"
+       ["Post an article" gnus-summary-post-news t]
+       ["Followup" gnus-summary-followup t]
+       ["Followup and yank" gnus-summary-followup-with-original t]
+       ["Supersede article" gnus-summary-supersede-article t]
+       ["Cancel article" gnus-summary-cancel-article t]
+       ["Reply" gnus-summary-reply t]
+       ["Reply and yank" gnus-summary-reply-with-original t]
+       ["Mail forward" gnus-summary-mail-forward t]
+       ["Post forward" gnus-summary-post-forward t]
+       ["Digest and mail" gnus-uu-digest-mail-forward t]
+       ["Digest and post" gnus-uu-digest-post-forward t]
+       ["Send a mail" gnus-summary-mail-other-window t]
+       ["Reply & followup" gnus-summary-followup-and-reply t]
+       ["Reply & followup and yank" gnus-summary-followup-and-reply-with-original t]
+       ["Uuencode and post" gnus-uu-post-news t]
+       ))
+
+     (easy-menu-define
+      gnus-summary-kill-menu
+      gnus-summary-mode-map
+      ""
+      (cons
+       "Score"
+       (nconc
+       (list
+        ["Enter score" gnus-summary-score-entry t])
+       (gnus-visual-score-map 'increase)
+       (gnus-visual-score-map 'lower)
+       '(["Current score" gnus-summary-current-score t]
+         ["Set score" gnus-summary-set-score t]
+         ("Score file"
+          ["Customize score file" gnus-score-customize t]
+          ["Switch current score file" gnus-score-change-score-file t]
+          ["Set mark below" gnus-score-set-mark-below t]
+          ["Set expunge below" gnus-score-set-expunge-below t]
+          ["Edit current score file" gnus-score-edit-alist t]
+          ["Edit score file" gnus-score-edit-file t]
+          ["Trace score" gnus-score-find-trace t])
+         ))))
+     )))
 
 (defun gnus-visual-score-map (type)
   (if t
@@ -630,35 +630,36 @@ gnus-netscape-start-url:
 ;; Article buffer
 (defun gnus-article-make-menu-bar ()
   (gnus-visual-turn-off-edit-menu 'summary)
-  (and 
-   (not (boundp 'gnus-article-article-menu)) ;JMP
-   (easy-menu-define
-    gnus-article-article-menu
-    gnus-article-mode-map
-    ""
-    '("Article"
-      ["Scroll forwards" gnus-article-next-page t]
-      ["Scroll backwards" gnus-article-prev-page t]
-      ["Show summary" gnus-article-show-summary t]
-      ["Fetch Message-ID at point" gnus-article-refer-article t]
-      ["Mail to address at point" gnus-article-mail t]
-      ["Mail to address at point and include original"
-       gnus-article-mail-with-original t]
-      ))
-
-   (easy-menu-define
-    gnus-article-treatment-menu
-    gnus-article-mode-map
-    ""
-    '("Treatment"
-      ["Hide headers" gnus-article-hide-headers t]
-      ["Hide signature" gnus-article-hide-signature t]
-      ["Hide citation" gnus-article-hide-citation t]
-      ["Treat overstrike" gnus-article-treat-overstrike t]
-      ["Remove carriage return" gnus-article-remove-cr t]
-      ["Remove quoted-unreadable" gnus-article-de-quoted-unreadable t]
-      ))
-   ))
+  (or
+   (boundp 'gnus-article-article-menu)
+   (progn
+     (easy-menu-define
+      gnus-article-article-menu
+      gnus-article-mode-map
+      ""
+      '("Article"
+       ["Scroll forwards" gnus-article-next-page t]
+       ["Scroll backwards" gnus-article-prev-page t]
+       ["Show summary" gnus-article-show-summary t]
+       ["Fetch Message-ID at point" gnus-article-refer-article t]
+       ["Mail to address at point" gnus-article-mail t]
+       ["Mail to address at point and include original"
+        gnus-article-mail-with-original t]
+       ))
+
+     (easy-menu-define
+      gnus-article-treatment-menu
+      gnus-article-mode-map
+      ""
+      '("Treatment"
+       ["Hide headers" gnus-article-hide-headers t]
+       ["Hide signature" gnus-article-hide-signature t]
+       ["Hide citation" gnus-article-hide-citation t]
+       ["Treat overstrike" gnus-article-treat-overstrike t]
+       ["Remove carriage return" gnus-article-remove-cr t]
+       ["Remove quoted-unreadable" gnus-article-de-quoted-unreadable t]
+       ))
+     )))
 
 ;;;
 ;;; summary highlights
@@ -712,8 +713,6 @@ gnus-netscape-start-url:
     (while (and list (not (eval (car (car list)))))
       (setq list (cdr list)))
     (let ((face (and list (cdr (car list)))))
-      ;; BUG! For some reason the text properties of the first
-      ;; characters get mangled.
       (or (eobp)
          (eq face (get-text-property beg 'face))
          (put-text-property beg end 'face face)))
@@ -1078,9 +1077,9 @@ External references are things like message-ids and URLs, as specified by
                                "-remote" 
                                (concat "openUrl(" url ")'"))))
     (set-process-sentinel process 
-                         `(lambda (process change)
-                            (or (eq (process-exit-status process) 0)
-                                (gnus-netscape-start-url ,url))))))
+                         (` (lambda (process change)
+                              (or (eq (process-exit-status process) 0)
+                                  (gnus-netscape-start-url (, url))))))))
 
 (defun gnus-netscape-start-url (url)
   "Start netscape with URL."
index cdeece3..6d7a816 100644 (file)
@@ -1002,9 +1002,10 @@ your `~/.emacs' or set the resource `Emacs.displayType' in your
                                         "BackgroundMode"))
            (params (frame-parameters)))
        (cond (bg-resource (intern (downcase bg-resource)))
-             ((< (apply '+ (x-color-values
-                            (cdr (assq 'background-color params))))
-                 (/ (apply '+ (x-color-values "white")) 3))
+             ((and (cdr (assq 'background-color params))
+                   (< (apply '+ (x-color-values
+                                 (cdr (assq 'background-color params))))
+                      (/ (apply '+ (x-color-values "white")) 3)))
               'dark)
              (t 'light)))
     (error 'light))
@@ -1340,7 +1341,7 @@ variable (string, integer, character, etc).")
 (defconst gnus-maintainer "gnus-bug@ifi.uio.no (The Gnus Bugfixing Girls + Boys)"
   "The mail address of the Gnus maintainers.")
 
-(defconst gnus-version "(ding) Gnus v0.96"
+(defconst gnus-version "(ding) Gnus v0.97"
   "Version number for this version of Gnus.")
 
 (defvar gnus-info-nodes
@@ -2423,107 +2424,136 @@ If optional argument RE-ONLY is non-nil, strip `Re:' only."
        (cons conf (delq (assq (car conf) gnus-buffer-configuration)
                         gnus-buffer-configuration))))
 
-(defun gnus-configure-windows (setting)
+(defun gnus-configure-windows (setting &optional force)
   (setq setting (gnus-windows-old-to-new setting))
   (let ((r (if (symbolp setting)
-                 (cdr (assq setting gnus-buffer-configuration))
-               setting))
+              (cdr (assq setting gnus-buffer-configuration))
+            setting))
        (in-buf (current-buffer))
        rule val w height hor ohor heights sub jump-buffer
-       rel total to-buf)
+       rel total to-buf all-visible)
     (or r (error "No such setting: %s" setting))
 
-    ;; Either remove all windows or just remove all Gnus windows.
-    (if gnus-use-full-window
-       (delete-other-windows)
-      (gnus-remove-some-windows)
-      (switch-to-buffer nntp-server-buffer))
-
-    (while r
-      (setq hor (car r)
-           ohor nil)
-
-      ;; We have to do the (possible) horizontal splitting before the
-      ;; vertical. 
-      (if (and (listp (car hor)) 
-              (eq (car (car hor)) 'horizontal))
-         (progn
-           (split-window 
-            nil
-            (if (integerp (nth 1 (car hor)))
-                (nth 1 (car hor))
-              (- (frame-width) (floor (* (frame-width) (nth 1 (car hor))))))
-            t)
-           (setq hor (cdr hor))))
+    (if (and (not force) (setq all-visible (gnus-all-windows-visible-p r)))
+       ;; All the windows mentioned are already visibe, so we just
+       ;; put point in the assigned buffer, and do not touch the
+       ;; winconf. 
+       (select-window (get-buffer-window all-visible))
+
+      ;; Either remove all windows or just remove all Gnus windows.
+      (if gnus-use-full-window
+         (delete-other-windows)
+       (gnus-remove-some-windows)
+       (switch-to-buffer nntp-server-buffer))
+
+      (while r
+       (setq hor (car r)
+             ohor nil)
+
+       ;; We have to do the (possible) horizontal splitting before the
+       ;; vertical. 
+       (if (and (listp (car hor)) 
+                (eq (car (car hor)) 'horizontal))
+           (progn
+             (split-window 
+              nil
+              (if (integerp (nth 1 (car hor)))
+                  (nth 1 (car hor))
+                (- (frame-width) (floor (* (frame-width) (nth 1 (car hor))))))
+              t)
+             (setq hor (cdr hor))))
 
-      ;; Go through the rules and eval the elements that are to be
-      ;; evaled.  
-      (while hor
+       ;; Go through the rules and eval the elements that are to be
+       ;; evaled.  
+       (while hor
+         (if (setq val (if (vectorp (car hor)) (car hor) (eval (car hor))))
+             (progn
+               ;; Expand short buffer name.
+               (setq w (aref val 0))
+               (and (setq w (cdr (assq w gnus-window-to-buffer)))
+                    (progn
+                      (setq val (apply 'vector (mapcar 'identity val)))
+                      (aset val 0 w)))
+               (setq ohor (cons val ohor))))
+         (setq hor (cdr hor)))
+       (setq rule (cons (nreverse ohor) rule))
+       (setq r (cdr r)))
+      (setq rule (nreverse rule))
+
+      ;; We tally the window sizes.
+      (setq total (window-height))
+      (while rule
+       (setq hor (car rule))
+       (if (and (listp (car hor)) (eq (car (car hor)) 'horizontal))
+           (setq hor (cdr hor)))
+       (setq sub 0)
+       (while hor
+         (setq rel (aref (car hor) 1)
+               heights (cons
+                        (cond ((and (floatp rel) (= 1.0 rel))
+                               'x)
+                              ((integerp rel)
+                               rel)
+                              (t
+                               (max (floor (* total rel)) 4)))
+                        heights)
+               sub (+ sub (if (numberp (car heights)) (car heights) 0))
+               hor (cdr hor)))
+       (setq heights (nreverse heights)
+             hor (car rule))
+
+       ;; We then go through these heighs and create windows for them.
+       (while heights
+         (setq height (car heights)
+               heights (cdr heights))
+         (and (eq height 'x)
+              (setq height (- total sub)))
+         (and heights
+              (split-window nil height))
+         (setq to-buf (aref (car hor) 0))
+         (switch-to-buffer 
+          (cond ((not to-buf)
+                 in-buf)
+                ((symbolp to-buf)
+                 (symbol-value (aref (car hor) 0)))
+                (t
+                 (aref (car hor) 0))))
+         (and (> (length (car hor)) 2)
+              (eq (aref (car hor) 2) 'point)
+              (setq jump-buffer (current-buffer)))
+         (other-window 1)
+         (setq hor (cdr hor)))
+      
+       (setq rule (cdr rule)))
+
+      ;; Finally, we pop to the buffer that's supposed to have point. 
+      (or jump-buffer (error "Missing `point' in spec for %s" setting))
+
+      (select-window (get-buffer-window jump-buffer))
+      (set-buffer jump-buffer))))
+
+(defun gnus-all-windows-visible-p (rule)
+  (let (invisible hor jump-buffer val buffer)
+    ;; Go through the rules and eval the elements that are to be
+    ;; evaled.  
+    (while (and rule (not invisible))
+      (setq hor (car rule)
+           rule (cdr rule))
+      (while (and hor (not invisible))
        (if (setq val (if (vectorp (car hor)) (car hor) (eval (car hor))))
            (progn
              ;; Expand short buffer name.
-             (setq w (aref val 0))
-             (and (setq w (cdr (assq w gnus-window-to-buffer)))
-                  (progn
-                    (setq val (apply 'vector (mapcar (lambda (v) v) val)))
-                    (aset val 0 w)))
-             (setq ohor (cons val ohor))))
-       (setq hor (cdr hor)))
-      (setq rule (cons (nreverse ohor) rule))
-      (setq r (cdr r)))
-    (setq rule (nreverse rule))
-
-    ;; We tally the window sizes.
-    (setq total (window-height))
-    (while rule
-      (setq hor (car rule))
-      (if (and (listp (car hor)) (eq (car (car hor)) 'horizontal))
-         (setq hor (cdr hor)))
-      (setq sub 0)
-      (while hor
-       (setq rel (aref (car hor) 1)
-             heights (cons
-                      (cond ((and (floatp rel) (= 1.0 rel))
-                             'x)
-                            ((integerp rel)
-                             rel)
-                            (t
-                             (max (floor (* total rel)) 4)))
-                      heights)
-             sub (+ sub (if (numberp (car heights)) (car heights) 0))
-             hor (cdr hor)))
-      (setq heights (nreverse heights)
-           hor (car rule))
-
-      ;; We then go through these heighs and create windows for them.
-      (while heights
-       (setq height (car heights)
-             heights (cdr heights))
-       (and (eq height 'x)
-            (setq height (- total sub)))
-       (and heights
-            (split-window nil height))
-       (setq to-buf (aref (car hor) 0))
-       (switch-to-buffer 
-        (cond ((not to-buf)
-               in-buf)
-              ((symbolp to-buf)
-               (symbol-value (aref (car hor) 0)))
-              (t
-               (aref (car hor) 0))))
-       (and (> (length (car hor)) 2)
-            (eq (aref (car hor) 2) 'point)
-            (setq jump-buffer (current-buffer)))
-       (other-window 1)
-       (setq hor (cdr hor)))
-      
-      (setq rule (cdr rule)))
+             (setq buffer (or (cdr (assq (aref val 0) gnus-window-to-buffer))
+                              (aref val 0)))
+             (setq buffer (if (symbolp buffer) (symbol-value buffer)
+                            buffer))
+             (setq jump-buffer (and (> (length val) 2)
+                                    (eq 'point (aref val 2))
+                                    buffer))
+             (setq invisible (not (get-buffer-window buffer)))))
+       (setq hor (cdr hor))))
+    (and (not invisible) jump-buffer)))
 
-    ;; Finally, we pop to the buffer that's supposed to have point. 
-    (or jump-buffer (error "Missing `point' in spec for %s" setting))
-
-    (select-window (get-buffer-window jump-buffer))
-    (set-buffer jump-buffer)))
       
 (defun gnus-remove-some-windows ()
   (let ((buffers gnus-window-to-buffer)
@@ -5262,6 +5292,7 @@ buffer.
   (define-key gnus-summary-wash-map "h" 'gnus-article-hide-headers)
   (define-key gnus-summary-wash-map "s" 'gnus-article-hide-signature)
   (define-key gnus-summary-wash-map "c" 'gnus-article-hide-citation)
+  (define-key gnus-summary-wash-map "C" 'gnus-article-hide-citation-maybe)
   (define-key gnus-summary-wash-map "o" 'gnus-article-treat-overstrike)
   (define-key gnus-summary-wash-map "w" 'gnus-article-word-wrap)
   (define-key gnus-summary-wash-map "d" 'gnus-article-remove-cr)
@@ -5550,15 +5581,35 @@ The following commands are available:
               (run-hooks 'gnus-summary-update-hook))))))
 
 (defun gnus-summary-update-lines (&optional beg end)
-  ;; Rehighlight summary buffer according to `gnus-summary-highlight'.
+  ;; Mark article as read (or not) by taking into account scores.
   (let ((beg (or beg (point-min)))
        (end (or end (point-max))))
-    (save-excursion
-      (set-buffer gnus-summary-buffer)
-      (goto-char beg)
-      (while (and (not (eobp)) (< (point) end))
-       (gnus-summary-update-line)
-       (forward-line 1)))))
+    (if (or (not gnus-summary-default-score)
+           gnus-summary-inhibit-highlight)
+       ()
+      (let ((gnus-summary-inhibit-highlight t)
+           article)
+       (save-excursion
+         (set-buffer gnus-summary-buffer)
+         (goto-char beg)
+         (beginning-of-line)
+         (while (and (not (eobp)) (< (point) end))
+           (if (and gnus-summary-mark-below
+                    (< (or (cdr (assq (get-text-property (point) 'gnus-number)
+                                      gnus-newsgroup-scored))
+                           gnus-summary-default-score 0)
+                       gnus-summary-mark-below))
+               ;; We want to possibly mark it as read...
+               (and (not (memq article gnus-newsgroup-marked))
+                    (not (memq article gnus-newsgroup-dormant))
+                    (memq article gnus-newsgroup-unreads)
+                    (gnus-summary-mark-article nil gnus-low-score-mark))
+             ;; We want to possibly mark it as unread.
+             (and (eq (get-text-property (point) 'gnus-mark) gnus-low-score-mark)
+                  (gnus-summary-mark-article nil gnus-unread-mark)))
+           ;; Do the visual highlights at the same time.
+           (and gnus-visual (run-hooks 'gnus-summary-update-hook))
+           (forward-line 1)))))))
 
 (defun gnus-summary-number-of-articles-in-thread (thread &optional char)
   ;; Sum up all elements (and sub-elements) in a list.
@@ -5709,7 +5760,7 @@ If NO-ARTICLE is non-nil, no article is selected initially."
               (gnus-make-threads-and-expunge)
             (gnus-make-threads))))
        gnus-newsgroup-headers)
-     0 nil nil t)
+     'cull)
     ;; Erase header retrieval message.
     (gnus-summary-update-lines)
     (message "")
@@ -5984,7 +6035,7 @@ If NO-ARTICLE is non-nil, no article is selected initially."
     (setq thread (gnus-make-sub-thread (car parent)))
     (gnus-rebuild-remove-articles thread)
     (let ((beg (point)))
-      (gnus-summary-prepare-threads (list thread) 0)
+      (gnus-summary-prepare-threads (list thread))
       (gnus-summary-update-lines beg (point)))))
 
 ;; Delete all lines in the summary buffer that correspond to articles
@@ -6002,7 +6053,7 @@ If NO-ARTICLE is non-nil, no article is selected initially."
            fun (cdr fun))))
   threads)
 
-(defun gnus-thread-header (thread)
+(defsubst gnus-thread-header (thread)
   ;; Return header of first article in THREAD.
   (if (consp thread)
       (if (stringp (car thread))
@@ -6082,101 +6133,142 @@ Unscored articles will be counted as having a score of zero."
 (defvar gnus-tmp-prev-subject "")
 (defvar gnus-tmp-adopt-thread nil)
 
-;; Basic ideas by Paul Dworkin <paul@media-lab.media.mit.edu>.
-(defun gnus-summary-prepare-threads 
-  (threads level &optional not-child no-subject cull)
+(defun gnus-summary-prepare-threads (threads &optional cull)
   "Prepare summary buffer from THREADS and indentation LEVEL.  
 THREADS is either a list of `(PARENT [(CHILD1 [(GRANDCHILD ...]...) ...])'  
 or a straight list of headers."
-  (let (thread header number subject clevel)
-    (while threads
-      (setq thread (car threads)
-           threads (cdr threads))
-      ;; If `thread' is a cons, hierarchical threads are used.  If not,
-      ;; `thread' is the header.
-      (if (consp thread)
-         (setq header (car thread))
-       (setq header thread)
-       (and cull
-            (or (memq (setq number (header-number header))
-                      gnus-newsgroup-dormant)
-                (and gnus-summary-expunge-below
-                     (< (or (cdr (assq number gnus-newsgroup-scored))
-                            gnus-summary-default-score 0)
-                        gnus-summary-expunge-below)))
-            (progn
-              (setq header nil)
-              (setq gnus-newsgroup-unreads 
-                    (delq number gnus-newsgroup-unreads)))))
-      (cond 
-       ((stringp header)
-       ;; The header is a dummy root.
-       (cond ((eq gnus-summary-make-false-root 'adopt)
-              ;; We let the first article adopt the rest.
-              (let ((gnus-tmp-adopt-thread (list (cdr thread))))
-                (gnus-summary-prepare-threads (list (car (cdr thread))) 0))
-              (setq thread (cdr (cdr thread)))
-              (while thread
-                (gnus-summary-prepare-threads (list (car thread)) 1 t)
-                (setq thread (cdr thread))))
-             ((eq gnus-summary-make-false-root 'dummy)
-              ;; We output a dummy root.
-              (gnus-summary-insert-dummy-line 
-               nil header (header-number (car (car (cdr thread)))))
-              (setq clevel 1))
-             ((eq gnus-summary-make-false-root 'empty)
-              ;; We print the articles with empty subject fields. 
-              (let ((gnus-tmp-adopt-thread (list (cdr thread))))
-                (gnus-summary-prepare-threads (list (car (cdr thread))) 0))
-              (setq thread (cdr (cdr thread)))
-              (while thread
-                (gnus-summary-prepare-threads 
-                 (list (car thread)) 0 nil
-                 (not (and (eq gnus-summary-gather-subject-limit 'fuzzy)
-                           (not (string=  
-                                 (gnus-simplify-subject-re 
-                                  (header-subject (car (car thread))))
-                                 (gnus-simplify-subject-re header))))))
-                (setq thread (cdr thread))))
-             (t
-              ;; We do not make a root for the gathered
-              ;; sub-threads at all.  
-              (setq clevel 0)))
-       ;; Print the sub-threads.
-       (and (consp thread) (cdr thread)
-            (gnus-summary-prepare-threads (cdr thread) clevel)))
-       ;; The header is a real article.
-       (header
-       (setq number (header-number header)
-             subject (header-subject header))
-       (and gnus-newsgroup-async
-            (setq gnus-newsgroup-threads
-                  (cons (cons (header-number header)
-                              (header-lines header)) gnus-newsgroup-threads)))
-       (gnus-summary-insert-line
-        nil header level nil 
-        (cond ((memq number gnus-newsgroup-marked) gnus-ticked-mark)
-              ((memq number gnus-newsgroup-dormant) gnus-dormant-mark)
-              ((memq number gnus-newsgroup-unreads) gnus-unread-mark)
-              ((memq number gnus-newsgroup-expirable) gnus-expirable-mark)
-              (t gnus-ancient-mark))
-        (memq number gnus-newsgroup-replied)
-        (memq number gnus-newsgroup-expirable)
-        (if no-subject 
-            gnus-summary-same-subject
-          (if (or (zerop level)
-                  (and gnus-thread-ignore-subject
-                       (not (string= 
-                             (gnus-simplify-subject-re gnus-tmp-prev-subject)
-                             (gnus-simplify-subject-re subject)))))
-              subject
-            gnus-summary-same-subject))
-        not-child
-        (cdr (assq number gnus-newsgroup-scored)))
-       (setq gnus-tmp-prev-subject subject)
-       ;; Recursively print subthreads.
-       (and (consp thread) (cdr thread)
-            (gnus-summary-prepare-threads (cdr thread) (1+ level))))))))
+  (let (thread header number subject stack state gathered level)
+    (if (vectorp (car threads))
+       ;; If this is a straight (sic) list of headers, then a
+       ;; threaded summary display isn't required, so we just create
+       ;; an unthreaded one.
+       (gnus-summary-prepare-unthreaded threads)
+
+      ;; Do the threaded display.
+      (setq stack (cons (cons 0 threads) stack))
+
+      (while stack
+       (setq state (car stack)
+             level (car state)
+             thread (cdr state)
+             stack (cdr stack)
+             header (car (car thread)))
+
+       (if (stringp header)
+           (progn
+             ;; The header is a dummy root.
+             (cond 
+              ((eq gnus-summary-make-false-root 'adopt)
+               ;; We let the first article adopt the rest.
+               (let ((th (car (cdr (car thread)))))
+                 (while (cdr th)
+                   (setq th (cdr th)))
+                 (setcdr th (cdr (cdr (car thread))))
+                 (setq gathered 
+                       (nconc (mapcar
+                               (lambda (h) (header-number (car h)))
+                               (cdr (cdr (car thread))))
+                              gathered))
+                 (setcdr (cdr (car thread)) nil))
+               (setq level -1))
+              ((eq gnus-summary-make-false-root 'empty)
+               ;; We print adopted articles with empty subject fields.
+               (setq gathered 
+                     (nconc (mapcar
+                             (lambda (h) (header-number (car h)))
+                             (cdr (cdr (car thread))))
+                            gathered))
+               (setq level -1))
+              ((eq gnus-summary-make-false-root 'dummy)
+               ;; We output a dummy root.
+               (gnus-summary-insert-dummy-line 
+                nil header (header-number (car (car (cdr thread))))))
+              (t
+               ;; We do not make a root for the gathered
+               ;; sub-threads at all.  
+               (setq level -1))))
+      
+         (setq number (header-number header)
+               subject (header-subject header))
+
+         ;; Do the async thing.
+         (and gnus-newsgroup-async
+              (setq gnus-newsgroup-threads
+                    (cons (cons number (header-lines header)) 
+                          gnus-newsgroup-threads)))
+
+         ;; We may have to root out some bad articles...
+         (and cull
+              (= level 0)
+              (cond ((memq (setq number (header-number header))
+                           gnus-newsgroup-dormant)
+                     (setq header nil))
+                    ((and gnus-summary-expunge-below
+                          (< (or (cdr (assq number gnus-newsgroup-scored))
+                                 gnus-summary-default-score 0)
+                             gnus-summary-expunge-below))
+                     (setq header nil)
+                     (setq gnus-newsgroup-unreads 
+                           (delq number gnus-newsgroup-unreads)))))
+
+         (gnus-summary-insert-line
+          nil header level nil 
+          (cond ((memq number gnus-newsgroup-marked) gnus-ticked-mark)
+                ((memq number gnus-newsgroup-dormant) gnus-dormant-mark)
+                ((memq number gnus-newsgroup-unreads) gnus-unread-mark)
+                ((memq number gnus-newsgroup-expirable) gnus-expirable-mark)
+                (t gnus-ancient-mark))
+          (memq number gnus-newsgroup-replied)
+          (memq number gnus-newsgroup-expirable)
+          (if (and (eq gnus-summary-make-false-root 'empty)
+                   (memq number gathered))
+              gnus-summary-same-subject
+            (if (or (zerop level)
+                    (and gnus-thread-ignore-subject
+                         (not (string= 
+                               (gnus-simplify-subject-re
+                                gnus-tmp-prev-subject)
+                               (gnus-simplify-subject-re
+                                subject)))))
+                subject
+              gnus-summary-same-subject))
+          (and (eq gnus-summary-make-false-root 'adopt)
+               (memq number gathered))
+          (cdr (assq number gnus-newsgroup-scored))))
+
+       (setq gnus-tmp-prev-subject subject)
+
+       (if (nth 1 thread) 
+           (setq stack (cons (cons (max 0 level) (nthcdr 1 thread)) stack)))
+       (if (cdr (car thread))
+           (setq stack (cons (cons (1+ level) (cdr (car thread))) stack)))))))
+
+
+(defun gnus-summary-prepare-unthreaded (headers)
+  (let (header number)
+
+    ;; Do the async thing, if that is required.
+    (if gnus-newsgroup-async
+       (setq gnus-newsgroup-threads
+             (mapcar (lambda (h) (cons (header-number h) (header-lines h)))
+                     headers)))
+
+    (while headers
+      (setq header (car headers)
+           headers (cdr headers)
+           number (header-number header))
+
+      (gnus-summary-insert-line
+       nil header 0 nil 
+       (cond ((memq number gnus-newsgroup-marked) gnus-ticked-mark)
+            ((memq number gnus-newsgroup-dormant) gnus-dormant-mark)
+            ((memq number gnus-newsgroup-unreads) gnus-unread-mark)
+            ((memq number gnus-newsgroup-expirable) gnus-expirable-mark)
+            (t gnus-ancient-mark))
+       (memq number gnus-newsgroup-replied)
+       (memq number gnus-newsgroup-expirable)
+       (header-subject header) nil
+       (cdr (assq number gnus-newsgroup-scored))))))
 
 (defun gnus-select-newsgroup (group &optional read-all)
   "Select newsgroup GROUP.
@@ -7386,7 +7478,6 @@ gnus-exit-group-hook is called with no arguments if that value is non-nil."
            gnus-expert-user
            (gnus-y-or-n-p "Do you really wanna quit reading this group? "))
        (progn
-         (and gnus-use-cache (gnus-cache-possibly-remove-articles))
          (gnus-close-group group)
          (gnus-summary-clear-local-variables)
          (set-buffer gnus-group-buffer)
@@ -7627,11 +7718,14 @@ If optional argument UNREAD is non-nil, only unread article is selected."
 
 ;; Walking around summary lines with displaying articles.
 
-(defun gnus-summary-expand-window ()
-  "Make the summary buffer take up the entire Emacs frame."
-  (interactive)
+(defun gnus-summary-expand-window (arg)
+  "Make the summary buffer take up the entire Emacs frame.
+Given a prefix, will force an `article' buffer configuration."
+  (interactive "P")
   (gnus-set-global-variables)
-  (gnus-configure-windows 'summary))
+  (if arg
+      (gnus-configure-windows 'article 'force)
+    (gnus-configure-windows 'summary)))
 
 (defun gnus-summary-display-article (article &optional all-header)
   "Display ARTICLE in article buffer."
@@ -7714,7 +7808,7 @@ If BACKWARD, the previous article is selected instead of the next."
       (gnus-extend-newsgroup header backward)
       (let ((buffer-read-only nil))
        (goto-char (if backward (point-min) (point-max)))
-       (gnus-summary-prepare-threads (list header) 0))
+       (gnus-summary-prepare-threads (list header)))
       (gnus-summary-goto-article (if backward gnus-newsgroup-begin
                                   gnus-newsgroup-end)))
      ;; Go to next/previous group.
@@ -8539,12 +8633,18 @@ functions. (Ie. mail newsgroups at present.)"
   (if (and gnus-newsgroup-expirable
           (gnus-check-backend-function 
            'request-expire-articles gnus-newsgroup-name))
-      (let ((expirable gnus-newsgroup-expirable))
+      (let* ((info (nth 2 (gnus-gethash gnus-newsgroup-name 
+                                       gnus-newsrc-hashtb)))
+            (total (memq 'total-expire (nth 5 info)))
+            (expirable (if total
+                           (gnus-list-of-read-articles gnus-newsgroup-name)
+                         (setq gnus-newsgroup-expirable
+                               (sort gnus-newsgroup-expirable '<))))
+            es)
        (gnus-message 6 "Expiring articles...")
        ;; The list of articles that weren't expired is returned.
-       (setq gnus-newsgroup-expirable 
-             (gnus-request-expire-articles gnus-newsgroup-expirable
-                                           gnus-newsgroup-name))
+       (setq es (gnus-request-expire-articles expirable gnus-newsgroup-name))
+       (or total (setq gnus-newsgroup-expirable es))
        ;; We go through the old list of expirable, and mark all
        ;; really expired articles as non-existent.
        (while expirable
@@ -8553,7 +8653,6 @@ functions. (Ie. mail newsgroups at present.)"
          (setq expirable (cdr expirable)))
        (gnus-message 6 "Expiring articles...done"))))
 
-
 (defun gnus-summary-expire-articles-now ()
   "Expunge all expirable articles in the current group.
 This means that *all* articles that are marked as expirable will be
@@ -9283,7 +9382,7 @@ even ticked and dormant ones."
        (gnus-summary-update-lines 
         (point)
         (progn
-          (gnus-summary-prepare-threads (nreverse headers) 0)
+          (gnus-summary-prepare-threads (nreverse headers))
           (point)))))
     (goto-char (point-min))
     (gnus-summary-position-cursor)))
@@ -9305,7 +9404,7 @@ even ticked and dormant ones."
        (gnus-summary-update-lines 
         (point)
         (progn
-          (gnus-summary-prepare-threads (nreverse headers) 0)
+          (gnus-summary-prepare-threads (nreverse headers))
           (point)))))
     (goto-char (point-min))
     (gnus-summary-position-cursor)))
@@ -12401,6 +12500,16 @@ If FORCE is non-nil, the .newsrc file is read."
        (setcar newsrc (car (car newsrc)))
        (setq newsrc (cdr newsrc)))
       (setq gnus-killed-list killed))
+    ;; The .el file version of this variable does not begin with
+    ;; "options", while the .eld version does, so we just add it if it
+    ;; isn't there.
+    (and
+     gnus-newsrc-options 
+     (progn
+       (and (not (string-match "^ *options" gnus-newsrc-options))
+           (setq gnus-newsrc-options (concat "options " gnus-newsrc-options)))
+       (and (not (string-match "\n$" gnus-newsrc-options))
+           (setq gnus-newsrc-options (concat gnus-newsrc-options "\n")))))
     (setq gnus-newsrc-alist (nreverse gnus-newsrc-alist))
     (gnus-make-hashtable-from-newsrc-alist)))
       
index 8908945..0e71418 100644 (file)
 (defun nnbabyl-active-number (group)
   ;; Find the next article number in GROUP.
   (let ((active (car (cdr (assoc group nnbabyl-group-alist)))))
-    (setcdr active (1+ (cdr active)))
+    (if active
+       (setcdr active (1+ (cdr active)))
+      ;; This group is new, so we create a new entry for it.
+      ;; This might be a bit naughty... creating groups on the drop of
+      ;; a hat, but I don't know...
+      (setq nnbabyl-group-alist (cons (list group (setq active (cons 1 1)))
+                                     nnbabyl-group-alist)))
     (cdr active)))
 
 (defun nnbabyl-read-mbox ()
index e0a2a82..60d21cf 100644 (file)
   (list (list 'mbox 
              (concat "^" rmail-unix-mail-delimiter)
              (concat "^" rmail-unix-mail-delimiter)
-             nil "^$" nil nil)
-       (list 'babyl "\^_\^L *\n" "\^_" nil "^$" nil nil)
+             nil "^$" nil nil nil)
+       (list 'babyl "\^_\^L *\n" "\^_" nil "^$" nil nil
+             "\\*\\*\\* EOOH \\*\\*\\*\n\\(^.+\n\\)*")
        (list 'digest
              "^------------------------------*[\n \t]+"
              "^------------------------------[\n \t]+"
              nil "^ ?$"   
              "^------------------------------*[\n \t]+"
-             "^End of"))
+             "^End of" nil))
   "Regular expressions for articles of the various types.")
 
 \f
@@ -54,6 +55,7 @@
 (defvar nndoc-head-end nil)
 (defvar nndoc-first-article nil)
 (defvar nndoc-end-of-file nil)
+(defvar nndoc-body-begin nil)
 
 (defvar nndoc-current-server nil)
 (defvar nndoc-server-alist nil)
@@ -68,6 +70,7 @@
    '(nndoc-current-buffer nil)
    '(nndoc-group-alist nil)
    '(nndoc-end-of-file nil)
+   '(nndoc-body-begin nil)
    '(nndoc-address nil)))
 
 (defconst nndoc-version "nndoc 0.1"
       (setq nndoc-head-begin (nth 2 defs))
       (setq nndoc-head-end (nth 3 defs))
       (setq nndoc-first-article (nth 4 defs))
-      (setq nndoc-end-of-file (nth 5 defs)))
+      (setq nndoc-end-of-file (nth 5 defs))
+      (setq nndoc-body-begin (nth 6 defs)))
     t))
 
 (defun nndoc-close-server (&optional server)
       (erase-buffer)
       (if (stringp article)
          nil
-       (nndoc-narrow-to-article article)
-       (insert-buffer-substring nndoc-current-buffer)
+       (nndoc-insert-article article)
        t))))
 
 (defun nndoc-request-group (group &optional server dont-check)
           (point-max)))
       t)))
 
+;; Insert article ARTICLE in the current buffer.
+(defun nndoc-insert-article (article)
+  (let ((ibuf (current-buffer)))
+    (save-excursion
+      (set-buffer nndoc-current-buffer)
+      (widen)
+      (goto-char (point-min))
+      (while (and (re-search-forward nndoc-article-begin nil t)
+                 (not (zerop (setq article (1- article))))))
+      (if (not (zerop article))
+         ()
+       (narrow-to-region 
+        (match-end 0)
+        (or (and (re-search-forward nndoc-article-end nil t)
+                 (match-beginning 0))
+            (point-max)))
+       (goto-char (point-min))
+       (or (re-search-forward nndoc-head-end nil t)
+           (goto-char (point-max)))
+       (append-to-buffer ibuf (point-min) (point))
+       (and nndoc-body-begin 
+            (re-search-forward nndoc-body-begin nil t))
+       (append-to-buffer ibuf (point) (point-max))
+       t))))
+
 (provide 'nndoc)
 
 ;;; nndoc.el ends here
index 6db355c..51c3e3b 100644 (file)
@@ -564,8 +564,15 @@ such things as moving mail.  All buffers always get killed upon server close.")
 (defun nnfolder-active-number (group)
   (save-excursion 
     (nnfolder-possibly-activate-groups group)
+    ;; Find the next article number in GROUP.
     (let ((active (car (cdr (assoc group nnfolder-group-alist)))))
-      (setcdr active (1+ (cdr active)))
+      (if active
+         (setcdr active (1+ (cdr active)))
+       ;; This group is new, so we create a new entry for it.
+       ;; This might be a bit naughty... creating groups on the drop of
+       ;; a hat, but I don't know...
+       (setq nnfolder-group-alist (cons (list group (setq active (cons 1 1)))
+                                        nnfolder-group-alist)))
       (cdr active))))
 
 ;; This method has a problem if you've accidentally let the active list get
index 5e383b4..0da254f 100644 (file)
     t))
 
 (defun nnmbox-active-number (group)
-  "Find the next article number in GROUP."
+  ;; Find the next article number in GROUP.
   (let ((active (car (cdr (assoc group nnmbox-group-alist)))))
-    (setcdr active (1+ (cdr active)))
+    (if active
+       (setcdr active (1+ (cdr active)))
+      ;; This group is new, so we create a new entry for it.
+      ;; This might be a bit naughty... creating groups on the drop of
+      ;; a hat, but I don't know...
+      (setq nnmbox-group-alist (cons (list group (setq active (cons 1 1)))
+                                     nnmbox-group-alist)))
     (cdr active)))
 
 (defun nnmbox-read-mbox ()
index 5d113ae..7753f10 100644 (file)
@@ -5833,6 +5833,7 @@ Toggle truncation of summary lines (@code{gnus-summary-toggle-truncation}).
 @kindex V e (Summary)
 @findex gnus-summary-expand-window
 Expand the summary buffer window (@code{gnus-summary-expand-window}).
+If given a prefix, force an @code{article} window configuration. 
 @end table
 
 @node The Article Buffer