*** empty log message ***
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 4 Mar 1997 02:53:13 +0000 (02:53 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 4 Mar 1997 02:53:13 +0000 (02:53 +0000)
16 files changed:
lisp/ChangeLog
lisp/dgnushack.el
lisp/gnus-cache.el
lisp/gnus-ems.el
lisp/gnus-kill.el
lisp/gnus-msg.el
lisp/gnus-vis.el
lisp/gnus.el
lisp/nnbabyl.el
lisp/nndoc.el
lisp/nnfolder.el
lisp/nnmail.el
lisp/nnmbox.el
lisp/nnmh.el
lisp/nnml.el
texi/gnus.texi

index a27f90f..cf0d7f4 100644 (file)
@@ -1,4 +1,81 @@
-Tue Jul 18 13:38:27 1995  Lars Magne Ingebrigtsen  <lingebri@sunscipw.cern.ch>
+Thu Jul 20 00:02:30 1995  Lars Magne Ingebrigtsen  <lingebri@sunscipw.cern.ch>
+
+       * gnus-vis.el (gnus-article-add-buttons): Buttonize the headers. 
+
+       * nndoc.el (nndoc-insert-article): Don't insert the status line. 
+
+       * gnus-vis.el (gnus-article-add-buttons): Do a `nil t' on the
+       search.
+
+       * nnml.el (nnml-request-replace-article): Would bug out on
+       slightly corrupted NOV files.
+
+       * gnus-ems.el (gnus-ems-redefine): max-width for Mule was wrong. 
+
+       * nnbabyl.el (nnbabyl-request-expire-articles): Didn't use the
+       is-old shortcut.
+       * nnmbox.el (nnmbox-request-expire-articles): Ditto.
+
+       * gnus-msg.el (gnus-mail-forward-using-mail): Force window config.
+       (gnus-bug-mail-send-and-exit): New command.
+       (gnus-bug): Use it.
+       (gnus-summary-mail-other-window): Configured windows strangely. 
+
+       * gnus.el (gnus-gnus-to-newsrc-format): Wouldn't save
+       .newsrc-SERVER, but just .newsrc.
+       (gnus-make-newsrc-file): Would not find .newsrc-SERVER.eld if
+       .newsrc-SERVER didn't exist.
+
+       * nndoc.el (nndoc-set-header-dependent-regexps): New function.
+       (nndoc-request-group): Use it.
+
+Wed Jul 19 17:07:11 1995  Lars Magne Ingebrigtsen  <lingebri@sunscipw.cern.ch>
+
+       * gnus-ems.el: Defvar instead of setq.
+
+       * gnus.el (gnus-summary-expire-articles): Don't do anything if
+       there are no articles to expire.
+       (gnus-unload): New command.
+
+       * nnmh.el (nnmh-possibly-create-directory): Would create "a/b/c"
+       dirs when "a.b.c" dir was requested.
+
+       * gnus.el (gnus-newsrc-to-gnus-format): Also recognize "Options". 
+
+       * nnmail.el (nnmail-activate): New function for faster activation.
+
+       * gnus.el (gnus-summary-expire-articles): Be slightly faster.
+
+       * gnus-cache.el (gnus-cache-possibly-enter-article): Bugged out on
+       dummy roots.
+
+       * gnus.el (gnus-summary-update-lines): Didn't set the article number.
+       (gnus-summary-exit): Force a group window config.
+       (gnus-select-newsgroup): Copy all marks lists.
+       (gnus-group-sort-groups): Would not heed the last `l' or `L'. 
+
+       * nndoc.el (nndoc-retrieve-headers): Would sometimes be in the
+       wrong buffer for folding continuation lines.
+
+       * gnus-ems.el (gnus-ems-redefine): Redefine
+       `gnus-article-add-button' for XEmacs.
+
+       * gnus.el (gnus-summary-mark-forward): Never go to the next unread
+       article when marking as unread.
+
+       * gnus-kill.el (gnus-kill-file-enter-kill): Wouldn't allow editing
+       of the global kill file. 
+
+       * gnus.el (gnus-summary-mode): Don't update format specs.
+
+Tue Jul 18 16:39:31 1995  Lars Magne Ingebrigtsen  <lingebri@sunscipw.cern.ch>
+
+       * gnus.el (gnus-summary-number-of-articles-in-thread): Didn't work
+       with the new thread machine.
+
+Tue Jul 18 13:38:27 1995  Lars Magne Ingebrigtsen  <lingebri@sunsci4.cern.ch>
+
+       * gnus.el: 0.97.2 is released.
 
        * gnus.el (gnus-thread-header): Define as a macro.
        (gnus-all-windows-visible-p): Don't barf on horizontal specs. 
index 85b4498..ba19e70 100644 (file)
 
 ;;; Code:
 
+(setq byte-compile-warnings '(free-vars unresolved callargs redefine))
+
 (setq load-path (cons "." load-path))
 
 (defun dgnushack-recompile ()
-  (byte-recompile-directory "."))
+  (byte-recompile-directory "." 0))
 
 ;;; dgnushack.el ends here  
 
index cab32c3..b62203d 100644 (file)
   (group article headers ticked dormant unread)
   (let ((number (header-number headers))
        file dir)
-    (if (or (not (gnus-cache-member-of-class
+    (if (or (not (vectorp headers)) ; This might be a dummy article.
+           (not (gnus-cache-member-of-class
                  gnus-cache-enter-articles ticked dormant unread))
            (file-exists-p (setq file (gnus-cache-file-name group article))))
-       ()
+       () ; Do nothing.
       ;; Possibly create the cache directory.
       (or (file-exists-p (setq dir (file-name-directory file)))
          (gnus-make-directory dir))
        (gnus-summary-select-article)
        (save-excursion
          (set-buffer gnus-article-buffer)
-         (write-region (point-min) (point-max) file nil 'quiet)
+         (save-restriction
+           (widen)
+           (write-region (point-min) (point-max) file nil 'quiet))
          (gnus-cache-change-buffer group)
          (set-buffer (cdr gnus-cache-buffer))
          (goto-char (point-max))
index bee81e1..a68e43f 100644 (file)
 ;; bore.  
 
 (eval
- '(cond 
-   ((string-match "XEmacs\\|Lucid" emacs-version)
-    ;; XEmacs definitions.
-
-    (setq gnus-mouse-2 [button2])
-    (setq gnus-easymenu 'auc-menu)
-
-    (or (memq 'underline (list-faces))
-       (funcall (intern "make-face") 'underline))
-    ;; Must avoid calling set-face-underline-p directly, because it
-    ;; is a defsubst in emacs19, and will make the .elc files non
-    ;; portable!
-    (or (face-differs-from-default-p 'underline)
-       (funcall 'set-face-underline-p 'underline t))
-    (or (fboundp 'set-text-properties)
-       (defun set-text-properties (start end props &optional buffer)
-         (if (or (null buffer) (bufferp buffer))
-             (if props
-                 (while props
-                   (put-text-property 
-                    start end (car props) (nth 1 props) buffer)
-                   (setq props (nthcdr 2 props)))
-               (remove-text-properties start end ())))))
-
-    (or (fboundp 'make-overlay) (fset 'make-overlay 'make-extent))
-    (or (fboundp 'overlay-put) (fset 'overlay-put 'set-extent-property))
-    (or (fboundp 'move-overlay) 
-        (defun move-overlay (extent start end &optional buffer)
-          (set-extent-endpoints extent start end)))
-    (or (boundp 'standard-display-table) (setq standard-display-table nil))
-    (or (boundp 'read-event) (fset 'read-event 'next-command-event))
-
-    ;; 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)))
-                 ((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)
+ '(progn
+    (if (string-match "XEmacs\\|Lucid" emacs-version)
        ()
-      (setq gnus-group-mode-hook
-           (cons
-            '(lambda ()
-              (easy-menu-add gnus-group-reading-menu)
-              (easy-menu-add gnus-group-group-menu)
-              (easy-menu-add gnus-group-post-menu)
-              (easy-menu-add gnus-group-misc-menu)
-              (gnus-install-mouse-tracker)) 
-            gnus-group-mode-hook))
-      (setq gnus-summary-mode-hook
-           (cons
-            '(lambda ()
-              (easy-menu-add gnus-summary-mark-menu)
-              (easy-menu-add gnus-summary-move-menu)
-              (easy-menu-add gnus-summary-article-menu)
-              (easy-menu-add gnus-summary-thread-menu)
-              (easy-menu-add gnus-summary-misc-menu)
-              (easy-menu-add gnus-summary-post-menu)
-              (easy-menu-add gnus-summary-kill-menu)
-              (gnus-install-mouse-tracker)) 
-            gnus-summary-mode-hook))
-      (setq gnus-article-mode-hook
-           (cons
-            '(lambda ()
-              (easy-menu-add gnus-article-article-menu)
-              (easy-menu-add gnus-article-treatment-menu))
-            gnus-article-mode-hook)))
-
-    (defun gnus-install-mouse-tracker ()
-      (require 'mode-motion)
-      (setq mode-motion-hook 'mode-motion-highlight-line)))
-
-   ((and (not (string-match "28.9" emacs-version)) 
-        (not (string-match "29" emacs-version)))
-    (setq gnus-hidden-properties '(invisible t))
-    (or (fboundp 'buffer-substring-no-properties)
-       (defun buffer-substring-no-properties (beg end)
-         (format "%s" (buffer-substring beg end)))))
+      ;; Added by Per Abrahamsen <amanda@iesd.auc.dk>.
+      (defvar gnus-display-type 
+       (condition-case nil
+           (let ((display-resource (x-get-resource ".displayType" "DisplayType")))
+             (cond (display-resource (intern (downcase display-resource)))
+                   ((x-display-color-p) 'color)
+                   ((x-display-grayscale-p) 'grayscale)
+                   (t 'mono)))
+         (error 'mono))
+       "A symbol indicating the display Emacs is running under.
+The symbol should be one of `color', `grayscale' or `mono'. If Emacs
+guesses this display attribute wrongly, either set this variable in
+your `~/.emacs' or set the resource `Emacs.displayType' in your
+`~/.Xdefaults'. See also `gnus-background-mode'.
+
+This is a meta-variable that will affect what default values other
+variables get.  You would normally not change this variable, but
+pounce directly on the real variables themselves.")
+
+      (defvar gnus-background-mode 
+       (condition-case nil
+           (let ((bg-resource (x-get-resource ".backgroundMode"
+                                              "BackgroundMode"))
+                 (params (frame-parameters)))
+             (cond (bg-resource (intern (downcase bg-resource)))
+                   ((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))
+       "A symbol indicating the Emacs background brightness.
+The symbol should be one of `light' or `dark'.
+If Emacs guesses this frame attribute wrongly, either set this variable in
+your `~/.emacs' or set the resource `Emacs.backgroundMode' in your
+`~/.Xdefaults'.
+See also `gnus-display-type'.
+
+This is a meta-variable that will affect what default values other
+variables get.  You would normally not change this variable, but
+pounce directly on the real variables themselves."))
+
+    (cond 
+     ((string-match "XEmacs\\|Lucid" emacs-version)
+      ;; XEmacs definitions.
+
+      (setq gnus-mouse-2 [button2])
+      (setq gnus-easymenu 'auc-menu)
+
+      (or (memq 'underline (list-faces))
+         (funcall (intern "make-face") 'underline))
+      ;; Must avoid calling set-face-underline-p directly, because it
+      ;; is a defsubst in emacs19, and will make the .elc files non
+      ;; portable!
+      (or (face-differs-from-default-p 'underline)
+         (funcall 'set-face-underline-p 'underline t))
+      (or (fboundp 'set-text-properties)
+         (defun set-text-properties (start end props &optional buffer)
+           (if (or (null buffer) (bufferp buffer))
+               (if props
+                   (while props
+                     (put-text-property 
+                      start end (car props) (nth 1 props) buffer)
+                     (setq props (nthcdr 2 props)))
+                 (remove-text-properties start end ())))))
+
+      (or (fboundp 'make-overlay) (fset 'make-overlay 'make-extent))
+      (or (fboundp 'overlay-put) (fset 'overlay-put 'set-extent-property))
+      (or (fboundp 'move-overlay) 
+         (defun move-overlay (extent start end &optional buffer)
+           (set-extent-endpoints extent start end)))
+      (or (boundp 'standard-display-table) (setq standard-display-table nil))
+      (or (boundp 'read-event) (fset 'read-event 'next-command-event))
+
+      ;; Fix by "jeff (j.d.) sparkes" <jsparkes@bnr.ca>.
+      (defvar gnus-display-type (device-class)
+       "A symbol indicating the display Emacs is running under.
+The symbol should be one of `color', `grayscale' or `mono'. If Emacs
+guesses this display attribute wrongly, either set this variable in
+your `~/.emacs' or set the resource `Emacs.displayType' in your
+`~/.Xdefaults'. See also `gnus-background-mode'.
+
+This is a meta-variable that will affect what default values other
+variables get.  You would normally not change this variable, but
+pounce directly on the real variables themselves.")
+
+
+      (or (fboundp 'x-color-values)
+         (fset 'x-color-values 
+               (lambda (color)
+                 (color-instance-rgb-components
+                  (make-color-instance color)))))
+    
+      (defvar gnus-background-mode 
+       (let ((bg-resource 
+              (x-get-resource ".backgroundMode" "BackgroundMode" 'string))
+             (params (frame-parameters)))
+         (cond (bg-resource (intern (downcase bg-resource)))
+               ((and (assq 'background-color params)
+                     (< (apply '+ (x-color-values
+                                   (cdr (assq 'background-color params))))
+                        (/ (apply '+ (x-color-values "white")) 3)))
+                'dark)
+               (t 'light)))
+       "A symbol indicating the Emacs background brightness.
+The symbol should be one of `light' or `dark'.
+If Emacs guesses this frame attribute wrongly, either set this variable in
+your `~/.emacs' or set the resource `Emacs.backgroundMode' in your
+`~/.Xdefaults'.
+See also `gnus-display-type'.
+
+This is a meta-variable that will affect what default values other
+variables get.  You would normally not change this variable, but
+pounce directly on the real variables themselves.")
+
+
+      (defun gnus-install-mouse-tracker ()
+       (require 'mode-motion)
+       (setq mode-motion-hook 'mode-motion-highlight-line)))
+
+     ((and (not (string-match "28.9" emacs-version)) 
+          (not (string-match "29" emacs-version)))
+      (setq gnus-hidden-properties '(invisible t))
+      (or (fboundp 'buffer-substring-no-properties)
+         (defun buffer-substring-no-properties (beg end)
+           (format "%s" (buffer-substring beg end)))))
    
-   ((boundp 'MULE)
-    (provide 'gnusutil))
+     ((boundp 'MULE)
+      (provide 'gnusutil))
    
-   ))
+     )))
 
 (eval-and-compile
   (cond
@@ -390,7 +427,8 @@ call it with the value of the `gnus-data' text property."
            (buffer-read-only nil)
            parent headers refs thread art)
        (while (and id (setq headers
-                            (car (setq art (gnus-gethash (downcase id) dep)))))
+                            (car (setq art (gnus-gethash (downcase id) 
+                                                         dep)))))
          (setq parent art)
          (setq id (and (setq refs (header-references headers))
                        (string-match "\\(<[^>]+>\\) *$" refs)
@@ -407,6 +445,49 @@ call it with the value of the `gnus-data' text property."
              (forward-line -1)))
          (gnus-summary-update-lines beg (point)))))
 
+    ;; Fixed by Christopher Davis <ckd@loiosh.kei.com>.
+    (defun gnus-article-add-button (from to fun &optional data)
+      "Create a button between FROM and TO with callback FUN and data DATA."
+      (and gnus-article-button-face
+          (overlay-put (make-overlay from to) 'face gnus-article-button-face))
+      (add-text-properties from to
+                          (append
+                           (and gnus-article-mouse-face
+                                (list 'mouse-face gnus-article-mouse-face))
+                           (list 'gnus-callback fun)
+                           (and data (list 'gnus-data data))
+                           (list 'highlight t))))
+
+    (if (not gnus-visual)
+       ()
+      (setq gnus-group-mode-hook
+           (cons
+            '(lambda ()
+              (easy-menu-add gnus-group-reading-menu)
+              (easy-menu-add gnus-group-group-menu)
+              (easy-menu-add gnus-group-post-menu)
+              (easy-menu-add gnus-group-misc-menu)
+              (gnus-install-mouse-tracker)) 
+            gnus-group-mode-hook))
+      (setq gnus-summary-mode-hook
+           (cons
+            '(lambda ()
+              (easy-menu-add gnus-summary-mark-menu)
+              (easy-menu-add gnus-summary-move-menu)
+              (easy-menu-add gnus-summary-article-menu)
+              (easy-menu-add gnus-summary-thread-menu)
+              (easy-menu-add gnus-summary-misc-menu)
+              (easy-menu-add gnus-summary-post-menu)
+              (easy-menu-add gnus-summary-kill-menu)
+              (gnus-install-mouse-tracker)) 
+            gnus-summary-mode-hook))
+      (setq gnus-article-mode-hook
+           (cons
+            '(lambda ()
+              (easy-menu-add gnus-article-article-menu)
+              (easy-menu-add gnus-article-treatment-menu))
+            gnus-article-mode-hook)))
+
 
     )
 
@@ -448,7 +529,7 @@ call it with the value of the `gnus-data' text property."
            (if (< from to)
                (overlay-put (make-overlay from to) 'face face)))))
 
-    (defun gnus-max-width-function (form)
+    (defun gnus-max-width-function (el max-width)
       (` (let* ((val (eval (, el)))
                (valstr (if (numberp val)
                            (int-to-string val) val)))
index 1406575..a504f9e 100644 (file)
@@ -185,7 +185,9 @@ If NEWSGROUP is nil, the global kill file is selected."
   ;; REGEXP: The string to kill.
   (save-excursion
     (let (string)
-      (gnus-kill-set-kill-buffer)
+      (or (eq major-mode 'gnus-kill-file-mode)
+         (gnus-kill-set-kill-buffer))
+      (current-buffer)
       (goto-char (point-max))
       (insert (setq string (format "(gnus-kill %S %S)\n" field regexp)))
       (gnus-kill-file-apply-string string))))
@@ -195,25 +197,34 @@ If NEWSGROUP is nil, the global kill file is selected."
   (interactive)
   (gnus-kill-file-enter-kill
    "Subject" 
-   (regexp-quote 
-    (gnus-simplify-subject (header-subject gnus-current-headers)))))
+   (if (vectorp gnus-current-headers)
+       (regexp-quote 
+       (gnus-simplify-subject (header-subject gnus-current-headers)))
+     "")))
   
 (defun gnus-kill-file-kill-by-author ()
   "Kill by author."
   (interactive)
   (gnus-kill-file-enter-kill
-   "From" (regexp-quote (header-from gnus-current-headers))))
+   "From" 
+   (if (vectorp gnus-current-headers)
+       (regexp-quote (header-from gnus-current-headers))
+     "")))
  
 (defun gnus-kill-file-kill-by-thread ()
   "Kill by author."
   (interactive "p")
   (gnus-kill-file-enter-kill
-   "References" (regexp-quote (header-id gnus-current-headers))))
+   "References" 
+   (if (vectorp gnus-current-headers)
+       (regexp-quote (header-id gnus-current-headers))
+     "")))
  
 (defun gnus-kill-file-kill-by-xref ()
   "Kill by Xref."
   (interactive)
-  (let ((xref (header-xref gnus-current-headers))
+  (let ((xref (and (vectorp gnus-current-headers) 
+                  (header-xref gnus-current-headers)))
        (start 0)
        group)
     (if xref
index e4e0d2b..4400971 100644 (file)
@@ -449,10 +449,10 @@ Type \\[describe-mode] in the buffer to get a list of commands."
                           (funcall gnus-followup-to-function group))))
                 gnus-use-followup-to))
          (if post
-             (gnus-configure-windows 'post)
+             (gnus-configure-windows 'post 'force)
            (if yank
-               (gnus-configure-windows 'followup-yank)
-             (gnus-configure-windows 'followup)))
+               (gnus-configure-windows 'followup-yank 'force)
+             (gnus-configure-windows 'followup 'force)))
          (gnus-overload-functions)
          (make-local-variable 'gnus-article-reply)
          (make-local-variable 'gnus-article-check-size)
@@ -1402,8 +1402,6 @@ 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)))
 
@@ -1497,7 +1495,7 @@ mailer."
         (concat "^" (regexp-quote mail-header-separator) "$"))
        (forward-line 1)
        (if (not yank)
-           (gnus-configure-windows 'reply)
+           (gnus-configure-windows 'reply 'force)
          (let ((last (point))
                end)
            (if (not (listp yank))
@@ -1520,7 +1518,7 @@ mailer."
                (goto-char end)
                (setq yank (cdr yank))))
            (goto-char last))
-         (gnus-configure-windows 'reply-yank))
+         (gnus-configure-windows 'reply-yank 'force))
        (run-hooks 'gnus-mail-hook)))))
 
 (defun gnus-mail-yank-original ()
@@ -1585,7 +1583,7 @@ mailer."
     (gnus-forward-insert-buffer forward-buffer)
     (goto-char (point-min))
     (re-search-forward "^To: " nil t)
-    (gnus-configure-windows 'mail-forward)
+    (gnus-configure-windows 'mail-forward 'force)
     ;; You have a chance to arrange the message.
     (run-hooks 'gnus-mail-forward-hook)
     (run-hooks 'gnus-mail-hook)))
@@ -1607,7 +1605,8 @@ mailer."
     (local-set-key "\C-c\C-c" 'gnus-mail-send-and-exit)
     (make-local-variable 'gnus-prev-winconf)
     (setq gnus-prev-winconf winconf)
-    (run-hooks 'gnus-mail-hook)))
+    (run-hooks 'gnus-mail-hook)
+    (gnus-configure-windows 'summary-mail 'force)))
 
 (defun gnus-article-mail (yank)
   "Send a reply to the address near point.
@@ -1643,7 +1642,7 @@ If YANK is non-nil, include the original article."
     (make-local-variable 'gnus-prev-winconf)
     (setq gnus-prev-winconf winconf)
     (use-local-map (copy-keymap mail-mode-map))
-    (local-set-key "\C-c\C-c" 'gnus-mail-send-and-exit)
+    (local-set-key "\C-c\C-c" 'gnus-bug-mail-send-and-exit)
     (goto-char (point-min))
     (re-search-forward (concat "^" (regexp-quote mail-header-separator) "$"))
     (forward-line 1)
@@ -1653,6 +1652,13 @@ If YANK is non-nil, include the original article."
       (goto-char (- b 3)))
     (message "")))
 
+(defun gnus-bug-mail-send-and-exit ()
+  "Send the bug message and exit."
+  (interactive)
+  (and (get-buffer "*Gnus Help Bug*")
+       (kill-buffer "*Gnus Help Bug*"))
+  (gnus-mail-send-and-exit))
+
 (defun gnus-debug ()
   "Attemps to go through the Gnus source file and report what variables have been changed.
 The source file has to be in the Emacs load path."
index 1e0be55..a4f97f3 100644 (file)
@@ -1054,7 +1054,6 @@ External references are things like message-ids and URLs, as specified by
          (inhibit-point-motion-hooks t)
          (case-fold-search t))
       (goto-char (point-min))
-      (search-forward "\n\n")
       (while (re-search-forward gnus-button-regexp nil t)
        (goto-char (match-beginning 0))
        (let* ((from (point))
index 072bbfa..4005eb1 100644 (file)
@@ -982,41 +982,6 @@ If this variable is nil, screen refresh may be quicker.")
 If this is nil, Gnus will take space as is needed, leaving the rest
 of the modeline intact.")
 
-;; Added by Per Abrahamsen <amanda@iesd.auc.dk>.
-(defvar gnus-display-type 
-  (condition-case nil
-      (let ((display-resource (x-get-resource ".displayType" "DisplayType")))
-       (cond (display-resource (intern (downcase display-resource)))
-             ((x-display-color-p) 'color)
-             ((x-display-grayscale-p) 'grayscale)
-             (t 'mono)))
-    (error 'mono))
-  "A symbol indicating the display Emacs is running under.
-The symbol should be one of `color', `grayscale' or `mono'. If Emacs
-guesses this display attribute wrongly, either set this variable in
-your `~/.emacs' or set the resource `Emacs.displayType' in your
-`~/.Xdefaults'. See also `gnus-background-mode'.")
-
-(defvar gnus-background-mode 
-  (condition-case nil
-      (let ((bg-resource (x-get-resource ".backgroundMode"
-                                        "BackgroundMode"))
-           (params (frame-parameters)))
-       (cond (bg-resource (intern (downcase bg-resource)))
-             ((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))
-  "A symbol indicating the Emacs background brightness.
-The symbol should be one of `light' or `dark'.
-If Emacs guesses this frame attribute wrongly, either set this variable in
-your `~/.emacs' or set the resource `Emacs.backgroundMode' in your
-`~/.Xdefaults'.
-See also `gnus-display-type'.")
-
 (defvar gnus-mouse-face 'highlight
   "*Face used for mouse highlighting in Gnus.
 No mouse highlights will be done if `gnus-visual' is nil.")
@@ -1301,16 +1266,11 @@ automatically when it is selected.")
        (list ?z 'score-char ?c)
        (list ?U 'unread ?c)
        (list ?t '(gnus-summary-number-of-articles-in-thread 
-                  (or (prog1 gnus-tmp-adopt-thread 
-                        (setq gnus-tmp-adopt-thread nil))
-                      (if (boundp 'thread) (symbol-value 'thread)
-                        thread nil)))
-                  ?d)
+                  (and (boundp 'thread) (car thread)))
+             ?d)
        (list ?e '(gnus-summary-number-of-articles-in-thread 
-                  (or gnus-tmp-adopt-thread 
-                      (if (boundp 'thread) (symbol-value 'thread)
-                        thread nil)) t)
-                  ?c)
+                  (and (boundp 'thread) (car thread)) t)
+             ?c)
        (list ?u 'user-defined ?s))
   "An alist of format specifications that can appear in summary lines,
 and what variables they correspond with, along with the type of the
@@ -1343,7 +1303,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.97.2"
+(defconst gnus-version "(ding) Gnus v0.98"
   "Version number for this version of Gnus.")
 
 (defvar gnus-info-nodes
@@ -3221,6 +3181,17 @@ prompt the user for the name of an NNTP server to use."
          (gnus-group-list-groups level)
          (gnus-configure-windows 'group))))))
 
+(defun gnus-unload ()
+  "Unload all Gnus features."
+  (interactive)
+  (let ((history load-history)
+       feature)
+    (while history
+      (and (string-match "^gnus" (car (car history)))
+          (setq feature (cdr (assq 'provide (car history))))
+          (unload-feature feature 'force))
+      (setq history (cdr history)))))
+
 (defun gnus-group-startup-message (&optional x y)
   "Insert startup message in current buffer."
   ;; Insert the message.
@@ -4220,7 +4191,8 @@ score file entries for articles to include in the group."
   (setq gnus-newsrc-alist 
        (sort (cdr gnus-newsrc-alist) gnus-group-sort-function))
   (gnus-make-hashtable-from-newsrc-alist)
-  (gnus-group-list-groups nil gnus-have-all-newsgroups))
+  (gnus-group-list-groups (if gnus-have-all-newsgroups gnus-level-unsubscribed)
+                         gnus-have-all-newsgroups))
 
 (defun gnus-group-sort-by-alphabet (info1 info2)
   (string< (car info1) (car info2)))
@@ -5054,7 +5026,9 @@ buffer.
             (list t group gnus-level-default-subscribed
                   nil nil gnus-browse-current-method) 
             gnus-level-default-subscribed gnus-level-killed
-            (gnus-gethash (car (nth 1 gnus-newsrc-alist)) gnus-newsrc-hashtb)
+            (and (car (nth 1 gnus-newsrc-alist))
+                 (gnus-gethash (car (nth 1 gnus-newsrc-alist))
+                               gnus-newsrc-hashtb))
             t)
            (insert ? ))
        (gnus-group-change-level 
@@ -5068,8 +5042,8 @@ buffer.
   (if (eq major-mode 'gnus-browse-mode)
       (kill-buffer (current-buffer)))
   (if gnus-browse-return-buffer
-      (gnus-configure-windows 'server)
-    (gnus-configure-windows 'group)
+      (gnus-configure-windows 'server 'force)
+    (gnus-configure-windows 'group 'force)
     (gnus-group-list-groups nil)))
 
 (defun gnus-browse-describe-briefly ()
@@ -5427,7 +5401,6 @@ The following commands are available:
        (set (car locals) nil))
       (setq locals (cdr locals))))
   (gnus-make-thread-indent-array)
-  (gnus-update-format-specifications)
   (setq mode-line-modified "-- ")
   (make-local-variable 'mode-line-format)
   (setq mode-line-format (copy-sequence mode-line-format))
@@ -5620,8 +5593,10 @@ The following commands are available:
          (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))
+                    (< (or (cdr (assq 
+                                 (setq article (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...
@@ -5630,19 +5605,25 @@ The following commands are available:
                     (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)
+             (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)))))))
 
+(defvar gnus-tmp-gathered nil)
+
 (defun gnus-summary-number-of-articles-in-thread (thread &optional char)
   ;; Sum up all elements (and sub-elements) in a list.
-  (let ((number 
-        (if (listp thread) 
-            (apply 
-             '+ (mapcar 'gnus-summary-number-of-articles-in-thread thread))
-          1)))
+  (let* ((number 
+         (if (and (consp thread) (cdr thread)
+                  (not (memq (header-number (car (car (cdr thread))))
+                             gnus-tmp-gathered)))
+             (apply 
+              '+ 1 (mapcar 'gnus-summary-number-of-articles-in-thread 
+                           (cdr thread)))
+           1)))
     (if char 
        (if (> number 1) gnus-not-empty-thread-mark
          gnus-empty-thread-mark)
@@ -5678,7 +5659,7 @@ If NO-ARTICLE is non-nil, no article is selected initially."
                   (gnus-group-jump-to-group group)
                   (gnus-group-next-unread-group 1))
               (if (not (buffer-name (car quit-config)))
-                  (gnus-configure-windows 'group)
+                  (gnus-configure-windows 'group 'force)
                 (set-buffer (car quit-config))
                 (and (eq major-mode 'gnus-summary-mode)
                      (gnus-set-global-variables))
@@ -5695,9 +5676,9 @@ If NO-ARTICLE is non-nil, no article is selected initially."
            (set-buffer gnus-group-buffer)
            (gnus-group-jump-to-group group)
            (gnus-group-next-unread-group 1)
-           (gnus-configure-windows 'group))
+           (gnus-configure-windows 'group 'force))
        (if (not (buffer-name (car quit-config)))
-           (gnus-configure-windows 'group)
+           (gnus-configure-windows 'group 'force)
          (set-buffer (car quit-config))
          (and (eq major-mode 'gnus-summary-mode)
               (gnus-set-global-variables))
@@ -5713,8 +5694,6 @@ If NO-ARTICLE is non-nil, no article is selected initially."
       (run-hooks 'gnus-select-group-hook)
       ;; Do score processing.
       (and gnus-use-scoring (gnus-possibly-score-headers))
-      ;; Update the format specifiers.
-      (gnus-update-format-specifications)
       ;; Generate the summary buffer.
       (gnus-summary-prepare)
       (if (zerop (buffer-size))
@@ -6078,14 +6057,23 @@ If NO-ARTICLE is non-nil, no article is selected initially."
            fun (cdr fun))))
   threads)
 
-(defmacro gnus-thread-header (thread)
-  ;; Return header of first article in THREAD.
+(defmacro gnus-thread-header-old (thread)
+  (or (symbolp thread) (error "Boo!"))
   (` (if (consp (, thread))
         (if (stringp (car (, thread)))
             (car (car (cdr (, thread))))
           (car (, thread)))
        (, thread))))
 
+;; Written by Hallvard B Furuseth <h.b.furuseth@usit.uio.no>.
+(defmacro gnus-thread-header (thread)
+  ;; Return header of first article in THREAD.
+  ;; Note that THREAD must never, evr be anything else than a variable -
+  ;; using some other form will lead to serious barfage.
+  (or (symbolp thread) (error "Boo!"))
+  (list 'byte-code "\10\211:\203\17\0\211@;\203\16\0A@@\207"
+       (vector thread) 1))
+
 (defun gnus-thread-sort-by-number (h1 h2)
   "Sort threads by root article number."
   (< (header-number (gnus-thread-header h1))
@@ -6153,14 +6141,13 @@ Unscored articles will be counted as having a score of zero."
 
 ;; Added by Per Abrahamsen <amanda@iesd.auc.dk>.
 (defvar gnus-tmp-prev-subject "")
-(defvar gnus-tmp-adopt-thread nil)
 
 (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 ((level 0)
-       thread header number subject stack state gathered)
+       thread header number subject stack state gnus-tmp-gathered)
     (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
@@ -6194,25 +6181,25 @@ or a straight list of headers."
                  (while (cdr th)
                    (setq th (cdr th)))
                  (setcdr th (cdr (cdr (car thread))))
-                 (setq gathered 
+                 (setq gnus-tmp-gathered 
                        (nconc (mapcar
                                (lambda (h) (header-number (car h)))
                                (cdr (cdr (car thread))))
-                              gathered))
+                              gnus-tmp-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 
+               (setq gnus-tmp-gathered 
                      (nconc (mapcar
                              (lambda (h) (header-number (car h)))
                              (cdr (cdr (car thread))))
-                            gathered))
+                            gnus-tmp-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))))))
+                nil header (header-number (car (car (cdr (car thread)))))))
               (t
                ;; We do not make a root for the gathered
                ;; sub-threads at all.  
@@ -6255,7 +6242,7 @@ or a straight list of headers."
              (memq number gnus-newsgroup-replied)
              (memq number gnus-newsgroup-expirable)
              (if (and (eq gnus-summary-make-false-root 'empty)
-                      (memq number gathered))
+                      (memq number gnus-tmp-gathered))
                  gnus-summary-same-subject
                (if (or (zerop level)
                        (and gnus-thread-ignore-subject
@@ -6267,7 +6254,7 @@ or a straight list of headers."
                    subject
                  gnus-summary-same-subject))
              (and (eq gnus-summary-make-false-root 'adopt)
-                  (memq number gathered))
+                  (memq number gnus-tmp-gathered))
              (cdr (assq number gnus-newsgroup-scored)))
 
             (setq gnus-tmp-prev-subject subject))))
@@ -6382,13 +6369,20 @@ If READ-ALL is non-nil, all articles in the group are selected."
           (let (marked)
             (gnus-adjust-marked-articles info)
             (setq gnus-newsgroup-marked 
-                  (cdr (assq 'tick (setq marked (nth 3 info)))))
-            (setq gnus-newsgroup-replied (cdr (assq 'reply marked)))
-            (setq gnus-newsgroup-expirable (cdr (assq 'expire marked)))
-            (setq gnus-newsgroup-killed (cdr (assq 'killed marked)))
-            (setq gnus-newsgroup-bookmarks (cdr (assq 'bookmark marked)))
-            (setq gnus-newsgroup-dormant (cdr (assq 'dormant marked)))
-            (setq gnus-newsgroup-scored (cdr (assq 'score marked)))
+                  (copy-sequence
+                   (cdr (assq 'tick (setq marked (nth 3 info))))))
+            (setq gnus-newsgroup-replied 
+                  (copy-sequence (cdr (assq 'reply marked))))
+            (setq gnus-newsgroup-expirable
+                  (copy-sequence (cdr (assq 'expire marked))))
+            (setq gnus-newsgroup-killed
+                  (copy-sequence (cdr (assq 'killed marked))))
+            (setq gnus-newsgroup-bookmarks 
+                  (copy-sequence (cdr (assq 'bookmark marked))))
+            (setq gnus-newsgroup-dormant 
+                  (copy-sequence (cdr (assq 'dormant marked))))
+            (setq gnus-newsgroup-scored 
+                  (copy-sequence (cdr (assq 'score marked))))
             (setq gnus-newsgroup-processable nil)))
       ;; Check whether auto-expire is to be done in this group.
       (setq gnus-newsgroup-auto-expire
@@ -7480,7 +7474,7 @@ gnus-exit-group-hook is called with no arguments if that value is non-nil."
       (gnus-summary-clear-local-variables)
       ;; We clear the global counterparts of the buffer-local
       ;; variables as well, just to be on the safe side.
-      (gnus-configure-windows 'group)
+      (gnus-configure-windows 'group 'force)
       (gnus-summary-clear-local-variables)
       ;; Return to group mode buffer. 
       (if (eq mode 'gnus-summary-mode)
@@ -7494,7 +7488,7 @@ gnus-exit-group-hook is called with no arguments if that value is non-nil."
            (gnus-group-jump-to-group group)
            (gnus-group-next-unread-group 1))
        (if (not (buffer-name (car quit-config)))
-           (gnus-configure-windows 'group)
+           (gnus-configure-windows 'group 'force)
          (set-buffer (car quit-config))
          (and (eq major-mode 'gnus-summary-mode)
               (gnus-set-global-variables))
@@ -7517,7 +7511,7 @@ gnus-exit-group-hook is called with no arguments if that value is non-nil."
          (set-buffer gnus-group-buffer)
          (gnus-summary-clear-local-variables)
          ;; Return to group selection mode.
-         (gnus-configure-windows 'group)
+         (gnus-configure-windows 'group 'force)
          (if (get-buffer gnus-summary-buffer)
              (kill-buffer gnus-summary-buffer))
          (if (get-buffer gnus-article-buffer)
@@ -7527,7 +7521,7 @@ gnus-exit-group-hook is called with no arguments if that value is non-nil."
          (if quit-config
              (progn
                (if (not (buffer-name (car quit-config)))
-                   (gnus-configure-windows 'group)
+                   (gnus-configure-windows 'group 'force)
                  (set-buffer (car quit-config))
                  (and (eq major-mode 'gnus-summary-mode)
                       (gnus-set-global-variables))
@@ -8664,28 +8658,32 @@ functions. (Ie. mail newsgroups at present.)"
 (defun gnus-summary-expire-articles ()
   "Expire all articles that are marked as expirable in the current group."
   (interactive)
-  (if (and gnus-newsgroup-expirable
-          (gnus-check-backend-function 
+  (if (not (gnus-check-backend-function 
            'request-expire-articles gnus-newsgroup-name))
-      (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)
+      ()
+    (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)
+      (if (not expirable)
+         ()
        (gnus-message 6 "Expiring articles...")
        ;; The list of articles that weren't expired is returned.
        (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
-         (or (memq (car expirable) gnus-newsgroup-expirable)
-             (gnus-summary-mark-as-read (car expirable) gnus-canceled-mark))
-         (setq expirable (cdr expirable)))
-       (gnus-message 6 "Expiring articles...done"))))
+       ;; really expired articles as non-existant.
+       (or (eq es expirable) ; If nothing was expired, we don't mark.
+           (while expirable
+             (or (memq (car expirable) es)
+                 (gnus-summary-mark-article
+                  (car expirable) gnus-canceled-mark))
+             (setq expirable (cdr expirable))))
+       (gnus-message 6 "Expiring articles...done")))))
 
 (defun gnus-summary-expire-articles-now ()
   "Expunge all expirable articles in the current group.
@@ -8730,7 +8728,7 @@ delete these instead."
        ;; The backend might not have been able to delete the article
        ;; after all.  
        (or (memq (car articles) not-deleted)
-           (gnus-summary-mark-as-read (car articles) gnus-canceled-mark))
+           (gnus-summary-mark-article (car articles) gnus-canceled-mark))
        (setq articles (cdr articles))))
     (gnus-summary-position-cursor)
     not-deleted))
@@ -8918,7 +8916,7 @@ If optional argument UNMARK is negative, mark articles as unread instead."
   (let ((count 1))
     (save-excursion
       (cond ((null unmark)
-            (gnus-summary-mark-as-read nil gnus-killed-mark))
+            (gnus-summary-mark-article nil gnus-killed-mark))
            ((> unmark 0)
             (gnus-summary-tick-article nil t))
            (t
@@ -8926,7 +8924,7 @@ If optional argument UNMARK is negative, mark articles as unread instead."
       (while (and subject
                  (gnus-summary-search-forward nil subject))
        (cond ((null unmark)
-              (gnus-summary-mark-as-read nil gnus-killed-mark))
+              (gnus-summary-mark-article nil gnus-killed-mark))
              ((> unmark 0)
               (gnus-summary-tick-article nil t))
              (t
@@ -9075,6 +9073,10 @@ returned."
   (interactive "p")
   (gnus-set-global-variables)
   (let ((backward (< n 0))
+       (gnus-summary-goto-unread
+        (and gnus-summary-goto-unread
+             (not (memq mark (list gnus-unread-mark
+                                   gnus-ticked-mark gnus-dormant-mark)))))
        (n (abs n))
        (mark (or mark gnus-del-mark)))
   (while (and (> n 0)
@@ -9247,7 +9249,7 @@ The difference between N and the number of marks cleared is returned."
   (or (memq gnus-current-article gnus-newsgroup-marked)
       (memq gnus-current-article gnus-newsgroup-dormant)
       (memq gnus-current-article gnus-newsgroup-expirable)
-      (gnus-summary-mark-as-read gnus-current-article gnus-read-mark)))
+      (gnus-summary-mark-article gnus-current-article gnus-read-mark)))
 
 (defun gnus-summary-mark-region-as-read (point mark all)
   "Mark all unread articles between point and mark as read.
@@ -9478,7 +9480,7 @@ The number of articles marked as read is returned."
            (let ((unreads (length gnus-newsgroup-unreads)))
              (if (gnus-summary-first-subject (not all))
                  (while (and (if to-here (< (point) to-here) t)
-                             (gnus-summary-mark-as-read nil gnus-catchup-mark)
+                             (gnus-summary-mark-article nil gnus-catchup-mark)
                              (gnus-summary-search-subject nil (not all)))))
              (- unreads (length gnus-newsgroup-unreads))
              (or to-here
@@ -9700,7 +9702,7 @@ If the prefix argument is negative, tick articles instead."
     (save-excursion
       (while killing
        ;; Mark the article...
-       (cond ((null unmark) (gnus-summary-mark-as-read nil gnus-killed-mark))
+       (cond ((null unmark) (gnus-summary-mark-article nil gnus-killed-mark))
              ((> unmark 0) (gnus-summary-tick-article nil t))
              (t (gnus-summary-tick-article)))
        ;; ...and go forward until either the buffer ends or the subtree
@@ -10387,7 +10389,7 @@ If ALL-HEADERS is non-nil, no headers are hidden."
                      (cons gnus-newsgroup-name article))
                (set-buffer gnus-summary-buffer)
                (setq gnus-current-article article)
-               (gnus-summary-mark-as-read article gnus-canceled-mark))
+               (gnus-summary-mark-article article gnus-canceled-mark))
              (gnus-message 1 "No such article (may be canceled)")
              (ding)
              nil)
@@ -11840,10 +11842,10 @@ The `-n' option line from .newsrc is respected."
               (setq gnus-zombie-list (delete group gnus-zombie-list))
             (setq gnus-killed-list (delete group gnus-killed-list))))
          (t
-          (if (>= level gnus-level-zombie)
+          (if (and (>= level gnus-level-zombie)
+                   entry)
               (progn
-                (gnus-sethash (car (nth 2 entry))
-                              nil gnus-newsrc-hashtb)
+                (gnus-sethash (car (nth 2 entry)) nil gnus-newsrc-hashtb)
                 (if (nth 3 entry)
                     (setcdr (gnus-gethash (car (nth 3 entry))
                                           gnus-newsrc-hashtb)
@@ -12551,7 +12553,9 @@ If FORCE is non-nil, the .newsrc file is read."
   "Make server dependent file name by catenating FILE and server host name."
   (let* ((file (expand-file-name file nil))
         (real-file (concat file "-" (nth 1 gnus-select-method))))
-    (if (file-exists-p real-file)
+    (if (or (file-exists-p real-file)
+           (file-exists-p (concat real-file ".el"))
+           (file-exists-p (concat real-file ".eld")))
        real-file file)))
 
 (defun gnus-uncompress-newsrc-alist ()
@@ -12596,12 +12600,13 @@ If FORCE is non-nil, the .newsrc file is read."
       (setq gnus-active-hashtb (make-vector 4095 0)))
   (let ((buf (current-buffer))
        (already-read (> (length gnus-newsrc-alist) 1))
-       group subscribed options-symbol newsrc
+       group subscribed options-symbol newsrc Options-symbol
        symbol reads num1)
     (goto-char (point-min))
   ;; We intern the symbol `options' in the active hashtb so that we
symbol `opt    ;; We intern theions' in the active hashtb so that we
     ;; can `eq' against it later.
     (setq options-symbol (intern "options" gnus-active-hashtb))
+    (setq Options-symbol (intern "Options" gnus-active-hashtb))
   
     (while (not (eobp))
       ;; We first read the first word on the line by narrowing and
@@ -12619,7 +12624,8 @@ If FORCE is non-nil, the .newsrc file is read."
       ;; Now, the symbol we have read is either `options' or a group
       ;; name.  If it is an options line, we just add it to a string. 
       (cond 
-       ((eq symbol options-symbol)
+       ((or (eq symbol options-symbol)
+           (eq symbol Options-symbol))
        (setq gnus-newsrc-options
              ;; This concatting is quite inefficient, but since our
              ;; thorough studies show that approx 99.37% of all
@@ -12891,8 +12897,8 @@ If FORCE is non-nil, the .newsrc file is read."
   (let ((newsrc (cdr gnus-newsrc-alist))
        info ranges range)
     (save-excursion
-      (set-buffer (create-file-buffer gnus-startup-file))
-      (set-visited-file-name gnus-startup-file)
+      (set-buffer (create-file-buffer gnus-current-startup-file))
+      (set-visited-file-name gnus-current-startup-file)
       (buffer-disable-undo (current-buffer))
       (erase-buffer)
       ;; Write options.
index 0e71418..a5521e5 100644 (file)
   t)
 
 (defun nnbabyl-request-create-group (group &optional server) 
-  (nnbabyl-request-list)
-  (setq nnbabyl-group-alist (nnmail-get-active))
+  (nnmail-activate 'nnbabyl)
   (or (assoc group nnbabyl-group-alist)
       (let (active)
        (setq nnbabyl-group-alist (cons (list group (setq active (cons 1 0)))
                   nnmail-expiry-wait))
         (is-old t)
         rest)
-    (nnbabyl-request-list)
-    (setq nnbabyl-group-alist (nnmail-get-active))
+    (nnmail-activate 'nnbabyl)
 
     (save-excursion 
       (set-buffer nnbabyl-mbox-buffer)
-      (while articles
+      (while (and articles is-old)
        (goto-char (point-min))
        (if (search-forward (nnbabyl-article-string (car articles)) nil t)
            (if (or force
   (let ((buf (current-buffer))
        result beg)
     (and 
-     (nnbabyl-request-list)
-     (setq nnbabyl-group-alist (nnmail-get-active))
+     (nnmail-activate 'nnbabyl)
      (save-excursion
        (goto-char (point-min))
        (search-forward "\n\n" nil t)
          (not (buffer-name nnbabyl-mbox-buffer)))
       (save-excursion (nnbabyl-read-mbox)))
   (or nnbabyl-group-alist
-      (progn
-       (nnbabyl-request-list)
-       (setq nnbabyl-group-alist (nnmail-get-active))))
+      (nnmail-activate 'nnbabyl))
   (if newsgroup
       (if (assoc newsgroup nnbabyl-group-alist)
          (setq nnbabyl-current-group newsgroup)
     (cdr active)))
 
 (defun nnbabyl-read-mbox ()
-  (nnbabyl-request-list)
-  (setq nnbabyl-group-alist (nnmail-get-active))
+  (nnmail-activate 'nnbabyl)
   (or (file-exists-p nnbabyl-mbox-file)
       (save-excursion
        (set-buffer (setq nnbabyl-mbox-buffer
index 60d21cf..391d659 100644 (file)
                sequence (cdr sequence)))
 
        ;; Fold continuation lines.
+       (set-buffer nntp-server-buffer)
        (goto-char (point-min))
        (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
          (replace-match " " t t))
       (if (stringp article)
          nil
        (nndoc-insert-article article)
+       ;; Unquote quoted non-separators in digests.
+       (if (eq nndoc-article-type 'digest)
+           (progn
+             (goto-char (point-min))
+             (while (re-search-forward "^- -"nil t)
+               (replace-match "-" t t))))
        t))))
 
 (defun nndoc-request-group (group &optional server dont-check)
        (progn
          (setq nndoc-status-string "No such file or buffer")
          nil)
+      (nndoc-set-header-dependent-regexps) ; hack for MIME digests
       (if dont-check
          t
        (save-excursion
          (insert-buffer-substring nndoc-address))
        t)))))
 
+;; MIME (RFC 1341) digest hack by Ulrik Dickow <dickow@nbi.dk>.
+(defun nndoc-set-header-dependent-regexps ()
+  (if (not (eq nndoc-article-type 'digest))
+      ()
+    (let ((case-fold-search t)     ; We match a bit too much, keep it simple.
+         (boundary-id) (b-delimiter))
+      (save-excursion
+       (set-buffer nndoc-current-buffer)
+       (goto-char (point-min))
+       (and
+        (re-search-forward
+         (concat "\n\n\\|^Content-Type: multipart/digest;[ \t\n]*[ \t]"
+                 "boundary=\"\\([^\"\n]*[^\" \t\n]\\)\"")
+         nil t)
+        (match-beginning 1)
+        (setq boundary-id (buffer-substring-no-properties (match-beginning 1)
+                                                          (match-end 1))
+              b-delimiter       (concat "\n--" boundary-id "[\n \t]+")
+              nndoc-article-begin b-delimiter ; Too strict: "[ \t]*$"
+              nndoc-article-end (concat "\n--" boundary-id
+                                        "\\(--\\)?[\n \t]+")
+              nndoc-first-article b-delimiter ; ^end-of-file ends article too.
+              nndoc-end-of-file (concat "\n--" boundary-id "--[ \t]*$")))))))
+
 (defun nndoc-forward-article (n)
   (while (and (> n 0)
              (re-search-forward nndoc-article-begin nil t)
                  (match-beginning 0))
             (point-max)))
        (goto-char (point-min))
+       (and nndoc-head-begin
+            (re-search-forward nndoc-head-begin nil t)
+            (narrow-to-region (point) (point-max)))
        (or (re-search-forward nndoc-head-end nil t)
            (goto-char (point-max)))
        (append-to-buffer ibuf (point-min) (point))
index 2aee4d3..4aef847 100644 (file)
@@ -229,8 +229,7 @@ such things as moving mail.  All buffers always get killed upon server close.")
                     (> (nth 1 timestamp) (nth 1 nnfolder-active-timestamp)))
                 (progn
                   (setq nnfolder-active-timestamp timestamp)
-                  (nnfolder-request-list)
-                  (setq nnfolder-group-alist (nnmail-get-active))))
+                  (nnmail-activate 'nnfolder)))
             (let* ((active (assoc group nnfolder-group-alist))
                   (group (car active))
                   (range (car (cdr active)))
@@ -277,8 +276,7 @@ such things as moving mail.  All buffers always get killed upon server close.")
   t)
 
 (defun nnfolder-request-create-group (group &optional server) 
-  (nnfolder-request-list)
-  (setq nnfolder-group-alist (nnmail-get-active))
+  (nnmail-activate 'nnfolder)
   (or (assoc group nnfolder-group-alist)
       (let (active)
        (setq nnfolder-group-alist 
@@ -320,8 +318,7 @@ such things as moving mail.  All buffers always get killed upon server close.")
                   nnmail-expiry-wait))
         (is-old t)
         rest)
-    (nnfolder-request-list)
-    ;;(setq nnfolder-group-alist (nnmail-get-active))
+    (nnmail-activate 'nnfolder)
 
     (save-excursion 
       (set-buffer nnfolder-current-buffer)
@@ -556,10 +553,8 @@ such things as moving mail.  All buffers always get killed upon server close.")
     ;; it's real name and switch to it.
     (if group (nnfolder-possibly-change-group group))
     ;; If the group alist isn't active, activate it now.
-    (if (not nnfolder-group-alist)
-       (progn
-         (nnfolder-request-list)
-         (setq nnfolder-group-alist (nnmail-get-active))))))
+    (or nnfolder-group-alist
+       (nnmail-activate 'nnfolder))))
 
 (defun nnfolder-active-number (group)
   (save-excursion 
index d4ec1b9..d629cd3 100644 (file)
@@ -711,6 +711,13 @@ See the documentation for the variable `nnmail-split-fancy' for documentation."
          (t
           procmails))))
 
+(defun nnmail-activate (backend)
+  (if (not (symbol-value (intern (format "%s-group-alist" backend))))
+      (save-excursion
+       (funcall (intern (format "%s-request-list" backend)))
+       (set (intern (format "%s-group-alist" backend)) (nnmail-get-active)))))
+
+
 (provide 'nnmail)
 
 ;;; nnmail.el ends here
index 0da254f..68279e4 100644 (file)
                   nnmail-expiry-wait))
         (is-old t)
         rest)
-    (nnmbox-request-list)
-    (setq nnmbox-group-alist (nnmail-get-active))
+    (nnmail-activate 'nnmbox)
 
     (save-excursion 
       (set-buffer nnmbox-mbox-buffer)
-      (while articles
+      (while (and articles is-old)
        (goto-char (point-min))
        (if (search-forward (nnmbox-article-string (car articles)) nil t)
            (if (or force
        (replace-match "From ")
       (insert "From nobody " (current-time-string) "\n"))
     (and 
-     (nnmbox-request-list)
-     (setq nnmbox-group-alist (nnmail-get-active))
+     (nnmail-activate 'nnmbox)
      (progn
        (set-buffer buf)
        (goto-char (point-min))
                          (find-file-noselect nnmbox-mbox-file)))
        (buffer-disable-undo (current-buffer))))
   (if (not nnmbox-group-alist)
-      (progn
-       (nnmbox-request-list)
-       (setq nnmbox-group-alist (nnmail-get-active))))
+      (nnmail-activate 'nnmbox))
   (if newsgroup
       (if (assoc newsgroup nnmbox-group-alist)
          (setq nnmbox-current-group newsgroup))))
     (cdr active)))
 
 (defun nnmbox-read-mbox ()
-  (nnmbox-request-list)
-  (setq nnmbox-group-alist (nnmail-get-active))
+  (nnmail-activate 'nnmbox)
   (if (not (file-exists-p nnmbox-mbox-file))
       (write-region 1 1 nnmbox-mbox-file t 'nomesg))
   (if (and nnmbox-mbox-buffer
index cf3265a..dd92ec3 100644 (file)
         (max-article (and active-articles (apply 'max active-articles)))
         (is-old t)
         article rest mod-time)
-    (nnmh-request-list)
-    (setq nnmh-group-alist (nnmail-get-active))
+    (nnmail-activate 'nnmh)
 
     (while (and articles is-old)
       (setq article (concat nnmh-current-directory 
 (defun nnmh-request-accept-article (group &optional last)
   (if (stringp group)
       (and 
-       (nnmh-request-list)
-       (setq nnmh-group-alist (nnmail-get-active))
+       (nnmail-activate 'nnmh)
        ;; We trick the choosing function into believing that only one
        ;; group is availiable.  
        (let ((nnmail-split-methods (list (list group ""))))
         (car (nnmh-save-mail))))
     (and
-     (nnmh-request-list)
-     (setq nnmh-group-alist (nnmail-get-active))
+     (nnmail-activate 'nnmh)
      (car (nnmh-save-mail)))))
 
 (defun nnmh-request-replace-article (article group buffer)
 
 (defun nnmh-possibly-create-directory (group)
   (let (dir dirs)
-    (setq dir (nnmail-article-pathname group nnmh-directory))
+    (setq dir (nnmh-article-pathname group nnmh-directory))
     (while (not (file-directory-p dir))
       (setq dirs (cons dir dirs))
       (setq dir (file-name-directory (directory-file-name dir))))
index 5c308c5..438b592 100644 (file)
@@ -197,8 +197,7 @@ all. This may very well take some time.")
                (> (nth 1 timestamp) (nth 1 nnml-active-timestamp)))
            (progn
              (setq nnml-active-timestamp timestamp)
-             (nnml-request-list)
-             (setq nnml-group-alist (nnmail-get-active))))
+             (nnmail-activate 'nnml)))
        (let ((active (nth 1 (assoc group nnml-group-alist))))
          (save-excursion
            (set-buffer nntp-server-buffer)
@@ -219,8 +218,7 @@ all. This may very well take some time.")
   t)
 
 (defun nnml-request-create-group (group &optional server) 
-  (nnml-request-list)
-  (setq nnml-group-alist (nnmail-get-active))
+  (nnmail-activate 'nnml)
   (or (assoc group nnml-group-alist)
       (let (active)
        (setq nnml-group-alist (cons (list group (setq active (cons 0 0)))
@@ -271,8 +269,7 @@ all. This may very well take some time.")
         (max-article (and active-articles (apply 'max active-articles)))
         (is-old t)
         article rest mod-time)
-    (nnml-request-list)
-    (setq nnml-group-alist (nnmail-get-active))
+    (nnmail-activate 'nnml)
 
     (while (and articles is-old)
       (setq article (concat nnml-current-directory 
@@ -334,8 +331,7 @@ all. This may very well take some time.")
   (let (result)
     (if (stringp group)
        (and 
-        (nnml-request-list)
-        (setq nnml-group-alist (nnmail-get-active))
+        (nnmail-activate 'nnml)
         ;; We trick the choosing function into believing that only one
         ;; group is availiable.  
         (let ((nnmail-split-methods (list (list group ""))))
@@ -344,8 +340,7 @@ all. This may very well take some time.")
           (nnmail-save-active nnml-group-alist nnml-active-file)
           (and last (nnml-save-nov))))
       (and
-       (nnml-request-list)
-       (setq nnml-group-alist (nnmail-get-active))
+       (nnmail-activate 'nnml)
        (setq result (car (nnml-save-mail)))
        (progn
         (nnmail-save-active nnml-group-alist nnml-active-file)
@@ -370,17 +365,28 @@ all. This may very well take some time.")
            (art (concat (int-to-string article) "\t"))
            nov-line)
        (setq nov-line (nnml-make-nov-line chars))
+       ;; Replace the NOV line in the NOV file.
        (save-excursion 
          (set-buffer (nnml-open-nov group))
          (goto-char (point-min))
          (if (or (looking-at art)
-                 (search-forward (concat "\n" art)))
-             (progn
-               (delete-region (progn (beginning-of-line) (point))
-                              (progn (forward-line 1) (point)))
-               (insert (int-to-string article) nov-line)
-               (nnml-save-nov))
-           (kill-buffer (current-buffer)))
+                 (search-forward (concat "\n" art) nil t))
+             ;; Delete the old NOV line.
+             (delete-region (progn (beginning-of-line) (point))
+                            (progn (forward-line 1) (point)))
+           ;; The line isn't here, so we have to find out where
+           ;; we should insert it. (This situation should never
+           ;; occur, but one likes to make sure...)
+           (while (and (looking-at "[0-9]+\t")
+                       (< (string-to-int 
+                           (buffer-substring 
+                            (match-beginning 0) (match-end 0)))
+                          article)
+                       (zerop (forward-line 1)))))
+         (beginning-of-line)
+         (insert (int-to-string article) nov-line)
+         (nnml-save-nov)
+         (kill-buffer (current-buffer))
          t)))))
 
 
@@ -491,9 +497,7 @@ all. This may very well take some time.")
        ()
       ;; We first activate all the groups.
       (if (or (not group) (not nnml-group-alist))
-         (progn
-           (nnml-request-list)
-           (setq nnml-group-alist (nnmail-get-active))))
+         (nnmail-activate 'nnml))
       ;; The we go through all the existing spool files and split the
       ;; mail from each.
       (while spools
index e3136f0..8c932b4 100644 (file)
@@ -268,9 +268,9 @@ Ricardo Nassif did the proof-reading.
 @item
 Kevin Davidson came up with the name @dfn{ding}, so blame him.
 @item 
-Stainless Steel Rat, Jack Vinson, Daniel Quinlan, Ilja Weis, Frank D.
-Cringle, Geoffrey T. Dairiki and Andrew Eskilsson have all contributed
-code and suggestions.
+Stainless Steel Rat, Ulrik Dickow, Jack Vinson, Daniel Quinlan, Ilja
+Weis, Frank D. Cringle, Geoffrey T. Dairiki and Andrew Eskilsson have
+all contributed code and suggestions.
 @end itemize
 
 
@@ -2506,6 +2506,12 @@ Quit Gnus without saving any startup files (@code{gnus-group-quit}).
 @code{gnus-suspend-gnus-hook} is called when you suspend Gnus and
 @code{gnus-exit-gnus-hook} is called when you quit Gnus.
 
+@findex gnus-unload
+@cindex unloading
+If you wish to completely unload Gnus and all its adherents, you can use
+the @code{gnus-unload} command.  This command is also very handy when
+trying to custoize meta-variables.
+
 Note:
 
 @quotation
@@ -2741,6 +2747,8 @@ default level.  If the difference between
 @item t
 Number of articles in the current sub-thread.  Using this spec will slow
 down summary buffer generation somewhat.
+@item e
+A single character will be displayed if the article has any children. 
 @item u
 User defined specifier.  The next character in the format string should
 be a letter.  @sc{gnus} will call the function
@@ -6450,6 +6458,23 @@ file.
 @vindex gnus-mouse-face
 This is the face (i.e., font) used for mouse highlighting in Gnus.  No
 mouse highlights will be done if @code{gnus-visual} is @code{nil}.
+
+@item gnus-display-type
+@vindex gnus-display-type
+This variable is symbol indicating the display Emacs is running under.
+The symbol should be one of @code{color}, @code{grayscale} or
+@code{mono}. If Gnus guesses this display attribute wrongly, either set
+this variable in your @file{~/.emacs} or set the resource
+@code{Emacs.displayType} in your @file{~/.Xdefaults}.
+
+@item gnus-background-mode 
+@vindex gnus-background-mode 
+This is a symbol indicating the Emacs background brightness. The symbol
+should be one of @code{light} or @code{dark}. If Gnus guesses this
+frame attribute wrongly, either set this variable in your @file{~/.emacs} or
+set the resource @code{Emacs.backgroundMode} in your @file{~/.Xdefaults}. 
+`gnus-display-type'.
+
 @end table
 
 @node Customization