From: yamaoka Date: Mon, 23 Jul 2001 02:16:31 +0000 (+0000) Subject: Synch with Oort Gnus. X-Git-Tag: t-gnus-6_15_4-04-quimby-last-~20 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd3b61f27179f8612e5bb4ddaa0c977fcd5807f6;p=elisp%2Fgnus.git- Synch with Oort Gnus. * gnus-delay.el (gnus-delay-initialize): Don't use the macro `kbd'. * nnheader.el (mm-read-coding-system): New function which is a substitute for mm-util.el. --- diff --git a/ChangeLog b/ChangeLog index a5e8fd5..5eefb0e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2001-07-23 Katsumi Yamaoka + + * lisp/gnus-delay.el (gnus-delay-initialize): Don't use the macro + `kbd'. + + * lisp/nnheader.el (mm-read-coding-system): New function which is + a substitute for mm-util.el. + 2001-07-19 Katsumi Yamaoka * lisp/gnus-vers.el (gnus-revision-number): Increment to 04. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d575ef8..9a16f30 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,62 @@ +2001-07-22 09:00:00 ShengHuo ZHU + + * gnus-msg.el (gnus-setup-message): make-local-hook. + +2001-07-22 Kai Gro,A_(Bjohann + + * gnus-delay.el (gnus-delay-article): Fix `read-string' for + XEmacs. Allow more units. Submitted by Karl Kleinpaste + , slightly changed by Kai. + + * message.el (message-check-news-header-syntax): When checking + whether the groups exist, check the right server based on + `gnus-post-method'. + +2001-07-21 Kai Gro,A_(Bjohann + + * gnus-delay.el: New file. + +2001-07-21 13:00:00 ShengHuo ZHU + + * mm-util.el (mm-read-coding-system): Take two arguments. + + * gnus-sum.el (gnus-summary-show-article): Use + mm-read-coding-system. + + * gnus-art.el (article-de-quoted-unreadable): + (article-de-base64-unreadable, article-wash-html): + (gnus-mime-inline-part, gnus-mime-view-part-as-charset): Ditto. + +2001-07-21 Kai Gro,A_(Bjohann + + * nnml.el (nnml-request-post): New function. Can be used for + annotations in nnml groups. + +2001-07-19 Katsumi Yamaoka + + * nntp.el (nntp-request-newgroups): Use UTC date for NEWGROUPS + command. + + * gnus-start.el (gnus-find-new-newsgroups): Use + `message-make-date' instead of `current-time-string'. + (gnus-ask-server-for-new-groups): Ditto. + (gnus-check-first-time-used): Ditto. + +2001-07-20 11:00:00 ShengHuo ZHU + + * gnus-score.el (gnus-home-score-file): nnheader-translate-file-chars. + +2001-07-18 Per Abrahamsen + + * message.el (message-shorten-references): Change `maxcount' and + `cut' to obey USEFOR draft 5. + +2001-07-12 Colin Walters + + * gnus-sum.el (gnus-summary-display-arrow): New variable. + (gnus-summary-set-article-display-arrow): New function. + (gnus-summary-goto-subject): Use it. + 2001-07-18 12:00:00 ShengHuo ZHU * gnus-sum.el (gnus-summary-import-article): Insert date if diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 574e28f..dc7152c 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -1908,7 +1908,7 @@ If READ-CHARSET, ask for a coding system." (if (stringp charset) (setq charset (intern (downcase charset))))))) (if read-charset - (setq charset (read-coding-system "Charset: " charset))) + (setq charset (mm-read-coding-system "Charset: " charset))) (unless charset (setq charset gnus-newsgroup-charset)) (when (or force @@ -1938,7 +1938,7 @@ If READ-CHARSET, ask for a coding system." (if (stringp charset) (setq charset (intern (downcase charset))))))) (if read-charset - (setq charset (read-coding-system "Charset: " charset))) + (setq charset (mm-read-coding-system "Charset: " charset))) (unless charset (setq charset gnus-newsgroup-charset)) (when (or force @@ -1980,7 +1980,7 @@ If READ-CHARSET, ask for a coding system." (if (stringp charset) (setq charset (intern (downcase charset))))))) (if read-charset - (setq charset (read-coding-system "Charset: " charset))) + (setq charset (mm-read-coding-system "Charset: " charset))) (unless charset (setq charset gnus-newsgroup-charset)) (article-goto-body) @@ -3729,10 +3729,12 @@ value of the variable `gnus-show-mime' is non-nil." (insert-buffer gnus-original-article-buffer) (mime-to-mml gnus-article-mime-handles) (setq gnus-article-mime-handles nil) - (make-local-hook 'kill-buffer-hook) (let ((mbl1 mml-buffer-list)) (setq mml-buffer-list mbl) (set (make-local-variable 'mml-buffer-list) mbl1)) + ;; LOCAL argument of add-hook differs between GNU Emacs + ;; and XEmacs. make-local-hook makes sure they are local. + (make-local-hook 'kill-buffer-hook) (add-hook 'kill-buffer-hook 'mml-destroy-buffers t t))) `(lambda (no-highlight) (let ((mail-parse-charset (or gnus-article-charset @@ -3860,7 +3862,7 @@ value of the variable `gnus-show-mime' is non-nil." (setq charset (or (cdr (assq arg gnus-summary-show-article-charset-alist)) - (read-coding-system "Charset: "))))) + (mm-read-coding-system "Charset: "))))) (forward-line 2) (mm-insert-inline handle (if (and charset @@ -3886,7 +3888,7 @@ specified charset." (let ((gnus-newsgroup-charset (or (cdr (assq arg gnus-summary-show-article-charset-alist)) - (read-coding-system "Charset: "))) + (mm-read-coding-system "Charset: "))) (gnus-newsgroup-ignored-charsets 'gnus-all)) (gnus-article-press-button))))) diff --git a/lisp/gnus-delay.el b/lisp/gnus-delay.el new file mode 100644 index 0000000..b0146fa --- /dev/null +++ b/lisp/gnus-delay.el @@ -0,0 +1,118 @@ +;;; gnus-delay.el --- Delayed posting of articles -*- coding: latin-1; -*- + +;; Copyright (C) 2001 Free Software Foundation, Inc. + +;; Author: Kai Großjohann +;; Keywords: mail, news, extensions + +;; This file 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. + +;; This file 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, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: + +;; Provide delayed posting of articles. + +;;; Code: + +(require 'nndraft) +(require 'gnus-draft) + +(defvar gnus-delay-group "delayed" + "Group name for storing delayed articles.") + +(defvar gnus-delay-header "X-Gnus-Delayed" + "Header name for storing info about delayed articles.") + +(defvar gnus-delay-default-delay "3d" + "*Default length of delay.") + +(defun gnus-delay-article (delay) + "Delay this article by some time. +DELAY is a string, giving the length of the time. Possible values are + for in minutes (`m'), hours (`h'), days (`d'), +weeks (`w'), months (`M'), or years (`Y')." + (interactive + (list (read-string "Length of delay (units in [mhdwMY]): " + gnus-delay-default-delay))) + (let (num unit days deadline) + (unless (string-match "\\([0-9]+\\)\\s-*\\([mhdwMY]\\)" delay) + (error "Malformed delay `%s'" delay)) + (setq num (match-string 1 delay)) + (setq unit (match-string 2 delay)) + ;; Start from seconds, then multiply into needed units. + (setq num (string-to-number num)) + (cond ((string= unit "Y") + (setq delay (* num 60 60 24 365))) + ((string= unit "M") + (setq delay (* num 60 60 24 30))) + ((string= unit "w") + (setq delay (* num 60 60 24 7))) + ((string= unit "d") + (setq delay (* num 60 60 24))) + ((string= unit "h") + (setq delay (* num 60 60))) + (t + (setq delay (* num 60)))) + (setq deadline (message-make-date + (seconds-to-time (+ (time-to-seconds (current-time)) + delay)))) + (message-add-header (format "%s: %s" gnus-delay-header deadline))) + (set-buffer-modified-p t) + (nndraft-request-create-group gnus-delay-group) + (message-disassociate-draft) + (nndraft-request-associate-buffer gnus-delay-group) + (save-buffer 0) + (kill-buffer (current-buffer)) + (message-do-actions message-postpone-actions)) + +(defun gnus-delay-send-drafts () + "Send all the delayed messages that are due now." + (interactive) + (save-excursion + (let* ((group (format "nndraft:%s" gnus-delay-group)) + (articles (nndraft-articles)) + article deadline) + (gnus-activate-group group) + (while (setq article (pop articles)) + (gnus-request-head article group) + (set-buffer nntp-server-buffer) + (unless (re-search-forward + (concat "^" (regexp-quote gnus-delay-header) ":\\s-+")) + (error "Couldn't find delay for article %d" article)) + (setq deadline (nnheader-header-value)) + (setq deadline (apply 'encode-time (parse-time-string deadline))) + (setq deadline (time-since deadline)) + (when (and (>= (nth 0 deadline) 0) + (>= (nth 1 deadline) 0)) + (message "Sending article %d" article) + (gnus-draft-send article group) + (message "Sending article %d...done" article)))))) + +;;;###autoload +(defun gnus-delay-initialize (&optional no-keymap no-check) + "Initialize the gnus-delay package. +This sets up a key binding in `message-mode' to delay a message. +This tells Gnus to look for delayed messages after getting new news. + +Key binding is skipped if optional arg NO-KEYMAP is non-nil. +Checking delayed messages is skipped if optional arg NO-CHECK is non-nil." + (unless no-keymap + (require 'message) + (define-key message-mode-map "\C-c\C-j" 'gnus-delay-article)) + (unless no-check + (add-hook 'gnus-get-new-news-hook 'gnus-delay-send-drafts))) + +(provide 'gnus-delay) +;;; gnus-delay.el ends here diff --git a/lisp/gnus-score.el b/lisp/gnus-score.el index 8abdfac..2a88d13 100644 --- a/lisp/gnus-score.el +++ b/lisp/gnus-score.el @@ -2779,7 +2779,8 @@ The list is determined from the variable gnus-score-file-alist." (while funcs (when (gnus-functionp (car funcs)) (setq score-files - (nconc score-files (nreverse (funcall (car funcs) group))))) + (nconc score-files + (nreverse (funcall (car funcs) group))))) (setq funcs (cdr funcs))) (when gnus-score-use-all-scores ;; Add any home score files. @@ -2874,18 +2875,19 @@ If ADAPT, return the home adaptive file instead." (while (and (not found) (setq elem (pop list))) (setq found - (cond - ;; Simple string. - ((stringp elem) - elem) - ;; Function. - ((gnus-functionp elem) - (funcall elem group)) - ;; Regexp-file cons. - ((consp elem) - (when (string-match (gnus-globalify-regexp (car elem)) group) - (replace-match (cadr elem) t nil group)))))) + (cond + ;; Simple string. + ((stringp elem) + elem) + ;; Function. + ((gnus-functionp elem) + (funcall elem group)) + ;; Regexp-file cons. + ((consp elem) + (when (string-match (gnus-globalify-regexp (car elem)) group) + (replace-match (cadr elem) t nil group)))))) (when found + (setq found (nnheader-translate-file-chars found)) (if (file-name-absolute-p found) found (nnheader-concat gnus-kill-files-directory found))))) diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index b12878c..cd9727f 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -826,6 +826,15 @@ automatically when it is selected." :group 'gnus-summary :type 'hook) +(defcustom gnus-summary-display-arrow + (and (string-match "GNU" (emacs-version)) + (>= emacs-major-version 21) + (display-graphic-p)) + "*If non-nil, display an arrow highlighting the current article." + :version "21.1" + :group 'gnus-summary + :type 'boolean) + (defcustom gnus-summary-selected-face 'gnus-summary-selected-face "Face used for highlighting the current article in the summary buffer." :group 'gnus-summary-visual @@ -2710,6 +2719,21 @@ display only a single character." (aset table i [??])))) (setq buffer-display-table table))) +(defun gnus-summary-set-article-display-arrow (pos) + "Update the overlay arrow to point to line at position POS." + (when (and gnus-summary-display-arrow + (boundp 'overlay-arrow-position) + (boundp 'overlay-arrow-string)) + (save-excursion + (goto-char pos) + (beginning-of-line) + (unless overlay-arrow-position + (setq overlay-arrow-position (make-marker))) + (setq overlay-arrow-string "=>" + overlay-arrow-position (set-marker overlay-arrow-position + (point) + (current-buffer)))))) + (defun gnus-summary-buffer-name (group) "Return the summary buffer name of GROUP." (concat "*Summary " group "*")) @@ -6175,7 +6199,9 @@ If FORCE, also allow jumping to articles not currently shown." (unless silent (gnus-message 3 "Can't find article %d" article)) nil) - (goto-char (gnus-data-pos data)) + (let ((pt (gnus-data-pos data))) + (goto-char pt) + (gnus-summary-set-article-display-arrow pt)) (gnus-summary-position-point) article))) @@ -7758,7 +7784,7 @@ without any article massaging functions being run." ((numberp arg) (let ((gnus-newsgroup-charset (or (cdr (assq arg gnus-summary-show-article-charset-alist)) - (read-coding-system "Charset: "))) + (mm-read-coding-system "Charset: "))) (gnus-newsgroup-ignored-charsets 'gnus-all)) (gnus-summary-select-article nil 'force) (let ((deps gnus-newsgroup-dependencies) diff --git a/lisp/message.el b/lisp/message.el index a53887f..4e67115 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -3448,17 +3448,23 @@ This sub function is for exclusive use of `message-send-news'." (if followup-to (concat newsgroups "," followup-to) newsgroups))) - (hashtb (and (boundp 'gnus-active-hashtb) - gnus-active-hashtb)) + (known-groups + (mapcar '(lambda (n) (gnus-group-real-name n)) + (gnus-groups-from-server + (cond ((equal gnus-post-method 'current) + gnus-current-select-method) + (gnus-post-method gnus-post-method) + (t gnus-select-method))))) errors) (while groups - (when (and (not (boundp (intern (car groups) hashtb))) - (not (equal (car groups) "poster"))) - (push (car groups) errors)) - (pop groups)) + (unless (or (equal (car groups) "poster") + (member (car groups) known-groups)) + (push (car groups) errors)) + (pop groups)) (cond ;; Gnus is not running. - ((or (not hashtb) + ((or (not (and (boundp 'gnus-active-hashtb) + gnus-active-hashtb)) (not (boundp 'gnus-read-active-file))) t) ;; We don't have all the group names. @@ -4324,12 +4330,12 @@ Headers already prepared in the buffer are not modified." (nthcdr (+ (- cut 2) surplus 1) list))) (defun message-shorten-references (header references) - "Trim REFERENCES to be less than 31 Message-ID long, and fold them. + "Trim REFERENCES to be 21 Message-ID long or less, and fold them. If folding is disallowed, also check that the REFERENCES are less than 988 characters long, and if they are not, trim them until they are." - (let ((maxcount 31) + (let ((maxcount 21) (count 0) - (cut 6) + (cut 2) refs) (with-temp-buffer (insert references) diff --git a/lisp/mm-util.el b/lisp/mm-util.el index 78e3628..48de5ee 100644 --- a/lisp/mm-util.el +++ b/lisp/mm-util.el @@ -103,12 +103,6 @@ (make-char . (lambda (charset int) (int-to-char int))) - (read-coding-system - . (lambda (prompt) - "Prompt the user for a coding system." - (completing-read - prompt (mapcar (lambda (s) (list (symbol-name (car s)))) - mm-mime-mule-charset-alist)))) (read-charset . (lambda (prompt) "Return a charset." @@ -140,6 +134,21 @@ ((fboundp 'char-valid-p) 'char-valid-p) (t 'identity)))) +(eval-and-compile + (defalias 'mm-read-coding-system + (cond + ((fboundp 'read-coding-system) + (if (and (featurep 'xemacs) + (<= (string-to-number emacs-version) 21.1)) + (lambda (prompt &optional default-coding-system) + (read-coding-system prompt)) + 'read-coding-system)) + (t (lambda (prompt &optional default-coding-system) + "Prompt the user for a coding system." + (completing-read + prompt (mapcar (lambda (s) (list (symbol-name (car s)))) + mm-mime-mule-charset-alist))))))) + (defvar mm-coding-system-list nil) (defun mm-get-coding-system-list () "Get the coding system list." diff --git a/lisp/nnheader.el b/lisp/nnheader.el index 53834bc..1833588 100644 --- a/lisp/nnheader.el +++ b/lisp/nnheader.el @@ -1181,6 +1181,14 @@ find-file-hooks, etc. (push path result)))) (defalias 'mm-image-load-path 'nnheader-image-load-path) +(defalias 'mm-read-coding-system + (if (or (and (featurep 'xemacs) + (<= (string-to-number emacs-version) 21.1)) + (boundp 'MULE)) + (lambda (prompt &optional default-coding-system) + (read-coding-system prompt)) + 'read-coding-system)) + (when (featurep 'xemacs) (require 'nnheaderxm)) diff --git a/lisp/nnml.el b/lisp/nnml.el index e045c2e..1d876e9 100644 --- a/lisp/nnml.el +++ b/lisp/nnml.el @@ -375,6 +375,25 @@ all. This may very well take some time.") (nnml-save-nov)))) result)) +(deffoo nnml-request-post (&optional server) + (let ((success t)) + (dolist (mbx (message-unquote-tokens + (message-tokenize-header + (message-fetch-field "Newsgroups") ", ")) success) + (let ((to-newsgroup (gnus-group-prefixed-name mbx gnus-command-method))) + (or (gnus-active to-newsgroup) + (gnus-activate-group to-newsgroup) + (if (gnus-y-or-n-p (format "No such group: %s. Create it? " + to-newsgroup)) + (or (and (gnus-request-create-group + to-newsgroup gnus-command-method) + (gnus-activate-group to-newsgroup nil nil + gnus-command-method)) + (error "Couldn't create group %s" to-newsgroup))) + (error "No such group: %s" to-newsgroup)) + (unless (nnml-request-accept-article mbx (nth 1 gnus-command-method)) + (setq success nil)))))) + (deffoo nnml-request-replace-article (article group buffer) (nnml-possibly-change-directory group) (save-excursion diff --git a/texi/ChangeLog b/texi/ChangeLog index de0d83c..9653969 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,12 @@ +2001-07-20 11:00:00 ShengHuo ZHU + From Jesper Harder + + * message.texi (Insertion): Addition. + +2001-07-19 22:00:00 ShengHuo ZHU + + * gnus.texi (Charsets): Addition. + 2001-07-17 22:00:00 ShengHuo ZHU * gnus.texi (Searching for Articles): Raw articles. diff --git a/texi/gnus.texi b/texi/gnus.texi index ff4e872..26179c9 100644 --- a/texi/gnus.texi +++ b/texi/gnus.texi @@ -8138,8 +8138,8 @@ hierarchy uses @code{iso-2022-jp-2}. @vindex gnus-group-charset-alist This knowledge is encoded in the @code{gnus-group-charset-alist} -variable, which is an alist of regexps (to match full group names) and -default charsets to be used when reading these groups. +variable, which is an alist of regexps (use the first item to match full +group names) and default charsets to be used when reading these groups. In addition, some people do use soi-disant @sc{mime}-aware agents that aren't. These blithely mark messages as being in @code{iso-8859-1} even diff --git a/texi/message-ja.texi b/texi/message-ja.texi index e16cf02..470f62d 100644 --- a/texi/message-ja.texi +++ b/texi/message-ja.texi @@ -474,6 +474,7 @@ message buffer (@code{message-yank-buffer}). @item message-citation-line-function @vindex message-citation-line-function +@cindex attribution line $B0zMQ9T$rA^F~$9$k$?$a$K8F$P$l$k4X?t$G$9!#=i4|CM(B $B$O(B @code{message-insert-citation-line} $B$G!"$3$l$O0zMQ9T$ro$K@Q6KE*$G$9!#$=$l$O(B +$B$K(B @code{message-send-mail-with-mh}, +@code{message-send-mail-with-qmail}, @code{message-send-mail-with-smtp}, +@code{smtpmail-send-it} $B$*$h$S(B @code{feedmail-send-it} $B$,;H$($^$9!#(B @item message-mh-deletable-headers @vindex message-mh-deletable-headers @@ -1066,7 +1074,7 @@ Lines (optional . User-Agent))} $B$G$9!#(B @vindex message-required-news-headers @code{message-required-news-headers} $B$O%X%C%@!<%7%s%\%k$N%j%9%H$G$9!#$3(B $B$l$i$N%X%C%@!<$O<+F0E*$K:n@.$5$l$k$+!"$b$7$/$O$=$l$,IT2DG=$G$"$l$P!"F~NO(B -$B$rB%?J$7$^$9!#0J2<$N%7%s%\%k$O9gK!E*$G$9(B: +$B$rB%?J$7$^$9!#0J2<$N%7%s%\%k$,;H$($^$9(B: @table @code @@ -1164,7 +1172,7 @@ Message $B$O(B @code{system-name} $B$r%7%9%F%`L>$r7h$a$k$?$a$K;H$$$^$9!#$b$7$ @vindex message-syntax-checks @code{nil} $B$G$J$1$l$P!"(BMessage $B$OEj9F$NA0$K!"%X%C%@!<$HB>$N$b$N$N9gK!@-(B $B$rD4$Y$^$9!#$3$N%j%9%H$KMWAG$rIU$12C$($?$j$r7h$a$k$?$a$K;H$$$^$9!#$b$7$ @item long-lines $B$"$^$j$KD9$$9T$rD4$Y$^$9!#(B @item control-chars -$BHs9gK!J8;z$rD4$Y$^$9!#(B +$B;H$C$F$O$$$1$J$$J8;z$rD4$Y$^$9!#(B @item size $B2a>j$JBg$-$5$rD4$Y$^$9!#(B @item new-text diff --git a/texi/message.texi b/texi/message.texi index f2cc33e..3529ef1 100644 --- a/texi/message.texi +++ b/texi/message.texi @@ -491,6 +491,7 @@ Regexp matching the longest possible citation prefix on a line. @item message-citation-line-function @vindex message-citation-line-function +@cindex attribution line Function called to insert the citation line. The default is @code{message-insert-citation-line}, which will lead to citation lines that look like: @@ -1061,9 +1062,15 @@ buffers that are initialized as mail. @table @code @item message-send-mail-function @vindex message-send-mail-function -Function used to send the current buffer as mail. The default is -@code{message-send-mail-with-sendmail}. If you prefer using MH -instead, set this variable to @code{message-send-mail-with-mh}. +@findex message-send-mail-with-sendmail +@findex message-send-mail-with-mh +@findex message-send-mail-with-qmail +@findex smtpmail-send-it +@findex feedmail-send-it +Function used to send the current buffer as mail. The default is +@code{message-send-mail-with-sendmail}. Other valid values include +@code{message-send-mail-with-mh}, @code{message-send-mail-with-qmail}, +@code{smtpmail-send-it} and @code{feedmail-send-it}. @item message-mh-deletable-headers @vindex message-mh-deletable-headers