*** empty log message ***
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 4 Mar 1997 02:34:57 +0000 (02:34 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 4 Mar 1997 02:34:57 +0000 (02:34 +0000)
lisp/ChangeLog
lisp/gnus-cache.el
lisp/gnus-ems.el
lisp/gnus-msg.el
lisp/gnus-score.el
lisp/gnus.el
lisp/nndigest.el [new file with mode: 0644]
texi/gnus.texi

index 9c8eaf2..f20803b 100644 (file)
@@ -1,5 +1,35 @@
+Sat Jun 24 14:11:58 1995  Lars Magne Ingebrigtsen  <lingebri@sunscipw.cern.ch>
+
+       * gnus.el (gnus-bug): Use gnus-mail-send-and-exit. 
+       (gnus-summary-line-format-alist): Int instead of char with %e.
+       (gnus-format-max-width): Mule defefinition.
+
+Sat Jun 24 13:14:40 1995  Lars INGEBRIGTSEN UiO  <lingebri@sunsci4.cern.ch>
+
+       * gnus.el (gnus-subject-eq): New function.
+       (gnus-summary-search-subject): Use it.
+
+       * gnus-msg.el (gnus-cancel-news): Use previous distribution, if
+       any. 
+
+       * gnus.el (gnus-summary-next-group): Tried exiting while in the
+       group buffer. 
+
+Sat Jun 24 10:35:33 1995  Lars INGEBRIGTSEN UiO  <lingebri@sunscipw.cern.ch>
+
+       * gnus.el (gnus-article-date-ut): Slap a condition-case on the
+       timezone functions.
+       (gnus-summary-mode-hook): Doc fix.
+       (gnus-group-get-new-news): Update native and secondary groups of
+       the proper levels if levels are wanted. 
+
+       * gnus-msg.el (gnus-inews-insert-signature): Checked whether
+       `gnus-signature-function' was a function.
+
 Sat Jun 17 02:38:33 1995  Lars Ingebrigtsen  <lars@eyesore.no>
 
+       * gnus.el: 0.87 is released.
+
        * nnkiboze.el (nnkiboze-close-group): Don't bug out on missing nov
        files. 
 
index 85c938e..6a6dbe9 100644 (file)
                          (or (header-xref headers) ""))))
        t))))
 
-(defvar gnus-cache-remove-articles nil)
+(defvar gnus-cache-removeable-articles nil)
 
 (defun gnus-cache-enter-remove-article (article)
-  (setq gnus-cache-remove-articles
-       (cons article gnus-cache-remove-articles)))
+  (setq gnus-cache-removeable-articles
+       (cons article gnus-cache-removeable-articles)))
 
 (defun gnus-cache-possibly-remove-articles ()
-  (let ((articles gnus-cache-remove-articles)
+  (let ((articles gnus-cache-removeable-articles)
        article)
     (while articles
       (setq article (car articles)
index 62b1e2a..faa7dc7 100644 (file)
     )
    ((boundp 'MULE)
     ;; Mule definitions
-    (defun top-short-string (str width)
-      "Return a substring of STRING, starting at top and its length is
-equal or smaller than WIDTH. This function doesn't split in the middle
-of multi-octet character. [tl-str]"
-      (substring str 0
-                (let ((i 0) (w 0) chr (len (length str)))
-                  (catch 'label
-                    (while (< i len)
-                      (setq chr (elt str i))
-                      (setq w (+ w (char-width chr)))
-                      (if (> w width)
-                          (throw 'label i))
-                      (setq i (+ i (char-bytes chr)))
-                      )
-                    i))
-                ))
-    
+    (if (not (fboundp 'truncate-string))
+       (defun truncate-string (str width)
+         (let ((w (string-width str))
+               (col 0) (idx 0) (p-idx 0) chr)
+           (if (<= w width)
+               str
+             (while (< col width)
+               (setq chr (aref str idx)
+                     col (+ col (char-width chr))
+                     p-idx idx
+                     idx (+ idx (char-bytes chr))
+                     ))
+             (substring str 0 (if (= col width)
+                                  idx
+                                p-idx))
+             )))
+      )
+    (defalias 'gnus-truncate-string 'truncate-string)
+
     (defun gnus-format-max-width (form length)
       (let* ((val (eval form))
             (valstr (if (numberp val) (int-to-string val) val)))
        (if (> (length valstr) length)
-           (top-short-string valstr length)
+           (truncate-string valstr length)
          valstr)))
-    
+
     (defun gnus-summary-make-display-table ())
     )
    ))
index cfc953a..37c1574 100644 (file)
@@ -877,6 +877,9 @@ will attempt to use the foreign server to post the article."
            (insert "Newsgroups: " newsgroups "\n"
                    "Subject: cancel " message-id "\n"
                    "Control: cancel " message-id "\n"
+                   (if distribution
+                       (concat "Distribution: " distribution "\n")
+                     "")
                    mail-header-separator "\n"
                    "This is a cancel message from " from ".\n")
            ;; Send the control article to NNTP server.
@@ -1067,7 +1070,6 @@ nil."
   (save-excursion
     (let ((signature 
           (or (and gnus-signature-function
-                   (fboundp gnus-signature-function)
                    (funcall gnus-signature-function gnus-newsgroup-name))
               gnus-signature-file))
          b)
index dfcb63a..d0f8635 100644 (file)
@@ -492,7 +492,7 @@ SCORE is the score to add."
   (let ((winconf (current-window-configuration)))
     (and (buffer-name gnus-summary-buffer) (gnus-score-save))
     (setq gnus-score-edit-buffer (find-file-noselect file))
-    (gnus-configure-windows 'summary-edit-score)
+    (gnus-configure-windows 'edit-score)
     (gnus-score-mode)
     (make-local-variable 'gnus-prev-winconf)
     (setq gnus-prev-winconf winconf))
@@ -507,7 +507,7 @@ SCORE is the score to add."
   (and (buffer-name gnus-summary-buffer) (gnus-score-save))
   (let ((winconf (current-window-configuration)))
     (setq gnus-score-edit-buffer (find-file-noselect file))
-    (gnus-configure-windows 'summary-edit-score)
+    (gnus-configure-windows 'edit-score)
     (gnus-score-mode)
     (make-local-variable 'gnus-prev-winconf)
     (setq gnus-prev-winconf winconf))
index 55aead3..65e5d2b 100644 (file)
@@ -687,8 +687,8 @@ beginning of a line.")
                 [edit-group 1.0 point]))
     (edit-server ([server 0.5]
                  [edit-server 1.0 point]))
-    (summary-edit-score ([summary 0.25]
-                        [edit-score 1.0 point]))
+    (edit-score ([summary 0.25]
+                [edit-score 1.0 point]))
     (post ([post 1.0 point]))
     (reply ([article 0.5]
            [mail 1.0 point]))
@@ -725,7 +725,7 @@ buffer configuration.")
     (summary-carpal . gnus-carpal-summary-buffer)
     (server-carpal . gnus-carpal-server-buffer)
     (browse-carpal . gnus-carpal-browse-buffer)
-    (summary-edit-score . gnus-score-edit-buffer)
+    (edit-score . gnus-score-edit-buffer)
     (mail . gnus-mail-buffer)
     (post . gnus-post-news-buffer))
   "Mapping from short symbols to buffer names or buffer variables.")
@@ -1035,7 +1035,8 @@ which to perform auto-expiry.  This only makes sense for mail groups.")
   "*A hook for Gnus group mode.")
 
 (defvar gnus-summary-mode-hook nil
-  "*A hook for Gnus summary mode.")
+  "*A hook for Gnus summary mode.
+This hook is run before any variables are set in the summary buffer.")
 
 (defvar gnus-article-mode-hook nil
   "*A hook for Gnus article mode.")
@@ -1257,7 +1258,7 @@ automatically when it is selected.")
                   (or gnus-tmp-adopt-thread 
                       (if (boundp 'thread) (symbol-value 'thread)
                         thread nil)) t)
-                  ?d)
+                  ?c)
        (list ?u 'user-defined ?s))
   "An alist of format specifications that can appear in summary lines,
 and what variables they correspond with, along with the type of the
@@ -1290,7 +1291,7 @@ variable (string, integer, character, etc).")
 (defconst gnus-maintainer "gnus-bug@ifi.uio.no (The Gnus Bugfixing Girls & Boys)"
   "The mail address of the Gnus maintainers.")
 
-(defconst gnus-version "(ding) Gnus v0.87"
+(defconst gnus-version "(ding) Gnus v0.88"
   "Version number for this version of Gnus.")
 
 (defvar gnus-info-nodes
@@ -1705,6 +1706,13 @@ Thank you for your help in stamping out bugs.
 (defsubst gnus-buffer-substring (beg end)
   (buffer-substring (match-beginning beg) (match-end end)))
 
+;; modified by MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;;   function `substring' might cut on a middle of multi-octet
+;;   character.
+
+(defun gnus-truncate-string (str width)
+  (substring str width))
+
 (defsubst gnus-simplify-subject-re (subject)
   "Remove \"Re:\" from subject lines."
   (let ((case-fold-search t))
@@ -2520,6 +2528,8 @@ If optional argument RE-ONLY is non-nil, strip `Re:' only."
     (mail-setup gnus-maintainer nil nil nil nil nil)
     (make-local-variable 'gnus-prev-winconf)
     (setq gnus-prev-winconf winconf)
+    (use-local-map (copy-keymap mail-mode-map))
+    (local-set-key "\C-c\C-c" 'gnus-mail-send-and-exit)
     (goto-char (point-min))
     (re-search-forward (concat "^" (regexp-quote mail-header-separator) "$"))
     (forward-line 1)
@@ -4352,19 +4362,17 @@ N and the number of steps taken is returned."
 The killed newsgroups can be yanked by using \\[gnus-group-yank-group]."
   (interactive "r")
   (let ((lines
-        ;; Exclude a line where current point is on.
-        (1-
-         ;; Count lines.
-         (save-excursion
-           (count-lines
-            (progn
-              (goto-char begin)
-              (beginning-of-line)
-              (point))
-            (progn
-              (goto-char end)
-              (end-of-line)
-              (point)))))))
+        ;; Count lines.
+        (save-excursion
+          (count-lines
+           (progn
+             (goto-char begin)
+             (beginning-of-line)
+             (point))
+           (progn
+             (goto-char end)
+             (beginning-of-line)
+             (point))))))
     (goto-char begin)
     (beginning-of-line)                        ;Important when LINES < 1
     (gnus-group-kill-group lines)))
@@ -4464,7 +4472,8 @@ specify which levels you are interested in re-scanning."
        (progn
          (gnus-read-active-file)
          (gnus-get-unread-articles (or level (1+ gnus-level-subscribed))))
-      (let ((gnus-read-active-file nil))
+      (let ((gnus-read-active-file nil)
+           (gnus-have-read-active-file nil))
        (gnus-get-unread-articles (or level (1+ gnus-level-subscribed)))))
     (gnus-group-list-groups (or (and gnus-group-use-permanent-levels level)
                                gnus-group-default-list-level
@@ -6472,8 +6481,11 @@ If WHERE is `summary', the summary mode line format will be used."
                (setq max-len (length mode-string)))
            (if (< max-len 4) (setq max-len 4))
            (if (> (length mode-string) max-len)
+               ;; modified by MORIOKA Tomohiko <morioka@jaist.ac.jp>
+               ;;  function `substring' might cut on a middle
+               ;;  of multi-octet character.
                (setq mode-string 
-                     (concat (substring mode-string 0 (- max-len 3))
+                     (concat (gnus-truncate-string mode-string (- max-len 3))
                              "...")))
            (setq mode-string (format (format "%%-%ds" max-len)
                                      mode-string))))
@@ -7017,9 +7029,7 @@ searched for."
                               gnus-unread-mark))
                       (or (not subject)
                           (and (setq psubject (gnus-summary-subject-string))
-                               (equal (gnus-simplify-subject-re subject)
-                                      (gnus-simplify-subject-re
-                                       psubject)))))))
+                               (gnus-subject-eq subject psubject))))))
           (if backward (if (bobp) nil (forward-char -1) t)
             (if (eobp) nil (forward-char 1) t)))))
     (if did
@@ -7028,6 +7038,20 @@ searched for."
          (get-text-property (point) 'gnus-number)
        (gnus-summary-position-cursor)))))
 
+(defun gnus-subject-eq (s1 s2)
+  (cond
+   ((null gnus-summary-gather-subject-limit)
+    (equal (gnus-simplify-subject-re s1)
+          (gnus-simplify-subject-re s2)))
+   ((eq gnus-summary-gather-subject-limit 'fuzzy)
+    (equal (gnus-simplify-subject-fuzzy s1)
+          (gnus-simplify-subject-fuzzy s2)))
+   ((numberp gnus-summary-gather-subject-limit)
+    (equal (substring s1 gnus-summary-gather-subject-limit)
+          (substring s2 gnus-summary-gather-subject-limit)))
+   (t
+    (equal s1 s2))))
+    
 (defun gnus-summary-search-forward (&optional unread subject backward)
   "Search for article forward.
 If UNREAD is non-nil, only unread articles are selected.
@@ -7411,10 +7435,12 @@ If BACKWARD, go to previous group instead."
     (gnus-summary-search-group backward)
     (let ((group (or group (gnus-summary-search-group backward)))
          (buf gnus-summary-buffer))
+      (set-buffer sumbuf)
       (gnus-summary-exit t)            ;Update all information.
       (if (null group)
          (gnus-summary-exit-no-update t)
        (gnus-message 5 "Selecting %s..." group)
+       (set-buffer gnus-group-buffer)
        ;; We are now in group mode buffer.
        ;; Make sure group mode buffer point is on GROUP.
        (gnus-group-jump-to-group group)
@@ -10414,19 +10440,30 @@ how much time has lapsed since DATE."
          (insert
           (cond 
            ((eq type 'local)
-            (concat "Date: " (timezone-make-date-arpa-standard date) "\n"))
+            (concat "Date: " (condition-case ()
+                                 (timezone-make-date-arpa-standard date)
+                               (error date))
+                    "\n"))
            ((eq type 'ut)
-            (concat "Date: " (timezone-make-date-arpa-standard date nil "UT")
+            (concat "Date: "
+                    (condition-case ()
+                        (timezone-make-date-arpa-standard date nil "UT")
+                      (error date))
                     "\n"))
            ((eq type 'lapsed)
-            (let* ((sec (max (- (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")))
-                             0))
+            ;; If the date is seriously mangled, the timezone
+            ;; functions are liable to bug out, so we condition-case
+            ;; the entire thing.  
+            (let* ((sec (condition-case ()
+                            (max (- (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")))
+                                 0)
+                          (error 0)))
                    num prev)
               (concat
                "X-Sent: "
@@ -13276,7 +13313,7 @@ The list is determined from the variable gnus-score-file-alist."
               ;; and used to simplify regexps in the single-alist 
               (progn
                 (setq score-files
-                      (nconc score-files (cdr (car alist))))
+                      (append score-files (cdr (car alist))))
                 (throw 'done nil)))
          (setq alist (cdr alist))))
       ;; cache the score files
@@ -13292,7 +13329,8 @@ The list is determined from the variable gnus-score-file-alist."
         (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))
+    (setq score-files (copy-sequence
+                      (gnus-score-find-alist gnus-newsgroup-name)))
     (while func
       (and (symbolp (car func))
           (fboundp (car func))
diff --git a/lisp/nndigest.el b/lisp/nndigest.el
new file mode 100644 (file)
index 0000000..a77b391
--- /dev/null
@@ -0,0 +1,206 @@
+;;; nndigest.el --- digest access for Gnus
+;; Copyright (C) 1995 Free Software Foundation, Inc.
+
+;; Author: Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
+;; Keywords: news
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to
+;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'nnheader)
+
+\f
+
+(defconst nndigest-version "nndigest 0.0"
+  "nndigest version.")
+
+(defvar nndigest-current-buffer nil
+  "Current digest "group" buffer.")
+
+(defvar nndigest-status-string "")
+
+(defvar nndigest-group-alist nil)
+
+(defconst nndigest-separator "------------------------------[\n \t]*\n[^ ]+: ")
+
+\f
+
+;;; Interface functions.
+
+(defun nndigest-retrieve-headers (sequence &optional newsgroup server)
+  "Retrieve the headers for the articles in SEQUENCE.
+Newsgroup must be selected before calling this function."
+  (save-excursion
+    (set-buffer nntp-server-buffer)
+    (erase-buffer)
+    (let ((file nil)
+         (number (length sequence))
+         (count 0)
+         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 1)
+      (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
+       (replace-match " " t t))
+      'headers)))
+
+(defun nndigest-open-server (host &optional service)
+  "Open news server on HOST."
+  (setq nndigest-status-string "")
+  (nnheader-init-server-buffer))
+
+(defun nndigest-close-server (&optional server)
+  "Close news server."
+  t)
+
+(defun nndigest-server-opened (&optional server)
+  "Return server process status, T or NIL."
+  (and nntp-server-buffer
+       (get-buffer nntp-server-buffer)))
+
+(defun nndigest-status-message ()
+  "Return server status response as string."
+  nndigest-status-string)
+
+(defun nndigest-request-article (id &optional newsgroup server buffer)
+  "Select article by message ID (or number)."
+  (nndigest-possibly-change-buffer newsgroup)
+  (let ((range (nndigest-narrow-to-article id)))
+    (and range
+        (save-excursion
+          (set-buffer (or buffer nntp-server-buffer))
+          (erase-buffer)
+          (insert-buffer-substring 
+           nndigest-current-buffer (car range) (cdr range))
+          t))))
+
+(defun nndigest-request-group (group &optional server dont-check)
+  "Select news GROUP."
+  (let ((entry (assoc group nndigest-group-alist)))
+    (and entry (setq nndigest-group-alist (delq entry nndigest-group-alist))))
+  (let ((buffer (get-buffer-create (concat " *nndigest " group "*"))))
+    (setq nndigest-group-alist 
+         (cons (cons group buffer) nndigest-group-alist))
+    (save-excursion
+      (set-buffer buffer)
+      (erase-buffer)
+      (insert-buffer-substring server)))
+  (nndigest-possibly-change-buffer group)
+  (let ((num 0))
+    (save-excursion
+      (set-buffer nndigest-current-buffer)
+      (widen)
+      (goto-char (point-min))
+      (while (re-search-forward nndigest-separator nil t)
+       (setq num (1+ num)))
+      (set-buffer nntp-server-buffer)
+      (erase-buffer)
+      (insert (format "211 %d %d %d %s\n" num 1 num group))
+      t)))
+
+(defun nndigest-close-group (group &optional server)
+  (nndigest-possibly-change-buffer group)
+  (kill-buffer nndigest-current-buffer)
+  (setq nndigest-group-alist (delq (assoc group nndigest-group-alist)
+                                  nndigest-group-alist))
+  (setq nndigest-current-buffer nil)
+  t)
+
+(defun nndigest-request-list (&optional server)
+  "List active newsgoups."
+  (save-excursion
+    (set-buffer nntp-server-buffer)
+    (erase-buffer)
+    t))
+
+(defun nndigest-request-newgroups (date &optional server)
+  "List groups created after DATE."
+  (save-excursion
+    (set-buffer nntp-server-buffer)
+    (erase-buffer)
+    t))
+
+(defun nndigest-request-list-newsgroups (&optional server)
+  "List newsgroups (defined in NNTP2)."
+  (save-excursion
+    (set-buffer nntp-server-buffer)
+    (erase-buffer)
+    t))
+
+(defun nndigest-request-post (&optional server)
+  "Post a new news in current buffer."
+  (mail-send-and-exit nil))
+
+(fset 'nndigest-request-post-buffer 'nnmail-request-post-buffer)
+
+\f
+
+;;; Internal functions
+
+(defun nndigest-possibly-change-buffer (group)
+  (and group
+       (not (equal (cdr (assoc group nndigest-group-alist)) 
+                  nndigest-current-buffer))
+       (setq nndigest-current-buffer 
+            (cdr (assoc group nndigest-group-alist)))))
+
+(defun nndigest-narrow-to-article (article) 
+  (save-excursion
+    (set-buffer nndigest-current-buffer)
+    (widen)
+    (goto-char (point-min))
+    (while (and (not (zerop article))
+               (re-search-forward nndigest-separator nil t))
+      (setq article (1- article)))
+    (if (zerop article)
+       (progn
+         (goto-char (match-end 0))
+         (beginning-of-line)
+         (narrow-to-region 
+          (point)
+          (or (and (re-search-forward nndigest-separator nil t)
+                   (match-beginning 0))
+              (point-max)))
+         (cons (point-min) (point-max)))
+      nil)))
+      
+
+(provide 'nndigest)
+
+;;; nndigest.el ends here
index 557f243..96cb4a5 100644 (file)
@@ -6328,7 +6328,7 @@ Here's a list of all possible keys:
 @code{browse}, @code{group-mail}, @code{summary-mail},
 @code{summary-reply}, @code{info}, @code{summary-faq},
 @code{edit-group}, @code{edit-server}, @code{reply}, @code{reply-yank},
-@code{followup}, @code{followup-yank}.  
+@code{followup}, @code{followup-yank}, @code{edit-score}.  
 
 @findex gnus-add-configuration
 Since this variable is so long and complicated, there's a function you