*** empty log message ***
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 4 Mar 1997 04:37:57 +0000 (04:37 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 4 Mar 1997 04:37:57 +0000 (04:37 +0000)
lisp/ChangeLog
lisp/gnus-msg.el
lisp/gnus-score.el
lisp/gnus-uu.el
lisp/gnus.el
lisp/nnfolder.el
lisp/nnmh.el
texi/ChangeLog
texi/gnus.texi

index 52c69e0..77dbdf0 100644 (file)
@@ -1,5 +1,53 @@
+Sun Oct 15 03:16:03 1995  Lars Magne Ingebrigtsen  <larsi@gjalp.ifi.uio.no>
+
+       * gnus.el (gnus-summary-limit-to-marks): Don't do any adaptive
+       thingies. 
+
+Sun Oct 15 01:27:57 1995  Lars Magne Ingebrigtsen  <larsi@gymir.ifi.uio.no>
+
+       * gnus.el (gnus-summary-limit-to-marks): Doc fix.
+       (gnus-remove-articles-1): Updated positions incorrectly. 
+       (gnus-parse-simple-format): User-defined specs bugged out.
+
+Sat Oct 14 10:04:27 1995  Lars Ingebrigtsen  <lars@eyesore.no>
+
+       * gnus-msg.el (gnus-posting-styles): New variable.
+       (gnus-posting-style-alist): New variable.
+       (gnus-configure-posting-styles): New function.
+       (gnus-new-news): Use it. 
+       (gnus-news-followup): Use it.
+       (gnus-mail-setup): Use it.
+
+       * gnus-score.el (gnus-score-adaptive): Iterate over data, not the
+       buffer. 
+
+       * gnus.el (gnus-data-pseudo-p): New function.
+
+       * gnus-score.el: Removed `gnus-score-remove-lines-adaptive'.
+
+       * nnfolder.el (nnfolder-request-delete-group): Didn't totally
+       remove the group from all structures.
+
+       * gnus.el (gnus-summary-move-article): Don't remove lines that
+       correspond to moved articles.
+       (gnus-summary-copy-article): Copy into the cache, possibly.
+       (gnus-summary-move-article): Ditto.
+
+       * gnus-uu.el (gnus-uu-find-articles-matching): Iterate over the
+       data instead of the buffer.
+
+       * gnus.el (gnus-rebuild-thread): Didn't work on untreaded displays
+       (or anywhere else).
+       (gnus-summary-insert-dummy-line): New implementation.
+       (gnus-summary-prepare-threads): Don't output dummy lines that
+       don't have children.
+       (gnus-summary-skip-intangible): New function.
+       (gnus-summary-article-intangible-p): New function.
+
 Sat Oct 14 02:07:39 1995  Lars Magne Ingebrigtsen  <larsi@narfi.ifi.uio.no>
 
+       * gnus.el: 0.9 is released.
+
        * gnus.el (gnus-summary-refer-parent-article): Take a look at the
        actual References header.
 
index 81dc289..e1cef0b 100644 (file)
@@ -28,6 +28,7 @@
 (require 'gnus)
 (require 'sendmail)
 (require 'gnus-ems)
+(eval-when-compile (require 'cl))
 
 (defvar gnus-organization-file "/usr/lib/news/organization"
   "*Local news organization file.")
@@ -131,6 +132,14 @@ the group.")
           "drafts"))
   "*The directory where draft messages will be stored.")
 
+(defvar gnus-posting-styles nil
+  "*Alist of styles to use when posting.")
+
+(defvar gnus-posting-style-alist
+  '((organization . gnus-organization-file)
+    (signature . gnus-signature-file)
+    (from . gnus-user-from-line)))
+
 (defvar gnus-user-login-name nil
   "*The login name of the user.
 Got from the function `user-login-name' if undefined.")
@@ -1634,6 +1643,8 @@ mailer."
     (pop-to-buffer gnus-post-news-buffer)  
     (erase-buffer)
     (news-reply-mode)
+    ;; Let posting styles be configured.
+    (gnus-configure-posting-styles)
     (news-setup nil subject nil group nil)
     (gnus-inews-insert-signature)
     (and gnus-post-prepare-function
@@ -1709,6 +1720,9 @@ mailer."
                (setq sendto (concat sendto (and sendto ", ") (cdr elt)))
                (setq follow-to (delq elt follow-to))))
 
+         ;; Let posting styles be configured.
+         (gnus-configure-posting-styles)
+
          (news-setup nil subject nil 
                      (or group sendto 
                          (and follow-to
@@ -1953,7 +1967,6 @@ mailer."
         (winconf (current-window-configuration))
         (subject (gnus-forward-make-subject forward-buffer)))
     (set-buffer (get-buffer-create gnus-mail-buffer))
-    (mail-mode)
     (if (and (buffer-modified-p)
             (> (buffer-size) 0)
             (not (gnus-y-or-n-p 
@@ -2183,6 +2196,8 @@ Headers will be generated before sending."
 
 (defun gnus-mail-setup (type &optional to subject in-reply-to cc
                             replybuffer actions)
+  ;; Let posting styles be configured.
+  (gnus-configure-posting-styles)
   (funcall
    (cond
     ((or 
@@ -2360,6 +2375,61 @@ Headers will be generated before sending."
     ;; Put point where you left it.
     (goto-char (nth 3 type))))
   
+(defun gnus-configure-posting-styles ()
+  "Configure posting styles according to `gnus-posting-styles'."
+  (let ((styles gnus-posting-styles)
+       style match variable attribute value value-value)
+    ;; Go through all styles and look for matches.
+    (while styles
+      (setq style (pop styles)
+           match (pop style))
+      (when (cond ((stringp match)
+                  ;; Regexp string match on the group name.
+                  (string-match match gnus-newsgroup-name))
+                 ((symbolp match)
+                  (cond ((fboundp match)
+                         ;; Function to be called.
+                         (funcall match))
+                        ((boundp match)
+                         ;; Variable to be checked.
+                         (symbol-value match))))
+                 ((listp match)
+                  ;; This is a form to be evaled.
+                  (eval match)))
+       ;; We have a match, so we set the variables.
+       (while style
+         (setq attribute (pop style)
+               value (cdr attribute))
+         ;; We find the variable that is to be modified.
+         (if (and (not (stringp (car attribute)))
+                  (not (setq variable (cdr (assq (car attribute) 
+                                                 gnus-posting-style-alist)))))
+             (message "Couldn't find attribute %s" (car attribute))
+           ;; We set the variable.
+           (setq value-value
+                 (cond ((stringp value)
+                        value)
+                       ((symbolp value)
+                        (cond ((fboundp value)
+                               (funcall value))
+                              ((boundp value)
+                               (symbol-value value))))
+                       ((listp value)
+                        (eval value))))
+           (if variable
+               (progn
+                 ;; This is an ordinary variable.
+                 (make-local-variable variable)
+                 (set variable value-value))
+             ;; This is a header to be added to the headers when
+             ;; posting. 
+             (when value-value
+               (make-local-variable gnus-required-headers)
+               (make-local-variable gnus-required-mail-headers)
+               (push (cons (car attribute) value-value) 
+                     gnus-required-headers)
+               (push (cons (car attribute) value-value) 
+                     gnus-required-mail-headers)))))))))
 
 ;;; Allow redefinition of functions.
 
index 0abb124..ffa2f6a 100644 (file)
@@ -1495,6 +1495,7 @@ SCORE is the score to add."
     (let* ((malist (gnus-copy-sequence gnus-adaptive-score-alist))
           (alist malist)
           (date (current-time-string)) 
+          (data gnus-newsgroup-data)
           elem headers match)
       ;; First we transform the adaptive rule alist into something
       ;; that's faster to process.
@@ -1505,25 +1506,28 @@ SCORE is the score to add."
        (setq elem (cdr elem))
        (while elem
          (setcdr (car elem) 
-                 (cons (symbol-name (car (car elem))) (cdr (car elem))))
+                 (cons (if (eq (car (car elem)) 'followup)
+                           "references"
+                         (symbol-name (car (car elem))))
+                       (cdr (car elem))))
          (setcar (car elem) 
                  (intern 
                   (concat "gnus-header-" 
-                          (downcase (symbol-name (car (car elem)))))))
+                          (if (eq (car (car elem)) 'followup)
+                              "message-id"
+                            (downcase (symbol-name (car (car elem))))))))
          (setq elem (cdr elem)))
        (setq malist (cdr malist)))
       ;; We change the score file to the adaptive score file.
       (gnus-score-load-file (gnus-score-file-name 
                             gnus-newsgroup-name gnus-adaptive-file-suffix))
       ;; The we score away.
-      (goto-char (point-min))
-      (while (not (eobp))
-       (setq elem (cdr (assq (gnus-summary-article-mark) alist)))
+      (while data
+       (setq elem (cdr (assq (gnus-data-mark (car data)) alist)))
        (if (or (not elem)
-               (get-text-property (point) 'gnus-pseudo))
+               (gnus-data-pseudo-p (car data)))
            ()
-         (when (and (setq headers (gnus-summary-article-header))
-                    (vectorp headers))
+         (when (setq headers (gnus-data-header (car data)))
            (while elem 
              (setq match (funcall (car (car elem)) headers))
              (gnus-summary-score-entry 
@@ -1543,54 +1547,7 @@ SCORE is the score to add."
                       'f 's))))
               (nth 2 (car elem)) date nil t)
              (setq elem (cdr elem)))))
-       (forward-line 1)))))
-
-(defun gnus-score-remove-lines-adaptive (marks)
-  (save-excursion
-    (let* ((malist (gnus-copy-sequence gnus-adaptive-score-alist))
-          (alist malist)
-          (date (current-time-string)) 
-          (cur-score gnus-current-score-file)
-          elem headers match)
-      ;; First we transform the adaptive rule alist into something
-      ;; that's faster to process.
-      (while malist
-       (setq elem (car malist))
-       (if (symbolp (car elem))
-           (setcar elem (symbol-value (car elem))))
-       (setq elem (cdr elem))
-       (while elem
-         (setcdr (car elem) 
-                 (cons (symbol-name (car (car elem))) (cdr (car elem))))
-         (setcar (car elem) 
-                 (intern 
-                  (concat "gnus-header-" 
-                          (downcase (symbol-name (car (car elem)))))))
-         (setq elem (cdr elem)))
-       (setq malist (cdr malist)))
-      ;; The we score away.
-      (goto-char (point-min))
-      ;; We change the score file to the adaptive score file.
-      (gnus-score-load-file (gnus-score-file-name 
-                            gnus-newsgroup-name gnus-adaptive-file-suffix))
-      (while (re-search-forward marks nil t)
-       (beginning-of-line)
-       (setq elem (cdr (assq (gnus-summary-article-mark) alist)))
-       (if (or (not elem)
-               (get-text-property (gnus-point-at-bol) 'gnus-pseudo))
-           ()
-         (setq headers (gnus-summary-article-header))
-         (while elem
-           (setq match (funcall (car (car elem)) headers))
-           (gnus-summary-score-entry 
-            (nth 1 (car elem)) match
-            (if (or (not gnus-score-exact-adapt-limit)
-                    (< (length match) gnus-score-exact-adapt-limit))
-                'e 's) 
-            (nth 2 (car elem)) date nil t)
-           (setq elem (cdr elem)))))
-      ;; Switch back to the old score file.
-      (gnus-score-load-file cur-score))))
+       (setq data (cdr data))))))
 
 ;;;
 ;;; Score mode.
index b996128..c4cc1f4 100644 (file)
@@ -27,6 +27,7 @@
 
 (require 'gnus)
 (require 'gnus-msg)
+(eval-when-compile (require 'cl))
 
 ;; Default viewing action rules
 
@@ -973,20 +974,20 @@ The headers will be included in the sequence they are matched.")
          ()
        ;; Collect all subjects matching subject.
        (let ((case-fold-search t)
-             subj mark)
-         (goto-char (point-min))
-         (while (not (eobp))
-           (and (setq subj (gnus-summary-article-subject))
-                (string-match subject subj)
-                (or (not only-unread)
-                    (= (setq mark (gnus-summary-article-mark)) 
+             (data gnus-newsgroup-data)
+             subj mark d)
+         (while data
+           (setq d (pop data))
+           (and (or (not only-unread)
+                    (= (setq mark (gnus-data-mark d))
                        gnus-unread-mark)
                     (= mark gnus-ticked-mark)
                     (= mark gnus-dormant-mark))
+                (setq subj (mail-header-subject (gnus-data-header d)))
+                (string-match subject subj)
                 (setq list-of-subjects 
                       (cons (cons subj (gnus-summary-article-number))
-                            list-of-subjects)))
-           (forward-line 1)))
+                            list-of-subjects)))))
 
        ;; Expand numbers, sort, and return the list of article
        ;; numbers.
@@ -1109,8 +1110,9 @@ The headers will be included in the sequence they are matched.")
 
       (if (not (= (or gnus-current-article 0) article))
          (let ((nntp-async-number nil))
-           (gnus-request-article article gnus-newsgroup-name
-                                 nntp-server-buffer)
+           (save-excursion
+             (set-buffer nntp-server-buffer)
+             (gnus-request-article-this-buffer article gnus-newsgroup-name))
            (setq gnus-last-article gnus-current-article)
            (setq gnus-current-article article)
            (setq gnus-article-current (cons gnus-newsgroup-name article))
index 58e0635..504f343 100644 (file)
@@ -944,8 +944,6 @@ list.")
   "*There is no thread under the article.")
 (defvar gnus-not-empty-thread-mark ?=
   "*There is a thread under the article.")
-(defvar gnus-dummy-mark ?Z
-  "*This is a dummy article.")
 
 (defvar gnus-view-pseudo-asynchronously nil
   "*If non-nil, Gnus will view pseudo-articles asynchronously.")
@@ -1476,7 +1474,7 @@ variable (string, integer, character, etc).")
   "gnus-bug@ifi.uio.no (The Gnus Bugfixing Girls + Boys)"
   "The mail address of the Gnus maintainers.")
 
-(defconst gnus-version "September Gnus v0.9"
+(defconst gnus-version "September Gnus v0.10"
   "Version number for this version of Gnus.")
 
 (defvar gnus-info-nodes
@@ -1911,7 +1909,6 @@ Thank you for your help in stamping out bugs.
   (autoload 'gnus-score-headers "gnus-score")
   (autoload 'gnus-current-score-file-nondirectory "gnus-score")
   (autoload 'gnus-score-adaptive "gnus-score")
-  (autoload 'gnus-score-remove-lines-adaptive "gnus-score")
   (autoload 'gnus-score-find-trace "gnus-score")
   (autoload 'gnus-score-flush-cache "gnus-score" nil t)
   (autoload 'gnus-score-close "gnus-score" nil t)
@@ -2280,7 +2277,7 @@ Thank you for your help in stamping out bugs.
        (if (not (setq elem (cdr (assq spec spec-alist))))
            (setq elem '("*" ?s)))
        ;; Treat user defined format specifiers specially
-       (and (eq (car elem) 'user-defined)
+       (and (eq (car elem) 'gnus-tmp-user-defined)
             (setq elem
                   (list 
                    (list (intern (concat "gnus-user-format-function-"
@@ -2762,10 +2759,11 @@ If optional argument RE-ONLY is non-nil, strip `Re:' only."
     (or r (error "No such setting: %s" setting))
 
     (if (and (not force) (setq all-visible (gnus-all-windows-visible-p r)))
-       ;; All the windows mentioned are already visibe, so we just
+       ;; All the windows mentioned are already visible, so we just
        ;; put point in the assigned buffer, and do not touch the
        ;; winconf. 
-       (select-window (get-buffer-window all-visible))
+       (select-window (get-buffer-window all-visible t))
+        
 
       ;; Either remove all windows or just remove all Gnus windows.
       (if gnus-use-full-window
@@ -2856,7 +2854,7 @@ If optional argument RE-ONLY is non-nil, strip `Re:' only."
       ;; Finally, we pop to the buffer that's supposed to have point. 
       (or jump-buffer (error "Missing `point' in spec for %s" setting))
 
-      (select-window (get-buffer-window jump-buffer))
+      (select-window (get-buffer-window jump-buffer t))
       (set-buffer jump-buffer))))
 
 (defun gnus-all-windows-visible-p (rule)
@@ -6285,6 +6283,9 @@ The following commands are available:
 (defmacro gnus-data-unread-p (data)
   (` (= (nth 1 (, data)) gnus-unread-mark)))
 
+(defmacro gnus-data-pseudo-p (data)
+  (` (vectorp (nth 3 (, data)))))
+
 (defmacro gnus-data-find (number)
   (` (assq (, number) gnus-newsgroup-data)))
 
@@ -6350,20 +6351,33 @@ The following commands are available:
     (setq data (cdr data))))
 
 (defun gnus-summary-article-pseudo-p (article)
+  "Say whether this article is a pseudo article or not."
   (not (vectorp (gnus-data-header (gnus-data-find article)))))
 
 (defun gnus-article-parent-p (number)
+  "Say whether this article is a parent or not."
   (let* ((data (gnus-data-find-list number)))
     (and (cdr data)                    ; There has to be an article after...
         (< (gnus-data-level (car data)) ; And it has to have a higher level.
            (gnus-data-level (nth 1 data))))))
     
+(defmacro gnus-summary-skip-intangible ()
+  "If the current article is intangible, then jump to a different article."
+  (let ((to (get-text-property (point) 'gnus-intangible)))
+    (when to
+      (gnus-summary-goto-subject to))))
+
+(defmacro gnus-summary-article-intangible-p ()
+  "Say whether this article is intangible or not."
+  (get-text-property (point) 'gnus-intangible))
+
 ;; Some summary mode macros.
 
 (defmacro gnus-summary-article-number (&optional number-or-nil)
   "The article number of the article on the current line.
 If there isn's an article number here, then we return the current
 article number."
+  (gnus-summary-skip-intangible)
   (if number-or-nil
       '(get-text-property (point) 'gnus-number)
     '(or (get-text-property (point) 'gnus-number) 
@@ -6479,12 +6493,12 @@ article number."
     
 (defun gnus-summary-insert-dummy-line 
   (sformat gnus-tmp-subject gnus-tmp-number)
-  (if (not sformat) 
-      (setq sformat gnus-summary-dummy-line-format-spec))
+  "Insert a dummy root in the summary buffer."
+  (or sformat (setq sformat gnus-summary-dummy-line-format-spec))
   (beginning-of-line)
-  (put-text-property
+  (add-text-properties
    (point) (progn (eval sformat) (point))
-   'gnus-number gnus-tmp-number))
+   (list 'gnus-number gnus-tmp-number 'gnus-intangible gnus-tmp-number)))
 
 (defvar gnus-thread-indent-array nil)
 (defvar gnus-thread-indent-array-level gnus-thread-indent-level)
@@ -6714,10 +6728,6 @@ If NO-DISPLAY, don't generate a summary buffer."
            (gnus-message 6 "No unread news")
            (gnus-kill-buffer kill-buffer)
            nil)
-       ;;(save-excursion
-       ;;  (if kill-buffer
-       ;;      (let ((gnus-summary-buffer kill-buffer))
-       ;;      (gnus-configure-windows 'group))))
        ;; Hide conversation thread subtrees.  We cannot do this in
        ;; gnus-summary-prepare-hook since kill processing may not
        ;; work with hidden articles.
@@ -6760,8 +6770,7 @@ If NO-DISPLAY, don't generate a summary buffer."
         (gnus-gather-threads 
          (gnus-sort-threads 
           (gnus-make-threads)))
-       gnus-newsgroup-headers)
-     'cull)
+       gnus-newsgroup-headers))
     (gnus-summary-update-lines)
     (setq gnus-newsgroup-data (nreverse gnus-newsgroup-data))
     ;; Call hooks for modifying summary buffer.
@@ -6882,14 +6891,16 @@ If NO-DISPLAY, don't generate a summary buffer."
                   (and (zerop (forward-line -1))
                        (gnus-summary-article-number))))
        headers refs thread art data)
-    ;; First go up in this thread until we find the root.
-    (while (and id (setq headers
-                        (car (setq art (gnus-gethash (downcase id) dep)))))
-      (setq thread art)
-      (setq id (gnus-parent-id (mail-header-references headers))))
-    ;; We now have the root, so we remove this thread from the summary
-    ;; buffer. 
-    (gnus-remove-articles thread)
+    (if (not gnus-show-threads)
+       (setq thread (car (gnus-gethash (downcase id) dep)))
+      ;; First go up in this thread until we find the root.
+      (while (and id (setq headers
+                          (car (setq art (gnus-gethash (downcase id) dep)))))
+       (setq thread art)
+       (setq id (gnus-parent-id (mail-header-references headers))))
+      ;; We now have the root, so we remove this thread from the summary
+      ;; buffer. 
+      (gnus-remove-articles thread))
     (let ((beg (point)))
       ;; We then insert this thread into the summary buffer.
       (let (gnus-newsgroup-data)
@@ -6916,8 +6927,9 @@ Returns how many articles were removed."
         (pos (gnus-data-pos (gnus-data-find number))))
     (if pos
        (progn
-         (gnus-data-remove number (- (progn (forward-line 1) (point))
-                                     (forward-line -1) (point)))
+         (goto-char pos)
+         (gnus-data-remove number (- (progn (beginning-of-line) (point)) 
+                                     (progn (forward-line 1) (point))))
          (cons pos (apply 'nconc
                           (mapcar (lambda (th) (gnus-remove-articles-1 th))
                                   (cdr thread)))))
@@ -6928,8 +6940,11 @@ Returns how many articles were removed."
   ;; Sort threads as specified in `gnus-thread-sort-functions'.
   (let ((fun gnus-thread-sort-functions))
     (while fun
+      (gnus-message 6 "Sorting with %S..." fun)
       (setq threads (sort threads (car fun))
            fun (cdr fun))))
+  (if gnus-thread-sort-functions
+      (gnus-message 6 "Sorting...done"))
   threads)
 
 ;; Written by Hallvard B Furuseth <h.b.furuseth@usit.uio.no>.
@@ -7011,8 +7026,9 @@ Unscored articles will be counted as having a score of zero."
 (defvar gnus-tmp-prev-subject nil)
 (defvar gnus-tmp-false-parent nil)
 (defvar gnus-tmp-root-expunged nil)
+(defvar gnus-tmp-dummy-line nil)
 
-(defun gnus-summary-prepare-threads (threads &optional cull)
+(defun gnus-summary-prepare-threads (threads)
   "Prepare summary buffer from THREADS and indentation LEVEL.  
 THREADS is either a list of `(PARENT [(CHILD1 [(GRANDCHILD ...]...) ...])'  
 or a straight list of headers."
@@ -7027,13 +7043,14 @@ or a straight list of headers."
        ;; If this is a straight (sic) list of headers, then a
        ;; threaded summary display isn't required, so we just create
        ;; an unthreaded one.
-       (gnus-summary-prepare-unthreaded threads cull)
+       (gnus-summary-prepare-unthreaded threads)
 
       ;; Do the threaded display.
 
       (while (or threads stack new-adopts new-roots)
 
        (if (and (= level 0)
+                (progn (setq gnus-tmp-dummy-line nil) t)
                 (or (not stack)
                     (= (car (car stack)) 0))
                 (not gnus-tmp-false-parent)
@@ -7091,10 +7108,9 @@ or a straight list of headers."
                             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 (mail-header-number
-                            (car (car (cdr (car thread))))))
+               ;; We remember that we probably want to output a dummy
+               ;; root.   
+               (setq gnus-tmp-dummy-line header)
                (setq gnus-tmp-prev-subject header))
               (t
                ;; We do not make a root for the gathered
@@ -7112,8 +7128,7 @@ or a straight list of headers."
            (setq new-roots (nconc new-roots (list (car thread)))
                  thread-end t
                  header nil))
-          ((and gnus-newsgroup-limit
-                (not (memq number gnus-newsgroup-limit)))
+          ((not (memq number gnus-newsgroup-limit))
            (setq gnus-tmp-gathered 
                  (nconc (mapcar
                          (lambda (h) (mail-header-number (car h)))
@@ -7140,6 +7155,13 @@ or a straight list of headers."
          (and
           header
           (progn
+            ;; We may have an old dummy line to output before this
+            ;; article.  
+            (when gnus-tmp-dummy-line
+              (gnus-summary-insert-dummy-line 
+               nil gnus-tmp-dummy-line header))
+
+            ;; Compute the mark.
             (setq 
              mark
              (cond 
@@ -7149,6 +7171,8 @@ or a straight list of headers."
               ((memq number gnus-newsgroup-expirable) gnus-expirable-mark)
               (t (or (cdr (assq number gnus-newsgroup-reads))
                      gnus-ancient-mark))))
+
+            ;; Actually insert the line.
             (inline
               (gnus-summary-insert-line
                nil header level nil mark
@@ -7186,7 +7210,8 @@ or a straight list of headers."
        (or threads (setq level 0)))))
   (message "Generating summary...done"))
 
-(defun gnus-summary-prepare-unthreaded (headers &optional cull)
+(defun gnus-summary-prepare-unthreaded (headers)
+  "Generate an unthreaded summary buffer based on HEADERS."
   (let (header number mark)
 
     (while headers
@@ -7195,10 +7220,7 @@ or a straight list of headers."
            number (mail-header-number header))
 
       ;; We may have to root out some bad articles...
-      (if (and gnus-newsgroup-limit
-              (not (memq number gnus-newsgroup-limit)))
-         ;; Don't print this article - it's not in the limit.
-         ()
+      (when (memq number gnus-newsgroup-limit)
        (setq mark
              (cond 
               ((memq number gnus-newsgroup-marked) gnus-ticked-mark)
@@ -7280,7 +7302,7 @@ If READ-ALL is non-nil, all articles in the group are selected."
             (mapcar (lambda (headers) (mail-header-number headers))
                     gnus-newsgroup-headers)))
       ;; Set the initial limit.
-      (setq gnus-newsgroup-limit (copy-sequence gnus-newsgroup-unreads))
+      (setq gnus-newsgroup-limit (copy-sequence articles))
       ;; Adjust and set lists of article marks.
       (and info
           (let (marked)
@@ -8007,12 +8029,10 @@ This is meant to be called in `gnus-article-internal-prepare-hook'."
        number)
     (if (not header)
        () ; We couldn't fetch ID.
-      ;; Add this article to the current limit.
-      (push (setq number (mail-header-number header)) gnus-newsgroup-limit)
       ;; Rebuild the thread that this article is part of and go to the
       ;; article we have fetched.
       (gnus-rebuild-thread (mail-header-id header))
-      (gnus-summary-goto-subject number)
+      (gnus-summary-goto-subject (setq number (mail-header-number header)))
       (and (> number 0)
           (progn
             ;; We have to update the boundaries, possibly.
@@ -8604,8 +8624,6 @@ Given a prefix, will force an `article' buffer configuration."
     (prog1
        (gnus-article-prepare article all-header)
       (gnus-summary-show-thread)
-      (if (eq (gnus-summary-article-mark) gnus-dummy-mark)
-         (gnus-summary-find-next))
       (run-hooks 'gnus-select-article-hook)
       (gnus-summary-recenter)
       (gnus-summary-goto-subject article)
@@ -8942,9 +8960,11 @@ If given a prefix, remove all limits."
   (interactive "P")
   (gnus-set-global-variables)
   (prog2
-      (if total (setq gnus-newsgroup-limits nil))
-      (gnus-summary-limit nil 'pop))
-  (gnus-summary-position-point))
+      (if total (setq gnus-newsgroup-limits 
+                     (list (mapcar (lambda (h) (mail-header-number h))
+                                   gnus-newsgroup-headers))))
+      (gnus-summary-limit nil 'pop)
+    (gnus-summary-position-point)))
 
 (defun gnus-summary-limit-to-subject (subject)
   "Limit the summary buffer to articles that have subjects that match a regexp."
@@ -8980,25 +9000,23 @@ If ALL is non-nil, limit strictly to unread articles."
 (make-obsolete 'gnus-summary-delete-marked-with 'gnus-summary-limit-to-marks)
 
 (defun gnus-summary-limit-to-marks (marks &optional reverse)
-  "Limit the summary buffer to articles that are not marked with MARKS (e.g. \"DK\").
-If REVERSE, limit the summary buffer to articles that are marked
+  "Limit the summary buffer to articles that are marked with MARKS (e.g. \"DK\").
+If REVERSE, limit the summary buffer to articles that are not marked
 with MARKS.  MARKS can either be a string of marks or a list of marks. 
 Returns how many articles were removed."
   (interactive "sMarks: ")
   (gnus-set-global-variables)
   (prog1
-      (if gnus-newsgroup-adaptive
-         (gnus-score-remove-lines-adaptive marks)
-       (let ((data gnus-newsgroup-data)
-             (marks (if (listp marks) marks
-                      (append marks nil))) ; Transform to list.
-             articles)
-         (while data
-           (and (if reverse (not (memq (gnus-data-mark (car data)) marks))
-                  (memq (gnus-data-mark (car data)) marks))
-                (setq articles (cons (gnus-data-number (car data)) articles)))
-           (setq data (cdr data)))
-         (gnus-summary-limit articles)))
+      (let ((data gnus-newsgroup-data)
+           (marks (if (listp marks) marks
+                    (append marks nil))) ; Transform to list.
+           articles)
+       (while data
+         (and (if reverse (not (memq (gnus-data-mark (car data)) marks))
+                (memq (gnus-data-mark (car data)) marks))
+              (setq articles (cons (gnus-data-number (car data)) articles)))
+         (setq data (cdr data)))
+       (gnus-summary-limit articles))
     (gnus-summary-position-point)))
 
 (defun gnus-summary-limit-to-score (&optional score)
@@ -9100,7 +9118,7 @@ fetch-old-headers verbiage, and so on."
   (if (and (null gnus-newsgroup-dormant)
           (not (eq gnus-fetch-old-headers 'some))
           (null gnus-summary-expunge-below))
-      ()                               ; Do nothing.
+      () ; Do nothing.
     (setq gnus-newsgroup-limits 
          (cons gnus-newsgroup-limit gnus-newsgroup-limits))
     (setq gnus-newsgroup-limit nil)
@@ -9112,6 +9130,8 @@ fetch-old-headers verbiage, and so on."
               (gnus-summary-limit-children (car nodes))
               (setq nodes (cdr nodes))))))
      gnus-newsgroup-dependencies)
+    (when (not gnus-newsgroup-limit)
+      (setq gnus-newsgroup-limit (pop gnus-newsgroup-limits)))
     gnus-newsgroup-limit))
 
 (defun gnus-summary-limit-children (thread)
@@ -9546,7 +9566,7 @@ and `request-accept' functions. (Ie. mail newsgroups at present.)"
                           (format "these %d articles" (length articles))
                         "this article")
                       (if gnus-current-move-group
-                          (format "(%s default) " gnus-current-move-group)
+                          (format "(default %s) " gnus-current-move-group)
                         ""))
               gnus-active-hashtb nil nil prefix)))
     (if to-newsgroup
@@ -9591,8 +9611,7 @@ and `request-accept' functions. (Ie. mail newsgroups at present.)"
                 (info (nth 2 entry))
                 (article (car articles)))
            (gnus-summary-goto-subject article)
-           (beginning-of-line)
-           (delete-region (point) (progn (forward-line 1) (point)))
+           (gnus-summary-mark-article article gnus-canceled-mark)
            ;; Update the group that has been moved to.
            (if (not info)
                ()                      ; This group does not exist yet.
@@ -9600,6 +9619,7 @@ and `request-accept' functions. (Ie. mail newsgroups at present.)"
                  (setcar (cdr (cdr info))
                          (gnus-add-to-range (nth 2 info) 
                                             (list (cdr art-group)))))
+
              ;; Copy any marks over to the new group.
              (let ((marks '((tick . gnus-newsgroup-marked)
                             (dormant . gnus-newsgroup-dormant)
@@ -9607,6 +9627,19 @@ and `request-accept' functions. (Ie. mail newsgroups at present.)"
                             (bookmark . gnus-newsgroup-bookmarks)
                             (reply . gnus-newsgroup-replied)))
                    (to-article (cdr art-group)))
+
+               ;; See whether the article is to be put in the cache.
+               (when gnus-use-cache
+                 (gnus-cache-possibly-enter-article 
+                  (car info) to-article
+                  (let ((header (copy-sequence
+                                 (gnus-summary-article-header article))))
+                    (mail-header-set-number to-article header)
+                    header)
+                  (memq article gnus-newsgroup-marked)
+                  (memq article gnus-newsgroup-dormant)
+                  (memq article gnus-newsgroup-unreads)))
+
                (while marks
                  (if (memq article (symbol-value (cdr (car marks))))
                      (gnus-add-marked-articles 
@@ -9683,7 +9716,7 @@ functions. (Ie. mail newsgroups at present.)"
                           (format "these %d articles" (length articles))
                         "this article")
                       (if gnus-current-move-group
-                          (format "(%s default) " gnus-current-move-group)
+                          (format "(default %s) " gnus-current-move-group)
                         ""))
               gnus-active-hashtb nil nil prefix)))
     (if to-newsgroup
@@ -9729,6 +9762,7 @@ functions. (Ie. mail newsgroups at present.)"
                  (setcar (cdr (cdr info))
                          (gnus-add-to-range (nth 2 info) 
                                             (list (cdr art-group)))))
+
              ;; Copy any marks over to the new group.
              (let ((marks '((tick . gnus-newsgroup-marked)
                             (dormant . gnus-newsgroup-dormant)
@@ -9736,11 +9770,24 @@ functions. (Ie. mail newsgroups at present.)"
                             (bookmark . gnus-newsgroup-bookmarks)
                             (reply . gnus-newsgroup-replied)))
                    (to-article (cdr art-group)))
-               (while marks
-                 (if (memq article (symbol-value (cdr (car marks))))
-                     (gnus-add-marked-articles 
-                      (car info) (car (car marks)) (list to-article) info))
-                 (setq marks (cdr marks))))))
+
+             ;; See whether the article is to be put in the cache.
+             (when gnus-use-cache
+               (gnus-cache-possibly-enter-article 
+                (car info) to-article 
+                (let ((header (copy-sequence
+                               (gnus-summary-article-header article))))
+                  (mail-header-set-number to-article header)
+                  header)
+                (memq article gnus-newsgroup-marked)
+                (memq article gnus-newsgroup-dormant)
+                (memq article gnus-newsgroup-unreads)))
+
+             (while marks
+               (if (memq article (symbol-value (cdr (car marks))))
+                   (gnus-add-marked-articles 
+                    (car info) (car (car marks)) (list to-article) info))
+               (setq marks (cdr marks))))))
        (gnus-message 1 "Couldn't copy article %s" (car articles)))
       (gnus-summary-remove-process-mark (car articles))
       (setq articles (cdr articles)))
@@ -9821,7 +9868,7 @@ deleted forever, right now."
 (defun gnus-summary-delete-article (&optional n)
   "Delete the N next (mail) articles.
 This command actually deletes articles. This is not a marking
-command. The article will disappear forever from you life, never to
+command. The article will disappear forever from your life, never to
 return. 
 If N is negative, delete backwards.
 If N is nil and articles have been marked with the process mark,
@@ -9936,8 +9983,6 @@ groups."
   ;; Skip dummy header line.
   (save-excursion
     (gnus-summary-show-thread)
-    (if (eq (gnus-summary-article-mark) gnus-dummy-mark)
-       (gnus-summary-find-next))
     (let ((buffer-read-only nil))
       ;; Set score.
       (gnus-summary-update-mark
@@ -10189,8 +10234,6 @@ the actual number of articles marked is returned."
     (if (gnus-summary-goto-subject article)
        (progn
          (gnus-summary-show-thread)
-         (and (eq (gnus-summary-article-mark) gnus-dummy-mark)
-              (gnus-summary-find-next))
          (gnus-summary-update-mark gnus-process-mark 'replied)
          t))))
 
@@ -10201,8 +10244,6 @@ the actual number of articles marked is returned."
     (if (gnus-summary-goto-subject article)
        (progn
          (gnus-summary-show-thread)
-         (and (eq (gnus-summary-article-mark) gnus-dummy-mark)
-              (gnus-summary-find-next))
          (gnus-summary-update-mark ?  'replied)
          (if (memq article gnus-newsgroup-replied) 
              (gnus-summary-update-mark gnus-replied-mark 'replied))
@@ -10253,8 +10294,6 @@ returned."
           (setq mark gnus-expirable-mark)
           (setq gnus-newsgroup-expirable 
                 (cons article gnus-newsgroup-expirable))))
-    (while (eq (gnus-summary-article-mark) gnus-dummy-mark)
-      (gnus-summary-find-next))
     ;; Fix the mark.
     (gnus-summary-update-mark mark 'unread)
     t))
@@ -10285,8 +10324,6 @@ returned."
            (= mark gnus-ticked-mark)
            (= mark gnus-dormant-mark) (= mark gnus-unread-mark))))
 
-    (while (eq (gnus-summary-article-mark) gnus-dummy-mark)
-      (gnus-summary-find-next))
     ;; Fix the mark.
     (gnus-summary-update-mark mark 'unread)
     t))
@@ -10332,8 +10369,6 @@ marked."
     (if (gnus-summary-goto-subject article)
        (let ((buffer-read-only nil))
          (gnus-summary-show-thread)
-         (and (eq (gnus-summary-article-mark) gnus-dummy-mark)
-              (gnus-summary-find-next))
          ;; Fix the mark.
          (gnus-summary-update-mark mark 'unread)
          t))))
@@ -11305,6 +11340,7 @@ is initialized from the SAVEDIR environment variable."
        (while pslist
          (gnus-summary-goto-subject (or (cdr (assq 'article (car pslist)))
                                         (gnus-summary-article-number)))
+         (beginning-of-line)
          (setq b (point))
          (put-text-property
           (point)
@@ -11620,41 +11656,41 @@ The following commands are available:
        ;; We have found the header.
        header
       ;; We have to really fetch the header to this article.
-      (if (setq where
-               (if (gnus-check-backend-function 'request-head group)
-                   (gnus-request-head id group)
-                 (gnus-request-article id group)))
-         (save-excursion
-           (set-buffer nntp-server-buffer)
-           (and (search-forward "\n\n" nil t)
-                (delete-region (1- (point)) (point-max)))
-           (goto-char (point-max))
-           (insert ".\n")
-           (goto-char (point-min))
-           (insert "211 "
-                   (int-to-string
-                    (cond
-                     ((numberp id)
-                      id)
-                     ((cdr where)
-                      (cdr where))
-                     (t
-                      gnus-reffed-article-number)))
-                   " Article retrieved.\n")
-           (if (not (setq header (car (gnus-get-newsgroup-headers))))
-               () ; Malformed head.
-             (if (and (stringp id)
-                      (not (string= (gnus-group-real-name group)
-                                    (car where))))
-                 ;; If we fetched by Message-ID and the article came
-                 ;; from a different group, we fudge some bogus article
-                 ;; numbers for this article.
-                 (mail-header-set-number header gnus-reffed-article-number))
-             (setq gnus-reffed-article-number (1- gnus-reffed-article-number))
-             (setq gnus-newsgroup-headers
-                   (cons header gnus-newsgroup-headers))
-             (setq gnus-current-headers header)
-             header))))))
+      (when (setq where
+                 (if (gnus-check-backend-function 'request-head group)
+                     (gnus-request-head id group)
+                   (gnus-request-article id group)))
+       (save-excursion
+         (set-buffer nntp-server-buffer)
+         (and (search-forward "\n\n" nil t)
+              (delete-region (1- (point)) (point-max)))
+         (goto-char (point-max))
+         (insert ".\n")
+         (goto-char (point-min))
+         (insert "211 "
+                 (int-to-string
+                  (cond
+                   ((numberp id)
+                    id)
+                   ((cdr where)
+                    (cdr where))
+                   (t
+                    gnus-reffed-article-number)))
+                 " Article retrieved.\n"))
+       (if (not (setq header (car (gnus-get-newsgroup-headers))))
+           () ; Malformed head.
+         (if (and (stringp id)
+                  (not (string= (gnus-group-real-name group)
+                                (car where))))
+             ;; If we fetched by Message-ID and the article came
+             ;; from a different group, we fudge some bogus article
+             ;; numbers for this article.
+             (mail-header-set-number header gnus-reffed-article-number))
+         (decf gnus-reffed-article-number)
+         (push header gnus-newsgroup-headers)
+         (setq gnus-current-headers header)
+         (push (mail-header-number header) gnus-newsgroup-limit)
+         header)))))
 
 (defun gnus-article-prepare (article &optional all-headers header)
   "Prepare ARTICLE in article mode buffer.
index 5b7703b..d366fac 100644 (file)
@@ -426,18 +426,15 @@ such things as moving mail.  All buffers always get killed upon server close.")
       t)))
 
 (defun nnfolder-request-delete-group (group &optional force server)
-  (nnfolder-possibly-change-group group)
+  (nnfolder-close-group group server t)
   ;; Delete all articles in GROUP.
   (if (not force)
       ()                               ; Don't delete the articles.
-    ;; Delete the file that holds the group and kill the buffer as
-    ;; well.  
-    (save-excursion
-      (and (set-buffer nnfolder-current-buffer)
-          (progn
-            (and (file-writable-p buffer-file-name)
-                 (delete-file buffer-file-name))
-            (kill-buffer (current-buffer))))))
+    ;; Delete the file that holds the group.
+    (condition-case nil
+       (delete-file (concat (file-name-as-directory nnfolder-directory)
+                            group))
+      (error nil)))
   ;; Remove the group from all structures.
   (setq nnfolder-group-alist 
        (delq (assoc group nnfolder-group-alist) nnfolder-group-alist)
index 1229925..a801778 100644 (file)
             (format 
              "%s %d %d y\n" 
              (progn
-               (string-match (file-name-as-directory 
-                              (expand-file-name nnmh-directory)) dir)
+               (string-match 
+                (file-truename (file-name-as-directory 
+                                (expand-file-name nnmh-directory))) dir)
                (nnmail-replace-chars-in-string
                 (substring dir (match-end 0)) ?/ ?.))
              (apply (function max) files) 
index ba9cdbd..205036e 100644 (file)
@@ -1,3 +1,7 @@
+Sat Oct 14 13:23:19 1995  Lars Ingebrigtsen  <lars@eyesore.no>
+
+       * gnus.texi (Posting Styles): New.
+
 Fri Oct 13 02:20:18 1995  Lars Ingebrigtsen  <lars@eyesore.no>
 
        * gnus.texi (Post): Fix.
index 9c9c64e..ede4adc 100644 (file)
@@ -370,9 +370,9 @@ Ricardo Nassif did the proof-reading.
 @item
 Kevin Davidson came up with the name @dfn{ding}, so blame him.
 @item 
-Stainless Steel Rat, Ulrik Dickow, Jack Vinson, Daniel Quinlan, Frank
-D. Cringle, Geoffrey T. Dairiki and Andrew Eskilsson have all
-contributed code and suggestions.
+Peter Arius, Stainless Steel Rat, Ulrik Dickow, Jack Vinson, Daniel
+Quinlan, Frank D. Cringle, Geoffrey T. Dairiki and Andrew Eskilsson have
+all contributed code and suggestions.
 @end itemize
 
 
@@ -3628,6 +3628,7 @@ server.
 * Mail::                 Mailing & replying.
 * Post::                 Posting and following up.
 * Mail & Post::          Mailing and posting at the same time.
+* Posting Styles::       An easier way to configure some key elements.
 * Drafts::               Postponing messages and rejected messages.
 * Rejected Articles::    What happens if the server doesn't like your article?
 @end menu
@@ -4237,6 +4238,82 @@ without doing any actual encoding, you could add
 @code{gnus-inews-insert-mime-headers} to @code{gnus-inews-article-hook}.
 
 
+@node Posting Styles
+@subsection Posting Styles
+@cindex posting styles
+@cindex styles
+
+All them variables, they make my head swim.  
+
+So what if you want a different @code{Organization} and signature based
+on what groups you post to?  And you post both from your home machine
+and your work machine, and you want different @code{From} lines, and so
+on? 
+
+@vindex gnus-posting-styles
+One way to do stuff like that is to write clever hooks that change the
+variables you need to have changed.  That's a bit boring, so somebody
+came up with the bright idea of letting the user specify these things in
+a handy alist.  Here's an example of a @code{gnus-posting-styles}
+variable: 
+
+@lisp
+((".*" (signature . "Peace and happiness") (organization . "What me?"))
+ ("^comp" (signature . "Death to everybody"))
+ ("comp.emacs.i-love-it" (organization . "Emacs is it")))
+@end lisp
+
+As you might surmise from this example, this alist consists of several
+@dfn{styles}.  Each style will be applicable if the first element
+"matches", in some form or other.  The entire alist will be iterated
+over, from the beginning towards the end, and each match will be
+applied, which means that attributes in later styles that match override
+the same attributes in earlier matching styles.  So
+@samp{comp.programming.literate} will have the @samp{Death to everybody}
+signature and the @samp{What me?} @code{Organization} header. 
+
+The first element in each style is called the @code{match}.  If it's a
+string, then Gnus will try to regexp match it against the group name.
+If it's a function symbol, that function will be called with no
+arguments.  If it's a variable symbol, then the variable will be
+referenced.  If it's a list, then that list will be @code{eval}ed.  In
+any case, if this returns a non-@code{nil} value, then the style is said
+to @dfn{match}.
+
+Each style may contain a random amount of @dfn{attributes}.  Each
+attribute consists of a @var{(name  . value)} pair.  The attribute name
+can be one of @code{signature}, @code{organization} or @code{from}.  
+The attribute name can also be a string.  In that case, this will be
+used as a header name, and the value will be inserted in the headers of
+the article. 
+
+The attribute value can be a string (used verbatim), a function (the
+return value will be used), a variable (its value will be used) or a
+list (it will be @code{eval}ed and the return value will be used).
+
+So here's a new example:
+
+@lisp
+(setq gnus-posting-styles
+      '((".*" 
+           (signature . "~/.signature") 
+           (from . "user@@foo (user)")
+           ("X-Home-Page" . (getenv "WWW_HOME"))
+           (organization . "People's Front Against MWM"))
+        ("^rec.humor" 
+           (signature . my-funny-signature-randomizer))
+        ((equal (system-name) "gnarly") 
+           (signature . my-quote-randomizer))
+        (posting-from-work-p
+           (signature . "~/.work-signature")
+           (from . "user@@bar.foo (user)")
+           (organization . "Important Work, Inc"))
+        ("^nn.+:" 
+           (signature . "~/.mail-signature"))))
+@end lisp
+
+
+
 @node Drafts
 @subsection Drafts
 @cindex drafts
@@ -7371,6 +7448,13 @@ articles that have that mark (i.e., are marked with @samp{D}) will have a
 score entry added to lower based on the @code{From} header by -4, and
 lowered by @code{Subject} by -1.  Change this to fit your prejudices. 
 
+The headers you can score on are @code{from}, @code{subject},
+@code{message-id}, @code{references}, @code{xref}, @code{lines},
+@code{chars} and @code{date}.  In addition, you can score on
+@code{followup}, which will create an adaptive score entry that matches
+on the @code{References} header using the @code{Message-ID} of the
+current article, thereby matching the following thread.
+
 If you use this scheme, you should set @code{mark-below} to something
 small---like -300, perhaps, to avoid having small random changes result
 in articles getting marked as read.