*** empty log message ***
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 4 Mar 1997 02:18:17 +0000 (02:18 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 4 Mar 1997 02:18:17 +0000 (02:18 +0000)
23 files changed:
lisp/ChangeLog
lisp/Makefile
lisp/gnus-ems.el
lisp/gnus-kill.el
lisp/gnus-mh.el
lisp/gnus-msg.el
lisp/gnus-vis.el
lisp/gnus-vm.el
lisp/gnus.el
lisp/nnbabyl.el
lisp/nndigest.el
lisp/nndir.el
lisp/nndoc.el
lisp/nnfolder.el
lisp/nnkiboze.el
lisp/nnmail.el
lisp/nnmbox.el
lisp/nnmh.el
lisp/nnml.el
lisp/nnspool.el
lisp/nntp.el
lisp/nnvirtual.el
texi/gnus.texi

index 7d8ca65..6d71f89 100644 (file)
@@ -1,5 +1,52 @@
+Thu May 25 05:34:16 1995  Lars Magne Ingebrigtsen  <larsi@bera.ifi.uio.no>
+
+       * gnus.el (gnus-article-date-ut): Ignore missing dates. 
+       (gnus-group-enter-directory): New command and keystroke.
+
+       * nnspool.el (nnspool-retrieve-headers-with-nov): Don't be picky
+       on dirs. 
+
+       * gnus-mh.el (gnus-mail-forward-using-mhe): Make better Subject. 
+
+       * gnus.el (gnus-score-find-alist): New function.
+       (gnus-score-score-files): ADAPT files would nix out all other
+       files. 
+       (gnus-score-score-files): Would not find any when short names were
+       used. 
+
+Sat May 20 06:45:04 1995  Sudish Joseph <joseph@cis.ohio-state.edu>
+
+       * gnus-score.el (gnus-score-find-alist): New function.
+       (gnus-possibly-score-headers): Use it.
+
+       * gnus.el (gnus-score-file-(single|multiple)-match-alist): New
+         variables.
+
+Thu May 25 03:44:53 1995  Lars Magne Ingebrigtsen  <larsi@bera.ifi.uio.no>
+
+       * gnus-kill.el (gnus-expunge): Would infloop.
+
+       * nnspool.el (nnspool-inews-sentinel): Did not kill the error
+       buffer.
+
+       * nnmail.el (nnmail-article-group): Would but out on function in
+       the split method.
+
+       * nnmh.el (nnmh-get-new-mail): Don't rescan if already scanned. 
+
+       * nnml.el (nnml-get-new-mail): Ditto.
+
+       * gnus.el (gnus-start-news-server): Don't let the nnmh backend
+       fetch new mail. 
+
+Wed May 24 07:59:39 1995  Lars Ingebrigtsen  <lars@eyesore.no>
+
+       * nneething.el: New backend.
+
 Wed May 24 02:35:49 1995  Lars Magne Ingebrigtsen  <larsi@gymir.ifi.uio.no>
 
+       * gnus.el: 0.76 is released.
+
        * nnfolder.el (nnfolder-close-group): New version. Don't close if
        already closed.
 
index a2898c5..c3ac70a 100644 (file)
@@ -14,9 +14,10 @@ SUBSETS              =gnus nntp virtual nnmbox nnml nnmh nnspool mh
 
 DGNUS.el       =gnus-cache.el gnus-cite.el gnus-ems.el \
                gnus-kill.el gnus-mh.el gnus-msg.el gnus-score.el gnus-uu.el \
-               gnus-vis.el gnus-vm.el gnus.el nnbabyl.el nndigest.el nndir.el \
-               nndoc.el nnfolder.el nnheader.el nnkiboze.el nnmail.el nnmbox.el \
-               nnmh.el nnml.el nnspool.el nntp.el nnvirtual.el
+               gnus-vis.el gnus-vm.el gnus.el nnbabyl.el nndigest.el \
+               nndir.el nndoc.el nnfolder.el nnheader.el nnkiboze.el \
+               nnmail.el nnmbox.el nnmh.el nnml.el nnspool.el nntp.el \
+               nnvirtual.el nneething.el
 
 DGNUS.elc      =$(DGNUS.el:.el=.elc)
 
@@ -61,7 +62,6 @@ gnus-msg.elc: gnus.el
 gnus-score.elc:        gnus.el
 gnus-uu.elc:   gnus-msg.el
 gnus-uu.elc:   gnus.el
-#gnus-vis.elc: gnus-easymenu.el
 gnus-vis.elc:  gnus.el
 gnus-vm.elc:   gnus-msg.el
 gnus-vm.elc:   gnus.el
@@ -76,6 +76,8 @@ nndigest.elc: nnheader.el
 nndir.elc:     nnheader.el
 nndir.elc:     nnmh.el
 nndir.elc:     nnml.el
+nneething.elc:  nnheader.el
+nneething.elc:  nnmail.el
 nndoc.elc:     nnheader.el
 nndoc.elc:     nnmail.el
 nnfolder.elc:  gnus.el
index cd8696e..f2e7a87 100644 (file)
       (while funcs
        (or (fboundp (car funcs))
            (fset (car funcs) 'gnus-dummy-func))
-       (setq funcs (cdr funcs)))))
-   ))
+       (setq funcs (cdr funcs))))))
+  (or (fboundp 'file-regular-p)
+      (defun file-regular-p (file)
+       (and (not (file-directory-p file))
+            (not (file-symlink-p file))
+            (file-exists-p file))))
+  )
 
 (defun gnus-ems-redefine ()
   (cond 
index 4ba2b26..6dd76f5 100644 (file)
@@ -319,7 +319,11 @@ If NEWSGROUP is nil, return the global kill file instead."
                                   "/" gnus-kill-file-name)
                           (or gnus-kill-files-directory "~/News")))))
 
-(defalias 'gnus-expunge 'gnus-summary-remove-lines-marked-with)
+(defun gnus-expunge (marks)
+  "Remove lines marked with MARKS."
+  (save-excursion
+    (set-buffer gnus-summary-buffer)
+    (gnus-summary-remove-lines-marked-with marks)))
 
 (defun gnus-apply-kill-file-internal ()
   "Apply a kill file to the current newsgroup.
index 9f2ab55..b2723eb 100644 (file)
@@ -158,16 +158,11 @@ The command \\[mh-yank-cur-msg] yank the original message into current buffer."
 (defun gnus-mail-forward-using-mhe (&optional buffer)
   "Forward the current message to another user using mh-e."
   ;; First of all, prepare mhe mail buffer.
-  (let ((to (read-string "To: "))
-       (cc (read-string "Cc: "))
-       (buffer (or buffer gnus-article-buffer))
-       subject
-       (config (current-window-configuration))) ;; need to add this - erik
-    ;;(gnus-article-show-all-headers)
-    (setq subject
-         (concat "[" gnus-newsgroup-name "] "
-                 ;;(mail-strip-quoted-names (gnus-fetch-field "From")) ": "
-                 (or (gnus-fetch-field "subject") "")))
+  (let* ((to (read-string "To: "))
+        (cc (read-string "Cc: "))
+        (buffer (or buffer gnus-article-buffer))
+        (config (current-window-configuration)) ;; need to add this - erik
+        (subject (gnus-forward-make-subject buffer)))
     (setq mh-show-buffer buffer)
     (mh-find-path)
     (mh-send-sub to (or cc "") (or subject "(None)") config) ;; Erik Selberg 1/23/94
index 3422c1c..7f483c7 100644 (file)
@@ -38,6 +38,11 @@ might be used, for instance, for inserting signatures based on the
 newsgroup name. (In that case, `gnus-signature-file' and
 `mail-signature' should both be set to nil).")
 
+(defvar gnus-post-prepare-hook nil
+  "*Hook that is run after a post buffer has been prepared.
+If you want to insert the signature, you might put
+`gnus-inews-insert-signature' in this hook.")
+
 (defvar gnus-use-followup-to 'use
   "*Specifies what to do with Followup-To header.
 If nil, ignore the header. If it is t, use its value, but ignore 
@@ -485,9 +490,10 @@ Type \\[describe-mode] in the buffer to get a list of commands."
                      (gnus-summary-remove-process-mark (car yank)))
                    (let ((mail-reply-buffer gnus-article-copy))
                      (news-reply-yank-original nil))
-                   (setq yank (cdr yank))))))
-           (if gnus-post-prepare-function
-               (funcall gnus-post-prepare-function group)))
+                   (setq yank (cdr yank)))))))
+         (if gnus-post-prepare-function
+             (funcall gnus-post-prepare-function group))
+         (run-hooks 'gnus-post-prepare-hook)
          (make-local-variable 'gnus-prev-winconf)
          (setq gnus-prev-winconf winconf))))
   (setq gnus-article-check-size (cons (buffer-size) (gnus-article-checksum)))
@@ -630,7 +636,7 @@ will attempt to use the foreign server to post the article."
                        (replace-match "" t t))
                    (funcall gnus-mail-send-method))
 
-                 (gnus-message 5 "Sending via mail... done")
+                 (gnus-message 5 "Sending via mail...done")
                      
                  (goto-char (point-min))
                  (narrow-to-region
@@ -648,7 +654,7 @@ will attempt to use the foreign server to post the article."
       (gnus-message 5 "Posting to USENET...")
       (if (gnus-inews-article use-group-method)
          (progn
-           (gnus-message 5 "Posting to USENET... done")
+           (gnus-message 5 "Posting to USENET...done")
            (if (gnus-buffer-exists-p (car-safe reply))
                (progn
                  (save-excursion
@@ -845,7 +851,7 @@ will attempt to use the foreign server to post the article."
            ;; Send the control article to NNTP server.
            (gnus-message 5 "Canceling your article...")
            (if (gnus-inews-article)
-               (gnus-message 5 "Canceling your article... done")
+               (gnus-message 5 "Canceling your article...done")
              (ding) 
              (gnus-message 1 "Cancel failed; %s" 
                            (gnus-status-message gnus-newsgroup-name)))
index 3541b77..345a7c7 100644 (file)
@@ -180,6 +180,7 @@ highlight-headers-follow-url-netscape:
       ["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]
      ))
@@ -596,7 +597,7 @@ highlight-headers-follow-url-netscape:
     ("cancel" . gnus-summary-cancel-article)
     "misc"
     ("exit" . gnus-summary-exit)
-    ("fed up" . gnus-summary-catchup-and-goto-next)))
+    ("fed up" . gnus-summary-catchup-and-goto-next-group)))
 
 (defvar gnus-carpal-server-buffer-buttons 
   '(("add" . gnus-server-add-server)
index 842cee9..3b28172 100644 (file)
@@ -112,9 +112,8 @@ save those articles instead."
   
 (defun gnus-mail-forward-using-vm (&optional buffer)
   "Forward the current message to another user using vm."
-  (let ((gnus-buffer (or buffer (current-buffer)))
-       (subject (concat "[" gnus-newsgroup-name "] "
-                        (or (gnus-fetch-field "Subject") ""))))
+  (let* ((gnus-buffer (or buffer (current-buffer)))
+        (subject (gnus-forward-make-subject gnus-buffer)))
     (or (featurep 'win-vm)
        (if gnus-use-full-window
            (pop-to-buffer gnus-article-buffer)
index ae65019..f83a259 100644 (file)
@@ -196,6 +196,34 @@ information can be restored from the dribble file.")
 (defvar gnus-asynchronous-article-function nil
   "*Function for picking articles to pre-fetch, possibly.")
 
+(defvar gnus-score-file-single-match-alist nil
+  "*Alist mapping regexps to lists of score files.
+Each element of this alist should be of the form
+       (\"REGEXP\" [ \"SCORE-FILE-1\" ] [ \"SCORE-FILE-2\" ] ... )
+
+If the name of a group is matched by REGEXP, the corresponding scorefiles
+will be used for that group.
+The first match found is used, subsequent matching entries are ignored (to
+use mutliple matches, see gnus-score-file-multiple-match-alist).
+
+These score files are loaded in addition to any files returned by
+gnus-score-find-score-files-function (which see).")
+
+(defvar gnus-score-file-multiple-match-alist nil
+  "*Alist mapping regexps to lists of score files.
+Each element of this alist should be of the form
+       (\"REGEXP\" [ \"SCORE-FILE-1\" ] [ \"SCORE-FILE-2\" ] ... )
+
+If the name of a group is matched by REGEXP, the corresponding scorefiles
+will be used for that group.
+If multiple REGEXPs match a group, the score files corresponding to each
+match will be used (for only one match to be used, see
+gnus-score-file-single-match-alist).
+
+These score files are loaded in addition to any files returned by
+gnus-score-find-score-files-function (which see).")
+
+
 (defvar gnus-score-file-suffix "SCORE"
   "*Suffix of the score files.")
 
@@ -908,6 +936,7 @@ with some simple extensions.
     ("nnml" mail respool)
     ("nnmh" mail respool) 
     ("nndir" none prompt-address address)
+    ("nneething" none prompt-address)
     ("nndigest" none) 
     ("nndoc" none prompt-address) 
     ("nnbabyl" mail respool) 
@@ -2929,6 +2958,7 @@ Note: LIST has to be sorted over `<'."
   (define-key gnus-group-group-map "p" 'gnus-group-edit-group-parameters)
   (define-key gnus-group-group-map "v" 'gnus-group-add-to-virtual)
   (define-key gnus-group-group-map "V" 'gnus-group-make-empty-virtual)
+  (define-key gnus-group-group-map "D" 'gnus-group-enter-directory)
 
   (define-prefix-command 'gnus-group-list-map)
   (define-key gnus-group-mode-map "A" 'gnus-group-list-map)
@@ -3600,6 +3630,29 @@ If argument ALL is non-nil, already read articles become readable."
   (interactive "P")
   (gnus-group-read-group all t))
 
+;; Enter a group that is not in the group buffer. Non-nil is returned
+;; if selection was successful.
+(defun gnus-group-read-ephemeral-group 
+  (group method &optional activate quit-config)
+  (let ((group (if (gnus-group-foreign-p group) group
+                (gnus-group-prefixed-name group method))))
+    (gnus-sethash 
+     group
+     (list t nil (list group gnus-level-default-subscribed nil nil 
+                      (append method
+                              (list
+                               (list 'quit-config 
+                                     (if quit-config quit-config
+                                       (cons (current-buffer) 'summary)))))))
+     gnus-newsrc-hashtb)
+    (set-buffer gnus-group-buffer)
+    (if activate (gnus-request-group group (nth 1 method)))
+    (condition-case ()
+       (gnus-group-read-group t t group)
+      (error nil)
+      (quit nil))
+    (not (equal major-mode 'gnus-group-mode))))
+  
 (defun gnus-group-jump-to-group (group)
   "Jump to newsgroup GROUP."
   (interactive (list (completing-read "Group: " gnus-active-hashtb nil
@@ -3946,6 +3999,24 @@ score file entries for articles to include in the group."
     (forward-line -1)
     (gnus-group-position-cursor)))
 
+(defun gnus-group-enter-directory (dir)
+  "Enter an ephemeral nneething group."
+  (interactive "DDirectory to read: ")
+  (let* ((method (list 'nneething dir))
+        (leaf (gnus-group-prefixed-name
+               (file-name-nondirectory (directory-file-name dir))
+               method))
+        (name leaf)
+        (num 0))
+    (while (gnus-gethash name gnus-newsrc-hashtb)
+      (setq name (concat leaf "<" (int-to-string (setq num (1+ num))) ">")))
+    (let ((nneething-read-only t))
+      (or (gnus-group-read-ephemeral-group 
+          name method t
+          (cons (current-buffer) (if (eq major-mode 'gnus-summary-mode)
+                                     'summary 'group)))
+         (error "Couldn't enter %s" dir)))))
+
 ;; Group sorting commands
 ;; Suggested by Joe Hildebrand <hildjj@idaho.fuentez.com>.
 
@@ -4686,25 +4757,11 @@ and the second element is the address."
 (defun gnus-browse-read-group (&optional no-article)
   "Enter the group at the current line."
   (interactive)
-  (let ((group (gnus-browse-group-name))
-       (buf (current-buffer)))
-    (set-buffer gnus-group-buffer)
-    (gnus-sethash 
-     group
-     (list t nil 
-          (list group gnus-level-default-subscribed nil nil 
-                (cons (cons 'quit-config (current-window-configuration)) 
-                      gnus-browse-current-method)))
-     gnus-newsrc-hashtb)
-    (condition-case ()
-       (gnus-group-read-group t no-article group)
-      (error nil)
-      (quit nil))
-    (if (not (equal major-mode 'gnus-group-mode))
-       ()
-      (switch-to-buffer buf)
-      (gnus-configure-windows 'browse)
-      (gnus-message 3 "Article not a digest?"))))
+  (let ((group (gnus-browse-group-name)))
+    (or (gnus-group-read-ephemeral-group 
+        group gnus-browse-current-method nil
+        (cons (current-buffer) 'browse))
+       (error "Couldn't enter %s" group))))
 
 (defun gnus-browse-select-group ()
   "Select the current group."
@@ -7029,7 +7086,7 @@ The prefix argument ALL means to select all articles."
           (funcall 'gnus-score-save))
       ;; Do not switch windows but change the buffer to work.
       (set-buffer gnus-group-buffer)
-      (or (eq 'nndigest method)
+      (or (assoc 'quit-config (gnus-find-method-for-group gnus-newsgroup-name))
          (gnus-group-update-group group)))))
   
 (defun gnus-summary-exit (&optional temporary)
@@ -7039,17 +7096,17 @@ gnus-exit-group-hook is called with no arguments if that value is non-nil."
   (gnus-set-global-variables)
   (gnus-kill-save-kill-buffer)
   (let* ((group gnus-newsgroup-name)
-        (quit-config (cdr (assoc 'quit-config (gnus-find-method-for-group
-                                               gnus-newsgroup-name))))
+        (quit-config (nth 1 (assoc 'quit-config (gnus-find-method-for-group
+                                                 gnus-newsgroup-name))))
         (mode major-mode)
         (method (car (gnus-find-method-for-group group)))
         (buf (current-buffer)))
     (gnus-summary-update-info) ; Make all changes in this group permanent.
     ;; Make sure where I was, and go to next newsgroup.
-    (if (eq method 'nndigest)
-       ()
-      (gnus-group-jump-to-group group)
-      (gnus-group-next-unread-group 1))
+    (or quit-config
+       (progn
+         (gnus-group-jump-to-group group)
+         (gnus-group-next-unread-group 1)))
     (if temporary
        nil                             ;Nothing to do.
       ;; We set all buffer-local variables to nil. It is unclear why
@@ -7069,23 +7126,24 @@ gnus-exit-group-hook is called with no arguments if that value is non-nil."
          (bury-buffer gnus-article-buffer))
       (setq gnus-current-select-method gnus-select-method)
       (pop-to-buffer gnus-group-buffer)
-      (if (eq method 'nndigest)
-         ()
-       (gnus-group-jump-to-group group)
-       (gnus-group-next-unread-group 1))
-      (if (gnus-buffer-exists-p quit-config)
+      (if (not quit-config)
          (progn
-           (set-window-configuration quit-config)
-           (and (eq major-mode 'gnus-summary-mode)
-                (gnus-set-global-variables)))))))
+           (gnus-group-jump-to-group group)
+           (gnus-group-next-unread-group 1))
+       (if (not (buffer-name (car quit-config)))
+           (gnus-configure-windows 'group)
+         (set-buffer (car quit-config))
+         (and (eq major-mode 'gnus-summary-mode)
+              (gnus-set-global-variables))
+         (gnus-configure-windows (cdr quit-config)))))))
 
 (defalias 'gnus-summary-quit 'gnus-summary-exit-no-update)
 (defun gnus-summary-exit-no-update (&optional no-questions)
   "Quit reading current newsgroup without updating read article info."
   (interactive)
   (let* ((group gnus-newsgroup-name)
-        (quit-config (cdr (assoc 'quit-config 
-                                 (gnus-find-method-for-group group)))))
+        (quit-config (nth 1 (assoc 'quit-config 
+                                   (gnus-find-method-for-group group)))))
     (if (or no-questions
            gnus-expert-user
            (gnus-y-or-n-p "Do you really wanna quit reading this group? "))
@@ -7102,11 +7160,14 @@ gnus-exit-group-hook is called with no arguments if that value is non-nil."
              (bury-buffer gnus-article-buffer))
          (if (equal (gnus-group-group-name) group)
              (gnus-group-next-unread-group 1))
-         (if (gnus-buffer-exists-p quit-config)
+         (if quit-config
              (progn
-               (set-window-configuration quit-config)
-               (and (eq major-mode 'gnus-summary-mode)
-                    (gnus-set-global-variables))))))))
+               (if (not (buffer-name (car quit-config)))
+                   (gnus-configure-windows 'group)
+                 (set-buffer (car quit-config))
+                 (and (eq major-mode 'gnus-summary-mode)
+                      (gnus-set-global-variables))
+                 (gnus-configure-windows (cdr quit-config)))))))))
 
 ;; Suggested by Andrew Eskilsson <pi92ae@pt.hk-r.se>.
 (defun gnus-summary-fetch-faq (group)
@@ -7321,13 +7382,12 @@ be displayed."
              ;; The requested article is different from the current article.
              (progn
                (gnus-summary-display-article article all-headers)
-               (gnus-configure-windows 'article)
                (setq did article))
            (if all-headers (gnus-article-show-all-headers))
-           (gnus-configure-windows 'article)
            nil))
-      (if did (gnus-article-set-window-start 
-              (cdr (assq article gnus-newsgroup-bookmarks)))))))
+      (if did 
+         (gnus-article-set-window-start 
+          (cdr (assq article gnus-newsgroup-bookmarks)))))))
 
 (defun gnus-summary-set-current-mark (&optional current-mark)
   "Obsolete function."
@@ -7364,7 +7424,7 @@ If BACKWARD, the previous article is selected instead of the next."
                                   gnus-newsgroup-end)))
      ;; Go to next/previous group.
      (t
-      (or (eq method 'nndigest)
+      (or (assoc 'quit-config (gnus-find-method-for-group gnus-newsgroup-name))
          (gnus-summary-jump-to-group gnus-newsgroup-name))
       (let ((cmd (aref (this-command-keys) 0))
            (group 
@@ -7379,7 +7439,8 @@ If BACKWARD, the previous article is selected instead of the next."
          (gnus-message 7 "No more%s articles" (if unread " unread" "")))
         ((eq gnus-auto-select-next 'quietly)
          ;; Select quietly.
-         (if (eq method 'nndigest)
+         (if (assoc 'quit-config (gnus-find-method-for-group 
+                                  gnus-newsgroup-name))
              (gnus-summary-exit)
            (gnus-message 7 "No more%s articles (%s)..."
                          (if unread " unread" "") 
@@ -7392,7 +7453,9 @@ If BACKWARD, the previous article is selected instead of the next."
            (while (or (null key) (memq key keystrokes))
              (gnus-message 
               7 "No more%s articles%s" (if unread " unread" "")
-              (if (and group (not (eq method 'nndigest)))
+              (if (and group (not (assoc 'quit-config
+                                         (gnus-find-method-for-group 
+                                          gnus-newsgroup-name))))
                   (format " (Type %s for %s [%s])"
                           (single-key-description cmd) group
                           (car (gnus-gethash group gnus-newsrc-hashtb)))
@@ -7410,7 +7473,9 @@ If BACKWARD, the previous article is selected instead of the next."
                      (setq group (gnus-group-group-name))
                      (switch-to-buffer obuf)))))
            (if (eq key cmd)
-               (if (or (not group) (eq method 'nndigest))
+               (if (or (not group) (assoc 'quit-config
+                                          (gnus-find-method-for-group
+                                           gnus-newsgroup-name)))
                    (gnus-summary-exit)
                  (gnus-summary-next-group nil group backward))
              (setq unread-command-events (list key)))))))))))
@@ -7451,7 +7516,6 @@ current article."
            (not (equal (car gnus-article-current) gnus-newsgroup-name)))
        ;; Selected subject is different from current article's.
        (gnus-summary-display-article article)
-      (gnus-configure-windows 'article)
       (gnus-eval-in-buffer-window
        gnus-article-buffer
        (setq endp (gnus-article-next-page lines)))
@@ -7476,7 +7540,6 @@ Argument LINES specifies lines to be scrolled down."
            (not (equal (car gnus-article-current) gnus-newsgroup-name)))
        ;; Selected subject is different from current article's.
        (gnus-summary-display-article article)
-      (gnus-configure-windows 'article)
       (gnus-summary-recenter)
       (gnus-eval-in-buffer-window gnus-article-buffer
        (gnus-article-prev-page lines))))
@@ -7667,25 +7730,14 @@ NOTE: This command only works with newsgroup that use NNTP."
                       gnus-newsgroup-name (list 'nndigest "")) 
                      gnus-current-article))
        (buf (current-buffer)))
-    (set-buffer gnus-group-buffer)
-    (gnus-sethash 
-     name 
-     (list t nil (list name gnus-level-default-subscribed nil nil 
-                      (list 'nndigest gnus-article-buffer
-                            (cons 'quit-config 
-                                  (current-window-configuration)))))
-     gnus-newsrc-hashtb)
-    (condition-case ()
-       (gnus-group-read-group t nil name)
-      (error nil)
-      (quit nil))
-    (if (not (equal major-mode 'gnus-group-mode))
+    (if (gnus-group-read-ephemeral-group 
+        name (list 'nndigest gnus-article-buffer))
        ()
       (switch-to-buffer buf)
       (gnus-set-global-variables)
       (gnus-configure-windows 'summary)
       (gnus-message 3 "Article not a digest?"))))
-  
+
 (defun gnus-summary-isearch-article ()
   "Do incremental search forward on current article."
   (interactive)
@@ -8720,34 +8772,32 @@ even ticked and dormant ones."
   (interactive "sMarks: ")
   ;; Fix by Sudish Joseph <joseph@cis.ohio-state.edu>.
   (gnus-set-global-variables)
-  (save-excursion
-    (set-buffer gnus-summary-buffer)
-    (let ((buffer-read-only nil)
-          (marks (concat "^[" marks "]")))
+  (let ((buffer-read-only nil)
+       (marks (concat "^[" marks "]")))
+    (goto-char (point-min))
+    (if gnus-newsgroup-adaptive
+       (gnus-score-remove-lines-adaptive marks)
+      (while (re-search-forward marks nil t)
+       (gnus-delete-line)))
+    ;; If we use dummy roots, we have to do an additional sweep over
+    ;; the buffer.
+    (if (not (eq gnus-summary-make-false-root 'dummy))
+       ()
       (goto-char (point-min))
-      (if gnus-newsgroup-adaptive
-         (gnus-score-remove-lines-adaptive marks)
-       (while (re-search-forward marks nil t)
-         (gnus-delete-line)))
-      ;; If we use dummy roots, we have to do an additional sweep over
-      ;; the buffer.
-      (if (not (eq gnus-summary-make-false-root 'dummy))
-         ()
-       (goto-char (point-min))
-       (setq marks (concat "^[" (char-to-string gnus-dummy-mark) "]"))
-       (while (re-search-forward marks nil t)
-         (if (gnus-subject-equal
-              (gnus-summary-subject-string)
-              (progn
-                (forward-line 1)
-                (gnus-summary-subject-string)))
-             ()
-           (forward-line -1)
-           (gnus-delete-line))))))
+      (setq marks (concat "^[" (char-to-string gnus-dummy-mark) "]"))
+      (while (re-search-forward marks nil t)
+       (if (gnus-subject-equal
+            (gnus-summary-subject-string)
+            (progn
+              (forward-line 1)
+              (gnus-summary-subject-string)))
+           ()
+         (forward-line -1)
+         (gnus-delete-line))))))
   (or (zerop (buffer-size))
       (if (eobp)
          (gnus-summary-prev-subject 1)
-       (gnus-summary-position-cursor))))
+       (gnus-summary-position-cursor)))
 
 (defun gnus-summary-expunge-below (score)
   "Remove articles with score less than SCORE."
@@ -9667,17 +9717,28 @@ The following commands are available:
   ;; If the article number is negative, that means that this article
   ;; doesn't belong in this newsgroup (possibly), so we find its
   ;; message-id and request it by id instead of number.
-  (if (and (numberp article) (< article 0))
-      (save-excursion
-       (set-buffer gnus-summary-buffer)
-       (let ((header (gnus-gethash (int-to-string article)
-                                   gnus-newsgroup-headers-hashtb-by-number)))
-         (if (vectorp header)
-             ;; It's a real article.
-             (setq article (header-id header))
-           ;; It is an extracted pseudo-article.
-           (setq article nil)
-           (gnus-request-pseudo-article header)))))
+  (if (not (numberp article))
+      ()
+    (save-excursion
+      (set-buffer gnus-summary-buffer)
+      (let ((header (gnus-get-header-by-number article)))
+       (if (< article 0)
+           (if (vectorp header)
+               ;; It's a real article.
+               (setq article (header-id header))
+             ;; It is an extracted pseudo-article.
+             (setq article 'pseudo)
+             (gnus-request-pseudo-article header)))
+
+       (let ((method (gnus-find-method-for-group gnus-newsgroup-name)))
+         (if (not (eq (car method) 'nneething))
+             ()
+           (let ((dir (concat (file-name-as-directory (nth 1 method))
+                              (header-subject header))))
+             (if (file-directory-p dir)
+                 (progn
+                   (setq article 'nneething)
+                   (gnus-group-enter-directory dir)))))))))
 
   ;; Check the cache.
   (if (and gnus-use-cache
@@ -9685,14 +9746,14 @@ The following commands are available:
           (gnus-cache-request-article article group))
       'article
     ;; Get the article and into the article buffer.
-    (if article
+    (if (or (stringp article) (numberp article))
        (progn
          (erase-buffer)
          (let ((gnus-override-method 
                 (and (stringp article) gnus-refer-article-method)))
            (and (gnus-request-article article group (current-buffer))
                 'article)))
-      'pseudo)))
+      article)))
 
 (defun gnus-read-header (id)
   "Read the headers of article ID and enter them into the Gnus system."
@@ -9759,7 +9820,7 @@ If ALL-HEADERS is non-nil, no headers are hidden."
                   (setq gnus-article-current 
                         (cons gnus-newsgroup-name article)))
              nil)
-         (if (not (eq result 'article))
+         (if (or (eq result 'pseudo) (eq result 'nneething))
              (progn
                (save-excursion
                  (set-buffer summary-buffer)
@@ -9769,7 +9830,9 @@ If ALL-HEADERS is non-nil, no headers are hidden."
                        gnus-current-article 0
                        gnus-current-headers nil
                        gnus-article-current nil)
-                 (gnus-configure-windows 'article)
+                 (if (eq result 'nneething)
+                     (gnus-configure-windows 'summary)
+                   (gnus-configure-windows 'article))
                  (gnus-set-global-variables))
                (gnus-set-mode-line 'article))
            ;; The result from the `request' was an actual article -
@@ -10033,56 +10096,58 @@ how much time has lapsed since DATE."
   (interactive (list 'ut))
   (let ((date (header-date (or gnus-current-headers 
                               (gnus-get-header-by-number
-                               (gnus-summary-article-number)))))
+                               (gnus-summary-article-number))"")))
        (date-regexp "^Date: \\|^X-Sent: "))
-    (save-excursion
-      (set-buffer gnus-article-buffer)
-      (let ((buffer-read-only nil))
-       (goto-char (point-min))
-       (if (and (re-search-forward date-regexp nil t)
-                (progn 
-                  (beginning-of-line)
-                  (looking-at date-regexp)))
-           (delete-region (gnus-point-at-bol)
-                          (progn (end-of-line) (1+ (point))))
+    (if (not date)
+       ()
+      (save-excursion
+       (set-buffer gnus-article-buffer)
+       (let ((buffer-read-only nil))
          (goto-char (point-min))
-         (goto-char (- (search-forward "\n\n") 2)))
-       (insert
-        (cond 
-         ((eq type 'local)
-          (concat "Date: " (timezone-make-date-arpa-standard date) "\n"))
-         ((eq type 'ut)
-          (concat "Date: " (timezone-make-date-arpa-standard date nil "UT")
-                  "\n"))
-         ((eq type 'lapsed)
-          (let* ((sec (- (gnus-seconds-since-epoch 
-                          (timezone-make-date-arpa-standard
-                           (current-time-string) (current-time-zone) "UT"))
-                         (gnus-seconds-since-epoch 
-                          (timezone-make-date-arpa-standard date nil "UT"))))
-                 (units (list (cons 'year (* 365.25 24 60 60))
-                              (cons 'week (* 7 24 60 60))
-                              (cons 'day (* 24 60 60))
-                              (cons 'hour (* 60 60))
-                              (cons 'minute 60)
-                              (cons 'second 1)))
-                 num prev)
-            (concat
-             "X-Sent: "
-             (mapconcat 
-              (lambda (unit)
-                (if (zerop (setq num (ffloor (/ sec (cdr unit)))))
-                    ""
-                  (setq sec (- sec (* num (cdr unit))))
-                  (prog1
-                      (concat (if prev ", " "") (int-to-string (floor num))
-                              " " (symbol-name (car unit))
-                              (if (> num 1) "s" ""))
-                    (setq prev t))))
-              units "")
-             " ago\n")))
-         (t
-          (error "Unknown conversion type: %s" type))))))))
+         (if (and (re-search-forward date-regexp nil t)
+                  (progn 
+                    (beginning-of-line)
+                    (looking-at date-regexp)))
+             (delete-region (gnus-point-at-bol)
+                            (progn (end-of-line) (1+ (point))))
+           (goto-char (point-min))
+           (goto-char (- (search-forward "\n\n") 2)))
+         (insert
+          (cond 
+           ((eq type 'local)
+            (concat "Date: " (timezone-make-date-arpa-standard date) "\n"))
+           ((eq type 'ut)
+            (concat "Date: " (timezone-make-date-arpa-standard date nil "UT")
+                    "\n"))
+           ((eq type 'lapsed)
+            (let* ((sec (- (gnus-seconds-since-epoch 
+                            (timezone-make-date-arpa-standard
+                             (current-time-string) (current-time-zone) "UT"))
+                           (gnus-seconds-since-epoch 
+                            (timezone-make-date-arpa-standard date nil "UT"))))
+                   (units (list (cons 'year (* 365.25 24 60 60))
+                                (cons 'week (* 7 24 60 60))
+                                (cons 'day (* 24 60 60))
+                                (cons 'hour (* 60 60))
+                                (cons 'minute 60)
+                                (cons 'second 1)))
+                   num prev)
+              (concat
+               "X-Sent: "
+               (mapconcat 
+                (lambda (unit)
+                  (if (zerop (setq num (ffloor (/ sec (cdr unit)))))
+                      ""
+                    (setq sec (- sec (* num (cdr unit))))
+                    (prog1
+                        (concat (if prev ", " "") (int-to-string (floor num))
+                                " " (symbol-name (car unit))
+                                (if (> num 1) "s" ""))
+                      (setq prev t))))
+                units "")
+               " ago\n")))
+           (t
+            (error "Unknown conversion type: %s" type)))))))))
 
 (defun gnus-article-date-local ()
   "Convert the current article date to the local timezone."
@@ -10713,7 +10778,8 @@ If CONFIRM is non-nil, the user will be asked for an NNTP server."
                                   (file-name-as-directory
                                    (expand-file-name
                                     (concat "~/" (substring
-                                                  gnus-nntp-server 1)))))))
+                                                  gnus-nntp-server 1)))))
+                            (list 'nnmh-get-new-mail nil)))
                      (t
                       (list 'nntp gnus-nntp-server)))))
 
@@ -12719,7 +12785,7 @@ score files in the \"/ftp.some-where:/pub/score\" directory.
          (setq suffix (car suffixes)
                suffixes (cdr suffixes))
          (if (file-exists-p (concat dir "/" suffix))
-             (setq files (list (concat dir "/" suffix))))
+             (setq files (cons (concat dir "/" suffix) files)))
          (while (>= (1+ (length dir)) mdir)
            (and (file-exists-p (concat dir "/all/" suffix))
                 (setq files (cons (concat dir "/all/" suffix) files)))
@@ -12763,6 +12829,10 @@ GROUP using BNews sys file syntax."
          (goto-char (point-max))
          (search-backward "/")
          (delete-region (1+ (point)) (point-min)))
+       ;; If short file names were used, we have to translate slashes.
+       (goto-char (point-min))
+       (while (search-forward "/" nil t)
+         (replace-match "." t t))
        ;; Translate "all" to ".*".
        (while (search-forward "all" nil t)
          (replace-match ".*" t t))
@@ -12816,6 +12886,42 @@ This includes the score file for the group and all its parents."
     (setq all (cons group all))
     (mapcar 'gnus-score-file-name (nreverse all))))
 
+(defvar gnus-score-file-alist-cache nil)
+
+(defun gnus-score-find-alist (group)
+  "Return list of score files for GROUP.
+The list is determined from the variable gnus-score-file-alist."
+  (let ((alist gnus-score-file-multiple-match-alist)
+       score-files)
+    ;; if this group has been seen before, return the cached entry
+    (if (setq score-files (assoc group gnus-score-file-alist-cache))
+       (cdr score-files)       ; ensures caching of groups with no matches
+      ;; handle the multiple match alist
+      (while alist
+       (and (string-match (car (car alist)) group)
+            (setq score-files
+                  (nconc score-files (cdr (car alist)))))
+       (setq alist (cdr alist)))
+      (setq alist gnus-score-file-single-match-alist)
+      ;; handle the single match alist
+      (catch 'done
+       (while alist
+         (and (string-match (car (car alist)) group)
+              ;; progn used just in case ("regexp") has no files
+              ;; and score-files is still nil. -sj
+              ;; this can be construed as a "stop searching here" feature :>
+              ;; and used to simplify regexps in the single-alist 
+              (progn
+                (setq score-files
+                      (nconc score-files (cdr (car alist))))
+                (throw 'done nil)))
+         (setq alist (cdr alist))))
+      ;; cache the score files
+      (setq gnus-score-file-alist-cache
+           (cons (cons group score-files) gnus-score-file-alist-cache))
+      score-files)))
+
+
 (defun gnus-possibly-score-headers (&optional trace)
   (let ((func gnus-score-find-score-files-function)
        score-files scores)
@@ -12823,6 +12929,7 @@ This includes the score file for the group and all its parents."
         (setq func (list func)))
     ;; Go through all the functions for finding score files (or actual
     ;; scores) and add them to a list.
+    (setq score-files (gnus-score-find-alist gnus-newsgroup-name))
     (while func
       (and (symbolp (car func))
           (fboundp (car func))
index 6797e83..327196c 100644 (file)
@@ -73,7 +73,7 @@
 
 ;;; Interface functions
 
-(defun nnbabyl-retrieve-headers (sequence &optional newsgroup server)
+(defun nnbabyl-retrieqve-headers (sequence &optional newsgroup server)
   (save-excursion
     (set-buffer nntp-server-buffer)
     (erase-buffer)
          (count 0)
          article art-string start stop)
       (nnbabyl-possibly-change-newsgroup newsgroup)
-      (while sequence
-       (setq article (car sequence))
-       (setq art-string (nnbabyl-article-string article))
-       (set-buffer nnbabyl-mbox-buffer)
-       (if (or (search-forward art-string nil t)
-               (search-backward art-string nil t))
-           (progn
-             (re-search-backward (concat "^" nnbabyl-mail-delimiter) nil t)
-             (while (and (not (looking-at ".+:"))
-                         (zerop (forward-line 1))))
-             (setq start (point))
-             (search-forward "\n\n" nil t)
-             (setq stop (1- (point)))
-             (set-buffer nntp-server-buffer)
-             (insert "221 " (int-to-string article) " Article retrieved.\n")
-             (insert-buffer-substring nnbabyl-mbox-buffer start stop)
-             (goto-char (point-max))
-             (insert ".\n")))
-       (setq sequence (cdr sequence))
-       (setq count (1+ count))
+      (if (stringp (car sequence))
+         'headers
+       (while sequence
+         (setq article (car sequence))
+         (setq art-string (nnbabyl-article-string article))
+         (set-buffer nnbabyl-mbox-buffer)
+         (if (or (search-forward art-string nil t)
+                 (search-backward art-string nil t))
+             (progn
+               (re-search-backward (concat "^" nnbabyl-mail-delimiter) nil t)
+               (while (and (not (looking-at ".+:"))
+                           (zerop (forward-line 1))))
+               (setq start (point))
+               (search-forward "\n\n" nil t)
+               (setq stop (1- (point)))
+               (set-buffer nntp-server-buffer)
+               (insert "221 " (int-to-string article) " Article retrieved.\n")
+               (insert-buffer-substring nnbabyl-mbox-buffer start stop)
+               (goto-char (point-max))
+               (insert ".\n")))
+         (setq sequence (cdr sequence))
+         (setq count (1+ count))
+         (and (numberp nnmail-large-newsgroup)
+              (> number nnmail-large-newsgroup)
+              (zerop (% count 20))
+              gnus-verbose-backends
+              (message "nnbabyl: Receiving headers... %d%%"
+                       (/ (* count 100) number))))
+
        (and (numberp nnmail-large-newsgroup)
             (> number nnmail-large-newsgroup)
-            (zerop (% count 20))
             gnus-verbose-backends
-            (message "nnbabyl: Receiving headers... %d%%"
-                     (/ (* count 100) number))))
+            (message "nnbabyl: Receiving headers...done"))
 
-      (and (numberp nnmail-large-newsgroup)
-          (> number nnmail-large-newsgroup)
-          gnus-verbose-backends
-          (message "nnbabyl: Receiving headers... done"))
-
-      ;; Fold continuation lines.
-      (goto-char (point-min))
-      (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
-       (replace-match " " t t))
-      'headers)))
+       ;; Fold continuation lines.
+       (goto-char (point-min))
+       (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
+         (replace-match " " t t))
+       'headers))))
 
 (defun nnbabyl-open-server (server &optional defs)
   (nnheader-init-server-buffer)
 (defun nnbabyl-request-post (&optional server)
   (mail-send-and-exit nil))
 
-(fset 'nnbabyl-request-post-buffer 'nnmail-request-post-buffer)
+(defalias 'nnbabyl-request-post-buffer 'nnmail-request-post-buffer)
 
 (defun nnbabyl-request-expire-articles (articles newsgroup &optional server force)
   (nnbabyl-possibly-change-newsgroup newsgroup)
index f255d09..581a16c 100644 (file)
          range
          beg article)
       (nndigest-possibly-change-buffer newsgroup)
-      (while sequence
-       (setq article (car sequence))
-       (if (setq range (nndigest-narrow-to-article article))
-           (progn
-             (insert (format "221 %d Article retrieved.\n" article))
-             (setq beg (point))
-             (insert-buffer-substring nndigest-current-buffer 
-                                      (car range) (cdr range))
-             (goto-char beg)
-             (if (search-forward "\n\n" nil t)
-                 (forward-char -1)
-               (goto-char (point-max))
-               (insert "\n\n"))
-             (insert (format "Lines: %d\n" (count-lines (point) (point-max))))
-             (insert ".\n")
-             (delete-region (point) (point-max))))
-       (setq sequence (cdr sequence)))
-
-      ;; Fold continuation lines.
-      (goto-char (point-min))
-      (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
-       (replace-match " " t t))
-      'headers)))
+      (if (stringp (car sequence))
+         'headers
+       (while sequence
+         (setq article (car sequence))
+         (if (setq range (nndigest-narrow-to-article article))
+             (progn
+               (insert (format "221 %d Article retrieved.\n" article))
+               (setq beg (point))
+               (insert-buffer-substring nndigest-current-buffer 
+                                        (car range) (cdr range))
+               (goto-char beg)
+               (if (search-forward "\n\n" nil t)
+                   (forward-char -1)
+                 (goto-char (point-max))
+                 (insert "\n\n"))
+               (insert (format "Lines: %d\n" (count-lines (point) (point-max))))
+               (insert ".\n")
+               (delete-region (point) (point-max))))
+         (setq sequence (cdr sequence)))
+
+       ;; Fold continuation lines.
+       (goto-char (point-min))
+       (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
+         (replace-match " " t t))
+       'headers))))
 
 (defun nndigest-open-server (host &optional service)
   (setq nndigest-status-string "")
 (defun nndigest-request-post (&optional server)
   (mail-send-and-exit nil))
 
-(fset 'nndigest-request-post-buffer 'nnmail-request-post-buffer)
+(defalias 'nndigest-request-post-buffer 'nnmail-request-post-buffer)
 
 \f
 
index 24d44ba..705e91d 100644 (file)
@@ -94,7 +94,7 @@ If the stream is opened, return T, otherwise return NIL."
   "Post a new news in current buffer."
   (mail-send-and-exit nil))
 
-(fset 'nndir-request-post-buffer 'nnmail-request-post-buffer)
+(defalias 'nndir-request-post-buffer 'nnmail-request-post-buffer)
 
 (defun nndir-request-expire-articles (articles newsgroup &optional server force)
   "Expire all articles in the ARTICLES list in group GROUP."
index a109f54..d07a4f6 100644 (file)
@@ -54,40 +54,42 @@ Newsgroup must be selected before calling this function."
          (count 0)
          beg article art-string start stop lines)
       (nndoc-possibly-change-buffer newsgroup server)
-      (while sequence
-       (setq article (car sequence))
-       (set-buffer nndoc-current-buffer)
-       (if (nndoc-search-for-article article)
-           (progn
-             (setq start 
-                   (save-excursion
-                     (or 
-                      (re-search-backward 
-                       (concat "^" rmail-unix-mail-delimiter) nil t)
-                      (point-min))))
-             (search-forward "\n\n" nil t)
-             (setq lines (count-lines 
-                          (point)
-                          (or
-                           (save-excursion
-                             (re-search-forward 
-                              (concat "^" rmail-unix-mail-delimiter) nil t))
-                           (point-max))))
-             (setq stop (1- (point)))
-             (set-buffer nntp-server-buffer)
-             (insert (format "221 %d Article retrieved.\n" article))
-             (setq beg (point))
-             (insert-buffer-substring nndoc-current-buffer start stop)
-             (goto-char (point-max))
-             (insert (format "Lines: %d\n" lines))
-             (insert ".\n")))
-       (setq sequence (cdr sequence)))
-
-      ;; Fold continuation lines.
-      (goto-char (point-min))
-      (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
-       (replace-match " " t t))
-      'headers)))
+      (if (stringp (car sequence))
+         'headers
+       (while sequence
+         (setq article (car sequence))
+         (set-buffer nndoc-current-buffer)
+         (if (nndoc-search-for-article article)
+             (progn
+               (setq start 
+                     (save-excursion
+                       (or 
+                        (re-search-backward 
+                         (concat "^" rmail-unix-mail-delimiter) nil t)
+                        (point-min))))
+               (search-forward "\n\n" nil t)
+               (setq lines (count-lines 
+                            (point)
+                            (or
+                             (save-excursion
+                               (re-search-forward 
+                                (concat "^" rmail-unix-mail-delimiter) nil t))
+                             (point-max))))
+               (setq stop (1- (point)))
+               (set-buffer nntp-server-buffer)
+               (insert (format "221 %d Article retrieved.\n" article))
+               (setq beg (point))
+               (insert-buffer-substring nndoc-current-buffer start stop)
+               (goto-char (point-max))
+               (insert (format "Lines: %d\n" lines))
+               (insert ".\n")))
+         (setq sequence (cdr sequence)))
+
+       ;; Fold continuation lines.
+       (goto-char (point-min))
+       (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
+         (replace-match " " t t))
+       'headers))))
 
 (defun nndoc-open-server (host &optional service)
   "Open mbox backend."
@@ -172,7 +174,7 @@ Newsgroup must be selected before calling this function."
 (defun nndoc-request-post (&optional server)
   (mail-send-and-exit nil))
 
-(fset 'nndoc-request-post-buffer 'nnmail-request-post-buffer)
+(defalias 'nndoc-request-post-buffer 'nnmail-request-post-buffer)
 
 \f
 ;;; Internal functions.
index fb2a5e5..90f18f1 100644 (file)
@@ -117,35 +117,37 @@ such things as moving mail.  All buffers always get killed upon server close.")
       (nnfolder-possibly-change-group newsgroup)
       (set-buffer nnfolder-current-buffer)
       (goto-char (point-min))
-      (while sequence
-       (setq article (car sequence))
-       (setq art-string (nnfolder-article-string article))
-       (set-buffer nnfolder-current-buffer)
-       (if (or (search-forward art-string nil t)
-               ;; Don't search the whole file twice!  Also, articles
-               ;; probably have some locality by number, so searching
-               ;; backwards will be faster.  Especially if we're at the
-               ;; beginning of the buffer :-). -SLB
-               (search-backward art-string nil t))
-           (progn
-             (setq start (or (re-search-backward delim-string nil t)
-                             (point)))
-             (search-forward "\n\n" nil t)
-             (setq stop (1- (point)))
-             (set-buffer nntp-server-buffer)
-             (insert (format "221 %d Article retrieved.\n" article))
-             (setq beg (point))
-             (insert-buffer-substring nnfolder-current-buffer start stop)
-             (goto-char (point-max))
-             (insert ".\n")))
-       (setq 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))
-      'headers)))
+      (if (stringp (car sequence))
+         'headers
+       (while sequence
+         (setq article (car sequence))
+         (setq art-string (nnfolder-article-string article))
+         (set-buffer nnfolder-current-buffer)
+         (if (or (search-forward art-string nil t)
+                 ;; Don't search the whole file twice!  Also, articles
+                 ;; probably have some locality by number, so searching
+                 ;; backwards will be faster.  Especially if we're at the
+                 ;; beginning of the buffer :-). -SLB
+                 (search-backward art-string nil t))
+             (progn
+               (setq start (or (re-search-backward delim-string nil t)
+                               (point)))
+               (search-forward "\n\n" nil t)
+               (setq stop (1- (point)))
+               (set-buffer nntp-server-buffer)
+               (insert (format "221 %d Article retrieved.\n" article))
+               (setq beg (point))
+               (insert-buffer-substring nnfolder-current-buffer start stop)
+               (goto-char (point-max))
+               (insert ".\n")))
+         (setq 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))
+       'headers))))
 
 (defun nnfolder-open-server (server &optional defs)
   (nnheader-init-server-buffer)
@@ -282,7 +284,7 @@ such things as moving mail.  All buffers always get killed upon server close.")
 (defun nnfolder-request-post (&optional server)
   (mail-send-and-exit nil))
 
-(fset 'nnfolder-request-post-buffer 'nnmail-request-post-buffer)
+(defalias 'nnfolder-request-post-buffer 'nnmail-request-post-buffer)
 
 (defun nnfolder-request-expire-articles (articles newsgroup &optional server force)
   (nnfolder-possibly-change-group newsgroup)
index 262f4df..2ef2744 100644 (file)
   (nnkiboze-possibly-change-newsgroups group)
   (if (or gnus-nov-is-evil)
       nil
-    (let ((first (car articles))
-         (last (progn (while (cdr articles) (setq articles (cdr articles)))
-                      (car articles)))
-         (nov (nnkiboze-nov-file-name)))
-      (if (file-exists-p nov)
-         (save-excursion
-           (set-buffer nntp-server-buffer)
-           (erase-buffer)
-           (insert-file-contents nov)
-           (goto-char (point-min))
-           (while (and (not (eobp)) (< first (read (current-buffer))))
-             (forward-line 1))
-           (beginning-of-line)
-           (if (not (eobp)) (delete-region 1 (point)))
-           (while (and (not (eobp)) (>= last (read (current-buffer))))
-             (forward-line 1))
-           (beginning-of-line)
-           (if (not (eobp)) (delete-region (point) (point-max)))
-           'nov)))))
+    (if (stringp (car articles))
+       'headers
+      (let ((first (car articles))
+           (last (progn (while (cdr articles) (setq articles (cdr articles)))
+                        (car articles)))
+           (nov (nnkiboze-nov-file-name)))
+       (if (file-exists-p nov)
+           (save-excursion
+             (set-buffer nntp-server-buffer)
+             (erase-buffer)
+             (insert-file-contents nov)
+             (goto-char (point-min))
+             (while (and (not (eobp)) (< first (read (current-buffer))))
+               (forward-line 1))
+             (beginning-of-line)
+             (if (not (eobp)) (delete-region 1 (point)))
+             (while (and (not (eobp)) (>= last (read (current-buffer))))
+               (forward-line 1))
+             (beginning-of-line)
+             (if (not (eobp)) (delete-region (point) (point-max)))
+             'nov))))))
 
 (defun nnkiboze-open-server (newsgroups &optional something)
   "Open a virtual newsgroup that contains NEWSGROUPS."
@@ -83,7 +85,7 @@
   "Close news server."
   t)
 
-(fset 'nnkiboze-request-quit (symbol-function 'nnkiboze-close-server))
+(defalias 'nnkiboze-request-quit (symbol-function 'nnkiboze-close-server))
 
 (defun nnkiboze-server-opened (&optional server)
   "Return server process status, T or NIL.
@@ -176,9 +178,9 @@ If the stream is opened, return T, otherwise return NIL."
   (setq nnkiboze-status-string "nnkiboze: LIST NEWSGROUPS is not implemented.")
   nil)
 
-(fset 'nnkiboze-request-post 'nntp-request-post)
+(defalias 'nnkiboze-request-post 'nntp-request-post)
 
-(fset 'nnkiboze-request-post-buffer 'nntp-request-post-buffer)
+(defalias 'nnkiboze-request-post-buffer 'nntp-request-post-buffer)
 
 \f
 ;;; Internal functions.
index e332bf7..b81b7b2 100644 (file)
@@ -506,7 +506,7 @@ FUNC will be called with the group name to determine the article number."
        (obuf (current-buffer))
        (beg (point-min))
        end found group-art)
-    (if (= (length methods) 1)
+    (if (and (sequencep methods) (= (length methods) 1))
        ;; If there is only just one group to put everything in, we
        ;; just return a list with just this one method in.
        (setq group-art
index 7e159a2..32c1234 100644 (file)
          (count 0)
          beg article art-string start stop)
       (nnmbox-possibly-change-newsgroup newsgroup)
-      (while sequence
-       (setq article (car sequence))
-       (setq art-string (nnmbox-article-string article))
-       (set-buffer nnmbox-mbox-buffer)
-       (if (or (search-forward art-string nil t)
-               (progn (goto-char (point-min))
-                      (search-forward art-string nil t)))
-           (progn
-             (setq start 
-                   (save-excursion
-                     (re-search-backward 
-                      (concat "^" rmail-unix-mail-delimiter) nil t)
-                     (point)))
-             (search-forward "\n\n" nil t)
-             (setq stop (1- (point)))
-             (set-buffer nntp-server-buffer)
-             (insert (format "221 %d Article retrieved.\n" article))
-             (setq beg (point))
-             (insert-buffer-substring nnmbox-mbox-buffer start stop)
-             (goto-char (point-max))
-             (insert ".\n")))
-       (setq sequence (cdr sequence))
-       (setq count (1+ count))
+      (if (stringp (car sequence))
+         'headers
+       (while sequence
+         (setq article (car sequence))
+         (setq art-string (nnmbox-article-string article))
+         (set-buffer nnmbox-mbox-buffer)
+         (if (or (search-forward art-string nil t)
+                 (progn (goto-char (point-min))
+                        (search-forward art-string nil t)))
+             (progn
+               (setq start 
+                     (save-excursion
+                       (re-search-backward 
+                        (concat "^" rmail-unix-mail-delimiter) nil t)
+                       (point)))
+               (search-forward "\n\n" nil t)
+               (setq stop (1- (point)))
+               (set-buffer nntp-server-buffer)
+               (insert (format "221 %d Article retrieved.\n" article))
+               (setq beg (point))
+               (insert-buffer-substring nnmbox-mbox-buffer start stop)
+               (goto-char (point-max))
+               (insert ".\n")))
+         (setq sequence (cdr sequence))
+         (setq count (1+ count))
+         (and (numberp nnmail-large-newsgroup)
+              (> number nnmail-large-newsgroup)
+              (zerop (% count 20))
+              gnus-verbose-backends
+              (message "nnmbox: Receiving headers... %d%%"
+                       (/ (* count 100) number))))
+
        (and (numberp nnmail-large-newsgroup)
             (> number nnmail-large-newsgroup)
-            (zerop (% count 20))
             gnus-verbose-backends
-            (message "nnmbox: Receiving headers... %d%%"
-                     (/ (* count 100) number))))
+            (message "nnmbox: Receiving headers...done"))
 
-      (and (numberp nnmail-large-newsgroup)
-          (> number nnmail-large-newsgroup)
-          gnus-verbose-backends
-          (message "nnmbox: Receiving headers... done"))
-
-      ;; Fold continuation lines.
-      (goto-char (point-min))
-      (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
-       (replace-match " " t t))
-      'headers)))
+       ;; Fold continuation lines.
+       (goto-char (point-min))
+       (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
+         (replace-match " " t t))
+       'headers))))
 
 (defun nnmbox-open-server (server &optional defs)
   (nnheader-init-server-buffer)
 (defun nnmbox-request-post (&optional server)
   (mail-send-and-exit nil))
 
-(fset 'nnmbox-request-post-buffer 'nnmail-request-post-buffer)
+(defalias 'nnmbox-request-post-buffer 'nnmail-request-post-buffer)
 
 (defun nnmbox-request-expire-articles 
   (articles newsgroup &optional server force)
index 0205711..de745dc 100644 (file)
   (save-excursion
     (set-buffer nntp-server-buffer)
     (erase-buffer)
-    (let ((file nil)
-         (number (length sequence))
-         (count 0)
-         beg article)
+    (let* ((file nil)
+          (number (length sequence))
+          (large (and (numberp nnmail-large-newsgroup)
+                      (> number nnmail-large-newsgroup)))
+          (count 0)
+          beg article)
       (nnmh-possibly-change-directory newsgroup)
-      (while sequence
-       (setq article (car sequence))
-       (setq file
-             (concat nnmh-current-directory (prin1-to-string article)))
-       (if (and (file-exists-p file)
-                (not (file-directory-p file)))
-           (progn
-             (insert (format "221 %d Article retrieved.\n" article))
-             (setq beg (point))
-             (nnheader-insert-head file)
-             (goto-char beg)
-             (if (search-forward "\n\n" nil t)
-                 (forward-char -1)
-               (goto-char (point-max))
-               (insert "\n\n"))
-             (insert (format "Lines: %d\n" (count-lines (point) (point-max))))
-             (insert ".\n")
-             (delete-region (point) (point-max))))
-       (setq sequence (cdr sequence))
-       (setq count (1+ count))
-       (and (numberp nnmail-large-newsgroup)
-            (> number nnmail-large-newsgroup)
-            (zerop (% count 20))
-            (message "nnmh: Receiving headers... %d%%"
-                     (/ (* count 100) number))))
-
-      (and (numberp nnmail-large-newsgroup)
-          (> number nnmail-large-newsgroup)
-          (message "nnmh: Receiving headers... done"))
-
-      ;; Fold continuation lines.
-      (goto-char (point-min))
-      (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
-       (replace-match " " t t))
-      'headers)))
+      (if (stringp (car sequence))
+         'headers
+       (while sequence
+         (setq article (car sequence))
+         (setq file
+               (concat nnmh-current-directory (int-to-string article)))
+         (if (and (file-exists-p file)
+                  (not (file-directory-p file)))
+             (progn
+               (insert (format "221 %d Article retrieved.\n" article))
+               (setq beg (point))
+               (nnheader-insert-head file)
+               (goto-char beg)
+               (if (search-forward "\n\n" nil t)
+                   (forward-char -1)
+                 (goto-char (point-max))
+                 (insert "\n\n"))
+               (insert ".\n")
+               (delete-region (point) (point-max))))
+         (setq sequence (cdr sequence))
+         (setq count (1+ count))
+
+         (and large
+              (zerop (% count 20))
+              (message "nnmh: Receiving headers... %d%%"
+                       (/ (* count 100) number))))
+
+       (and large (message "nnmh: Receiving headers...done"))
+
+       ;; Fold continuation lines.
+       (goto-char (point-min))
+       (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
+         (replace-match " " t t))
+       'headers))))
 
 (defun nnmh-open-server (server &optional defs)
   (nnheader-init-server-buffer)
   (nnmh-possibly-change-directory newsgroup)
   (let ((file (if (stringp id)
                  nil
-               (concat nnmh-current-directory (prin1-to-string id))))
+               (concat nnmh-current-directory (int-to-string id))))
        (nntp-server-buffer (or buffer nntp-server-buffer)))
-    (if (and (stringp file)
-            (file-exists-p file)
-            (not (file-directory-p file)))
-       (save-excursion
-         (nnmail-find-file file)))))
+    (and (stringp file)
+        (file-exists-p file)
+        (not (file-directory-p file))
+        (save-excursion (nnmail-find-file file)))))
 
 (defun nnmh-request-group (group &optional server dont-check)
   (and nnmh-get-new-mail (or dont-check (nnmh-get-new-mail group)))
 (defun nnmh-request-post (&optional server)
   (mail-send-and-exit nil))
 
-(fset 'nnmh-request-post-buffer 'nnmail-request-post-buffer)
+(defalias 'nnmh-request-post-buffer 'nnmail-request-post-buffer)
 
 (defun nnmh-request-expire-articles (articles newsgroup &optional server force)
   (nnmh-possibly-change-directory newsgroup)
     (if (or (not nnmh-get-new-mail) (not nnmail-spool-file))
        ()
       ;; We first activate all the groups.
-      (nnmh-request-list)
-      (setq nnmh-group-alist (nnmail-get-active))
+      (if (or (not group) (not nnmh-group-alist))
+         (progn
+           (nnmh-request-list)
+           (setq nnmh-group-alist (nnmail-get-active))))
       ;; The we go through all the existing spool files and split the
       ;; mail from each.
       (while spools
index cd960e3..3cb1e99 100644 (file)
@@ -101,45 +101,47 @@ all. This may very well take some time.")
          (number (length sequence))
          (count 0)
          beg article)
-      (nnml-possibly-change-directory newsgroup)
-      (if (nnml-retrieve-headers-with-nov sequence)
-         'nov
-       (while sequence
-         (setq article (car sequence))
-         (setq file
-               (concat nnml-current-directory (prin1-to-string article)))
-         (if (and (file-exists-p file)
-                  (not (file-directory-p file)))
-             (progn
-               (insert (format "221 %d Article retrieved.\n" article))
-               (setq beg (point))
-               (nnheader-insert-head file)
-               (goto-char beg)
-               (if (search-forward "\n\n" nil t)
-                   (forward-char -1)
-                 (goto-char (point-max))
-                 (insert "\n\n"))
-               (insert ".\n")
-               (delete-region (point) (point-max))))
-         (setq sequence (cdr sequence))
-         (setq count (1+ count))
+      (if (stringp (car sequence))
+         'headers
+       (nnml-possibly-change-directory newsgroup)
+       (if (nnml-retrieve-headers-with-nov sequence)
+           'nov
+         (while sequence
+           (setq article (car sequence))
+           (setq file
+                 (concat nnml-current-directory (int-to-string article)))
+           (if (and (file-exists-p file)
+                    (not (file-directory-p file)))
+               (progn
+                 (insert (format "221 %d Article retrieved.\n" article))
+                 (setq beg (point))
+                 (nnheader-insert-head file)
+                 (goto-char beg)
+                 (if (search-forward "\n\n" nil t)
+                     (forward-char -1)
+                   (goto-char (point-max))
+                   (insert "\n\n"))
+                 (insert ".\n")
+                 (delete-region (point) (point-max))))
+           (setq sequence (cdr sequence))
+           (setq count (1+ count))
+           (and (numberp nnmail-large-newsgroup)
+                (> number nnmail-large-newsgroup)
+                (zerop (% count 20))
+                gnus-verbose-backends
+                (message "nnml: Receiving headers... %d%%"
+                         (/ (* count 100) number))))
+
          (and (numberp nnmail-large-newsgroup)
               (> number nnmail-large-newsgroup)
-              (zerop (% count 20))
               gnus-verbose-backends
-              (message "nnml: Receiving headers... %d%%"
-                       (/ (* count 100) number))))
+              (message "nnml: Receiving headers...done"))
 
-       (and (numberp nnmail-large-newsgroup)
-            (> number nnmail-large-newsgroup)
-            gnus-verbose-backends
-            (message "nnml: Receiving headers... done"))
-
-       ;; Fold continuation lines.
-       (goto-char (point-min))
-       (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
-         (replace-match " " t t))
-       'headers))))
+         ;; Fold continuation lines.
+         (goto-char (point-min))
+         (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
+           (replace-match " " t t))
+         'headers)))))
 
 (defun nnml-open-server (server &optional defs)
   (nnheader-init-server-buffer)
@@ -173,7 +175,7 @@ all. This may very well take some time.")
   (nnml-possibly-change-directory newsgroup)
   (let ((file (if (stringp id)
                  nil
-               (concat nnml-current-directory (prin1-to-string id))))
+               (concat nnml-current-directory (int-to-string id))))
        (nntp-server-buffer (or buffer nntp-server-buffer)))
     (if (and (stringp file)
             (file-exists-p file)
@@ -253,7 +255,7 @@ all. This may very well take some time.")
 (defun nnml-request-post (&optional server)
   (mail-send-and-exit nil))
 
-(fset 'nnml-request-post-buffer 'nnmail-request-post-buffer)
+(defalias 'nnml-request-post-buffer 'nnmail-request-post-buffer)
 
 (defun nnml-request-expire-articles (articles newsgroup &optional server force)
   (nnml-possibly-change-directory newsgroup)
@@ -481,8 +483,10 @@ all. This may very well take some time.")
     (if (or (not nnml-get-new-mail) (not nnmail-spool-file))
        ()
       ;; We first activate all the groups.
-      (nnml-request-list)
-      (setq nnml-group-alist (nnmail-get-active))
+      (if (or (not group) (not nnml-group-alist))
+         (progn
+           (nnml-request-list)
+           (setq nnml-group-alist (nnmail-get-active))))
       ;; The we go through all the existing spool files and split the
       ;; mail from each.
       (while spools
index 6f35444..bf9a452 100644 (file)
@@ -150,7 +150,7 @@ Newsgroup must be selected before calling this function."
                 (message "NNSPOOL: Receiving headers... %d%%"
                          (/ (* count 100) number))))
          
-         (and do-message (message "NNSPOOL: Receiving headers... done"))
+         (and do-message (message "NNSPOOL: Receiving headers...done"))
          
          ;; Fold continuation lines.
          (goto-char (point-min))
@@ -334,14 +334,15 @@ Newsgroup must be selected before calling this function."
     (goto-char (point-min))
     (if (or (zerop (buffer-size))
            (search-forward "spooled" nil t))
-       ()
+       (kill-buffer (current-buffer))
       ;; Make status message by unfolding lines.
       (subst-char-in-region (point-min) (point-max) ?\n ?\\ 'noundo)
       (setq nnspool-status-string (buffer-string))
       (message "nnspool: %s" nnspool-status-string)
-      (kill-buffer (current-buffer)))))
+      ;(kill-buffer (current-buffer))
+      )))
 
-(fset 'nnspool-request-post-buffer 'nntp-request-post-buffer)
+(defalias 'nnspool-request-post-buffer 'nntp-request-post-buffer)
 
 \f
 ;;; Internal functions.
@@ -349,7 +350,7 @@ Newsgroup must be selected before calling this function."
 (defun nnspool-retrieve-headers-with-nov (articles)
   (if (or gnus-nov-is-evil nnspool-nov-is-evil)
       nil
-    (let ((nov (concat nnspool-nov-directory
+    (let ((nov (concat (file-name-as-directory nnspool-nov-directory)
                       (nnspool-replace-chars-in-string
                        nnspool-current-group ?. ?/)
                       "/.overview"))
index 6831baf..03fb50f 100644 (file)
@@ -254,7 +254,7 @@ instead call function `nntp-status-message' to get status message.")
              (nntp-accept-response)))
        (and (numberp nntp-large-newsgroup)
             (> number nntp-large-newsgroup)
-            (message "NNTP: Receiving headers... done"))
+            (message "NNTP: Receiving headers...done"))
 
        ;; Now all of replies are received.
        (setq received number)
@@ -371,7 +371,7 @@ instead call function `nntp-status-message' to get status message.")
            (nntp-send-command nil "QUIT")))
     (nntp-close-server-internal server)))
 
-(fset 'nntp-request-quit (symbol-function 'nntp-close-server))
+(defalias 'nntp-request-quit (symbol-function 'nntp-close-server))
 
 (defun nntp-request-close ()
   "Close all server connections."
index 16094dd..fc06d07 100644 (file)
     (set-buffer (get-buffer-create "*virtual headers*"))
     (buffer-disable-undo (current-buffer))
     (erase-buffer)
-    (let ((map nnvirtual-current-mapping)
-         (offset 0)
-         articles beg group active top article result prefix)
-      (while sequence
-       (while (< (car (car map)) (car sequence))
-         (setq offset (car (car map)))
-         (setq map (cdr map)))
-       (setq top (car (car map)))
-       (setq group (nth 1 (car map)))
-       (setq prefix (gnus-group-real-prefix group))
-       (setq active (nth 2 (car map)))
-       (setq articles nil)
-       (while (and sequence (<= (car sequence) top))
-         (setq articles (cons (- (+ active (car sequence)) offset) articles))
-         (setq sequence (cdr sequence)))
-       (setq articles (nreverse articles))
-       (if (and articles
-                (setq result (gnus-retrieve-headers articles group)))
+    (if (stringp (car sequence))
+       'headers
+      (let ((map nnvirtual-current-mapping)
+           (offset 0)
+           articles beg group active top article result prefix)
+       (while sequence
+         (while (< (car (car map)) (car sequence))
+           (setq offset (car (car map)))
+           (setq map (cdr map)))
+         (setq top (car (car map)))
+         (setq group (nth 1 (car map)))
+         (setq prefix (gnus-group-real-prefix group))
+         (setq active (nth 2 (car map)))
+         (setq articles nil)
+         (while (and sequence (<= (car sequence) top))
+           (setq articles (cons (- (+ active (car sequence)) offset) articles))
+           (setq sequence (cdr sequence)))
+         (setq articles (nreverse articles))
+         (if (and articles
+                  (setq result (gnus-retrieve-headers articles group)))
+             (save-excursion
+               (set-buffer nntp-server-buffer)
+               ;; If we got HEAD headers, we convert them into NOV
+               ;; headers. This is slow, inefficient and, come to think
+               ;; of it, downright evil. So sue me. I couldn't be
+               ;; bothered to write a header parse routine that could
+               ;; parse a mixed HEAD/NOV buffer.
+               (and (eq result 'headers) (nnvirtual-convert-headers))
+               (goto-char (point-min))
+               (while (not (eobp))
+                 (setq beg (point))
+                 (setq article (read nntp-server-buffer))
+                 (delete-region beg (point))
+                 (insert (int-to-string (+ (- article active) offset)))
+                 (beginning-of-line)
+                 (looking-at "[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t")
+                 (goto-char (match-end 0))
+                 (or (search-forward 
+                      "\t" (save-excursion (end-of-line) (point)) t)
+                     (end-of-line))
+                 (while (= (char-after (1- (point))) ? )
+                   (forward-char -1)
+                   (delete-char 1))
+                 (if (eolp)
+                     (progn
+                       (end-of-line)
+                       (or (= (char-after (1- (point))) ?\t)
+                           (insert ?\t))
+                       (insert (format "Xref: %s %s:%d\t" (system-name) 
+                                       group article)))
+                   (if (not (string= "" prefix))
+                       (while (re-search-forward 
+                               "[^ ]+:[0-9]+"
+                               (save-excursion (end-of-line) (point)) t)
+                         (save-excursion
+                           (goto-char (match-beginning 0))
+                           (insert prefix))))
+                   (end-of-line)
+                   (or (= (char-after (1- (point))) ?\t)
+                       (insert ?\t)))
+                 (forward-line 1))))
+         (goto-char (point-max))
+         (insert-buffer-substring nntp-server-buffer))
+       ;; The headers are ready for reading, so they are inserted into
+       ;; the nntp-server-buffer, which is where Gnus expects to find
+       ;; them.
+       (prog1
            (save-excursion
              (set-buffer nntp-server-buffer)
-             ;; If we got HEAD headers, we convert them into NOV
-             ;; headers. This is slow, inefficient and, come to think
-             ;; of it, downright evil. So sue me. I couldn't be
-             ;; bothered to write a header parse routine that could
-             ;; parse a mixed HEAD/NOV buffer.
-             (and (eq result 'headers) (nnvirtual-convert-headers))
-             (goto-char (point-min))
-             (while (not (eobp))
-               (setq beg (point))
-               (setq article (read nntp-server-buffer))
-               (delete-region beg (point))
-               (insert (int-to-string (+ (- article active) offset)))
-               (beginning-of-line)
-               (looking-at "[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t")
-               (goto-char (match-end 0))
-               (or (search-forward 
-                    "\t" (save-excursion (end-of-line) (point)) t)
-                   (end-of-line))
-               (while (= (char-after (1- (point))) ? )
-                 (forward-char -1)
-                 (delete-char 1))
-               (if (eolp)
-                   (progn
-                     (end-of-line)
-                     (or (= (char-after (1- (point))) ?\t)
-                         (insert ?\t))
-                     (insert (format "Xref: %s %s:%d\t" (system-name) 
-                                     group article)))
-                 (if (not (string= "" prefix))
-                     (while (re-search-forward 
-                             "[^ ]+:[0-9]+"
-                             (save-excursion (end-of-line) (point)) t)
-                       (save-excursion
-                         (goto-char (match-beginning 0))
-                         (insert prefix))))
-                 (end-of-line)
-                 (or (= (char-after (1- (point))) ?\t)
-                     (insert ?\t)))
-               (forward-line 1))))
-       (goto-char (point-max))
-       (insert-buffer-substring nntp-server-buffer))
-      ;; The headers are ready for reading, so they are inserted into
-      ;; the nntp-server-buffer, which is where Gnus expects to find
-      ;; them.
-      (prog1
-         (save-excursion
-           (set-buffer nntp-server-buffer)
-           (erase-buffer)
-           (insert-buffer-substring "*virtual headers*")
-           'nov)
-       (kill-buffer (current-buffer))))))
+             (erase-buffer)
+             (insert-buffer-substring "*virtual headers*")
+             'nov)
+         (kill-buffer (current-buffer)))))))
 
 (defun nnvirtual-open-server (newsgroups &optional something)
   "Open a virtual newsgroup that contains NEWSGROUPS."
@@ -204,7 +206,7 @@ If the stream is opened, return T, otherwise return NIL."
        "nnvirtual: LIST NEWSGROUPS is not implemented.")
   nil)
 
-(fset 'nnvirtual-request-post 'nntp-request-post)
+(defalias 'nnvirtual-request-post 'nntp-request-post)
 
 (defun nnvirtual-request-post-buffer 
   (post group subject header article-buffer info follow-to respect-poster)
index f239033..f4cbad6 100644 (file)
@@ -1282,6 +1282,7 @@ The different methods all have their peculiarities, of course.
 * nnvirtual::        Combining articles from many groups.
 * nnkiboze::         Looking through parts of the newsfeed for articles.
 * nndir::            You can read a directory as if it was a newsgroup.
+* nneething::          Dired? Who needs dired?
 * nndoc::            Single files can be the basis of a group.
 * nndigest::         Digests can be undigested and treated as a group.
 * Reading Mail::     Reading your personal mail with Gnus.
@@ -1611,6 +1612,63 @@ over at @samp{sina} as a newsgroup.  Distributed news ahoy!
 
 nndir will use @sc{nov} files if they are present.
 
+@node nneething
+@subsection nneething
+@cindex nneething
+
+From the @code{nndir} backend (which reads a single spool-like
+directory), it's just a hop and a skip to @code{nneething}, which
+pretends that any random directory is a newsgroup. Strange, but true.
+
+When @code{nneething} is presented with a directory, it will scan this
+directory and assign article numbers to each file. When you enter such a
+group, @code{nneething} must create "headers" that Gnus can use. After
+all, Gnus is a newsreader, in case you're forgetting. @code{nneething}
+does this in a two-step process. First, it snoops each file in question.
+If the file looks like an article (ie. the first few lines look like
+headers), it will use this as the head. If this is just some random file
+without a head (eg. a C source file), @code{nneething} will cobble up a
+header out of thin air. It will use file ownership, name and date and do
+whatever it can with these elements.
+
+All this should happen automatically for you, and you will be presented
+with something that looks very much like a newsgroup. Totally like a
+newsgroup, to be precise. If you select an article, it will be displayed
+in the article buffer, just as usual.
+
+If you select a line that represents a directory, Gnus will pop you into
+a new summary buffer for this @code{nneething} group. And so on. You can
+traverse the entire disk this way, if you feel like, but remember that
+Gnus is not dired, really, and does not intend to be, either.
+
+There are two overall modes to this action - ephemeral or solid. When
+doing the ephemeral thing (ie. @kbd{G D} from the group buffer), Gnus
+will not store information on what files you have read, and what files
+are new, and so on. If you create a solid @code{nneething} group the
+normal way with @kbd{G m}, Gnus will store a mapping table between
+article numbers and file names, and you can treat this group like any
+other groups. When you activate a solid @code{nneething} group, you will
+be told how many unread articles it contains, etc., etc.
+
+Some variables:
+
+@table @code
+@item nneething-map-file-directory
+@vindex nneething-map-file-directory
+All the mapping files for solid @code{nneething} groups will be stored
+in this directory, which defaults to @file{~/.nneething/}.
+
+@item nneething-exclude-files
+@vindex nneething-exclude-files
+All files that match this regexp will be ignored. Nice to use to exclude
+auto-save files and the like, which is what it does by default.
+
+@item nneething-map-file
+@vindex nneething-map-file
+Name of the map files.
+@end table
+
+
 @node nndoc
 @subsection nndoc
 @cindex nndoc
@@ -3197,6 +3255,12 @@ This function is called with the name of the current group after the
 post buffer has been initialized, and can be used for inserting a
 signature.  Nice if you use different signatures in different groups.
 
+@item gnus-post-prepapare-hook
+@vindex gnus-post-prepapare-hook
+This hook is called after a post buffer has been prepared. If you want
+to insert a signature at this point, you could put
+@code{gnus-inews-insert-signature} into this hook.
+
 @item news-reply-header-hook
 @vindex news-reply-header-hook
 A related variable when following up and replying is this variable,