From 8ed3d24476dc59f5c65945a2bfc73c9a2e31f03a Mon Sep 17 00:00:00 2001 From: yamaoka Date: Fri, 21 Apr 2000 00:11:00 +0000 Subject: [PATCH] Sync with latest Gnus. (It's a hard day today. ^^;;) --- lisp/ChangeLog | 26 ++++++++++++++ lisp/fill-flowed.el | 94 --------------------------------------------------- lisp/flow-fill.el | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++ lisp/gnus-score.el | 4 +-- lisp/gnus-util.el | 30 +++++++++++----- lisp/message.el | 11 +++--- lisp/nntp.el | 2 +- texi/gnus-ja.texi | 13 +++++-- texi/gnus.texi | 10 ++++-- 9 files changed, 167 insertions(+), 117 deletions(-) delete mode 100644 lisp/fill-flowed.el create mode 100644 lisp/flow-fill.el diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4bf83f3..558332e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,9 +1,35 @@ +2000-04-21 01:24:41 Lars Magne Ingebrigtsen + + * flow-fill.el: Renamed from fill-flowed. + + * message.el (message-forward-ignored-headers): Default to + removing CTE. + +2000-04-21 00:48:48 + + * message.el (message-mode): Don't fill headers. + +2000-04-20 23:12:43 Lars Magne Ingebrigtsen + + * message.el (message-pipe-buffer-body): Use shell + +2000-02-21 Yoshiki Hayashi + + * nnvirtual.el (nnvirtual-request-article): + Bind gnus-override-method to nil. + (nnvirtual-request-update-mark): Don't update mark when + article is not there. + 2000-04-20 16:35:41 Shenghuo ZHU * mm-uu.el (mm-uu-dissect): Check forwarded message. 2000-04-20 21:17:48 Lars Magne Ingebrigtsen + * gnus-util.el (gnus-parse-netrc): Allow "port". + (gnus-netrc-machine): Take a port param. + (gnus-netrc-machine): + * gnus-art.el (gnus-request-article-this-buffer): Allow re-selecting referenced articles. diff --git a/lisp/fill-flowed.el b/lisp/fill-flowed.el deleted file mode 100644 index b0883de..0000000 --- a/lisp/fill-flowed.el +++ /dev/null @@ -1,94 +0,0 @@ -;;; fill-flowed.el --- interprete RFC2646 "flowed" text -;; Copyright (C) 2000 Free Software Foundation, Inc. - -;; Author: Simon Josefsson -;; Keywords: mail - -;; This program 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 of the License, or -;; (at your option) any later version. -;; -;; This program 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 this program; if not, write to the Free Software -;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -;;; Commentary: - -;; This implement decoding of RFC2646 formatted text, including the -;; quoted-depth wins rules. - -;; Theory of operation: search for lines ending with SPC, save quote -;; length of line, remove SPC and concatenate line with the following -;; line if quote length of following line matches current line. - -;; When no further concatenations are possible, we've found a -;; paragraph and we let `fill-region' fill the long line into several -;; lines with the quote prefix as `fill-prefix'. - -;; Todo: encoding - -;; History: - -;; 2000-02-17 posted on ding mailing list -;; 2000-02-19 use `point-at-{b,e}ol' in XEmacs -;; 2000-03-11 no compile warnings for point-at-bol stuff -;; 2000-03-26 commited to gnus cvs - -;;; Code: - -(eval-and-compile - (fset 'fill-flowed-point-at-bol - (if (fboundp 'point-at-bol) - 'point-at-bol - 'line-beginning-position)) - - (fset 'fill-flowed-point-at-eol - (if (fboundp 'point-at-eol) - 'point-at-eol - 'line-end-position))) - -(defun fill-flowed (&optional buffer) - (save-excursion - (set-buffer (or (current-buffer) buffer)) - (goto-char (point-min)) - (while (re-search-forward " $" nil t) - (when (save-excursion - (beginning-of-line) - (looking-at "^\\(>*\\)\\( ?\\)")) - (let ((quote (match-string 1))) - (if (string= quote "") - (setq quote nil)) - (when (and quote (string= (match-string 2) "")) - (save-excursion - ;; insert SP after quote for pleasant reading of quoted lines - (beginning-of-line) - (when (> (skip-chars-forward ">") 0) - (insert " ")))) - (while (and (save-excursion - (backward-char 3) - (looking-at "[^-][^-] ")) - (save-excursion - (unless (eobp) - (forward-char 1) - (if quote - (looking-at (format "^\\(%s\\)\\([^>]\\)" quote)) - (looking-at "^ ?"))))) - (save-excursion - (replace-match (if (string= (match-string 2) " ") - "" "\\2"))) - (backward-delete-char -1) - (end-of-line)) - (let ((fill-prefix (when quote (concat quote " ")))) - (fill-region (fill-flowed-point-at-bol) - (fill-flowed-point-at-eol) - 'left 'nosqueeze))))))) - -(provide 'fill-flowed) - -;;; fill-flowed.el ends here diff --git a/lisp/flow-fill.el b/lisp/flow-fill.el new file mode 100644 index 0000000..b0883de --- /dev/null +++ b/lisp/flow-fill.el @@ -0,0 +1,94 @@ +;;; fill-flowed.el --- interprete RFC2646 "flowed" text +;; Copyright (C) 2000 Free Software Foundation, Inc. + +;; Author: Simon Josefsson +;; Keywords: mail + +;; This program 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 of the License, or +;; (at your option) any later version. +;; +;; This program 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 this program; if not, write to the Free Software +;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +;;; Commentary: + +;; This implement decoding of RFC2646 formatted text, including the +;; quoted-depth wins rules. + +;; Theory of operation: search for lines ending with SPC, save quote +;; length of line, remove SPC and concatenate line with the following +;; line if quote length of following line matches current line. + +;; When no further concatenations are possible, we've found a +;; paragraph and we let `fill-region' fill the long line into several +;; lines with the quote prefix as `fill-prefix'. + +;; Todo: encoding + +;; History: + +;; 2000-02-17 posted on ding mailing list +;; 2000-02-19 use `point-at-{b,e}ol' in XEmacs +;; 2000-03-11 no compile warnings for point-at-bol stuff +;; 2000-03-26 commited to gnus cvs + +;;; Code: + +(eval-and-compile + (fset 'fill-flowed-point-at-bol + (if (fboundp 'point-at-bol) + 'point-at-bol + 'line-beginning-position)) + + (fset 'fill-flowed-point-at-eol + (if (fboundp 'point-at-eol) + 'point-at-eol + 'line-end-position))) + +(defun fill-flowed (&optional buffer) + (save-excursion + (set-buffer (or (current-buffer) buffer)) + (goto-char (point-min)) + (while (re-search-forward " $" nil t) + (when (save-excursion + (beginning-of-line) + (looking-at "^\\(>*\\)\\( ?\\)")) + (let ((quote (match-string 1))) + (if (string= quote "") + (setq quote nil)) + (when (and quote (string= (match-string 2) "")) + (save-excursion + ;; insert SP after quote for pleasant reading of quoted lines + (beginning-of-line) + (when (> (skip-chars-forward ">") 0) + (insert " ")))) + (while (and (save-excursion + (backward-char 3) + (looking-at "[^-][^-] ")) + (save-excursion + (unless (eobp) + (forward-char 1) + (if quote + (looking-at (format "^\\(%s\\)\\([^>]\\)" quote)) + (looking-at "^ ?"))))) + (save-excursion + (replace-match (if (string= (match-string 2) " ") + "" "\\2"))) + (backward-delete-char -1) + (end-of-line)) + (let ((fill-prefix (when quote (concat quote " ")))) + (fill-region (fill-flowed-point-at-bol) + (fill-flowed-point-at-eol) + 'left 'nosqueeze))))))) + +(provide 'fill-flowed) + +;;; fill-flowed.el ends here diff --git a/lisp/gnus-score.el b/lisp/gnus-score.el index 3fc01fb..3a122ab 100644 --- a/lisp/gnus-score.el +++ b/lisp/gnus-score.el @@ -2854,10 +2854,10 @@ If ADAPT, return the home adaptive file instead." ;; Function. ((gnus-functionp elem) (funcall elem group)) - ;; Regexp-file cons + ;; Regexp-file cons. ((consp elem) (when (string-match (gnus-globalify-regexp (car elem)) group) - (replace-match (cadr elem) t nil group )))))) + (replace-match (cadr elem) t nil group)))))) (when found (if (file-name-absolute-p found) found diff --git a/lisp/gnus-util.el b/lisp/gnus-util.el index 9c665a9..66a7dfe 100644 --- a/lisp/gnus-util.el +++ b/lisp/gnus-util.el @@ -852,7 +852,8 @@ ARG is passed to the first function." (when (file-exists-p file) (with-temp-buffer (let ((tokens '("machine" "default" "login" - "password" "account" "macdef" "force")) + "password" "account" "macdef" "force" + "port")) alist elem result pair) (insert-file-contents file) (goto-char (point-min)) @@ -900,16 +901,27 @@ ARG is passed to the first function." (forward-line 1)) (nreverse result))))) -(defun gnus-netrc-machine (list machine) +(defun gnus-netrc-machine (list machine &optional port) "Return the netrc values from LIST for MACHINE or for the default entry." - (let ((rest list)) - (while (and list - (not (equal (cdr (assoc "machine" (car list))) machine))) + (let ((rest list) + result) + (while list + (when (equal (cdr (assoc "machine" (car list))) machine) + (push (car list) result)) (pop list)) - (car (or list - (progn (while (and rest (not (assoc "default" (car rest)))) - (pop rest)) - rest))))) + (unless result + ;; No machine name matches, so we look for default entries. + (while rest + (when (assoc "default" (car rest)) + (push (car rest) result)) + (pop rest))) + (setq result (nreverse result)) + (if (null result) + nil + (while (and result + (not (equalp port (or (gnus-netrc-get result) "nntp")))) + (pop result)) + result))) (defun gnus-netrc-get (alist type) "Return the value of token TYPE from ALIST." diff --git a/lisp/message.el b/lisp/message.el index 646aa43..f4b39b1 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -420,7 +420,7 @@ The provided functions are: :group 'message-interface :type 'regexp) -(defcustom message-forward-ignored-headers nil +(defcustom message-forward-ignored-headers "Content-Transfer-Encoding" "*All headers that match this regexp will be deleted when forwarding a message." :group 'message-forwarding :type '(choice (const :tag "None" nil) @@ -1851,6 +1851,8 @@ M-RET message-newline-and-reformat (break the line and reformat)." (setq adaptive-fill-first-line-regexp (concat "[ \t]*[-a-z0-9A-Z]*\\(>[ \t]*\\)+[ \t]*\\|" adaptive-fill-first-line-regexp)) + (make-local-variable 'auto-fill-inhibit-regexp) + (setq auto-fill-inhibit-regexp "^[A-Z][^: \n\t]+:") (make-local-variable 'indent-tabs-mode) ;Turn off tabs for indentation. (setq indent-tabs-mode nil) (run-hooks 'text-mode-hook 'message-mode-hook)) @@ -2165,11 +2167,8 @@ Mail and USENET news headers are not rotated." (save-restriction (when (message-goto-body) (narrow-to-region (point) (point-max))) - (let ((body (buffer-substring (point-min) (point-max)))) - (unless (equal 0 (call-process-region - (point-min) (point-max) program t t)) - (insert body) - (message "%s failed" program)))))) + (shell-command-on-region + (point-min) (point-max) program nil t)))) (defun message-rename-buffer (&optional enter-string) "Rename the *message* buffer to \"*message* RECIPIENT\". diff --git a/lisp/nntp.el b/lisp/nntp.el index 910db3b..dbe1818 100644 --- a/lisp/nntp.el +++ b/lisp/nntp.el @@ -798,7 +798,7 @@ and a password. If SEND-IF-FORCE, only send authinfo to the server if the .authinfo file has the FORCE token." (let* ((list (gnus-parse-netrc nntp-authinfo-file)) - (alist (gnus-netrc-machine list nntp-address)) + (alist (gnus-netrc-machine list nntp-address "nntp")) (force (gnus-netrc-get alist "force")) (user (or (gnus-netrc-get alist "login") nntp-authinfo-user)) (passwd (gnus-netrc-get alist "password"))) diff --git a/texi/gnus-ja.texi b/texi/gnus-ja.texi index e5331c7..fbbf01c 100644 --- a/texi/gnus-ja.texi +++ b/texi/gnus-ja.texi @@ -9874,9 +9874,10 @@ Gnus $(B$,$I$l$+$N%5!<%P!<$+$i@\B35qH]$rC5n$7$^(B @item $(B$=$l$>$l$N9T$OG$0U$N?t$N(B $(B6h@Z$j0u(B/$(BCM(B $(B$NBP$r4^$`;v$,$G$-$^$9!#M-8z$J6h@Z(B $(B$j0u$O(B @samp{machine}$(B!"(B@samp{login}$(B!"(B@samp{password}$(B!"(B@samp{default}$(B!"(B -@samp{force} $(B$G$9!#(B($(B:G8e$N$b$N$OM-8z$J(B @code{.netrc}/@code{ftp} $(B$N6h@Z$j(B -$(B0u$G$O$"$j$^$;$s!#$3$l$,%U%!%$%k(B @file{.authinfo} $(B$,(B @file{.netrc} $(B%U%!(B -$(B%$%kMM<0$+$i0o$l$kM#0l$NJ}K!$G$9!#(B) +@samp{port}$(B!"(B@samp{force} $(B$G$9!#(B +($(B:G8e$N$b$N$OM-8z$J(B @code{.netrc}/@code{ftp} $(B$N6h@Z$j0u$G$O$"$j$^$;$s!#(B +$(B$3$l$,%U%!%$%k(B @file{.authinfo} $(B$,(B @file{.netrc} $(B%U%!%$%kMM<0$+$i0o$l$k(B +$(B$[$H$s$IM#0l$NJ}K!$G$9!#(B) @end enumerate @@ -20406,6 +20407,12 @@ into [-] buttons. (If I click on one of the [+] buttons, it does turn into a [-] button.) @item +Perhaps there should be a command to "attach" a buffer of comments to +a message? That is, `B WHATEVER', you're popped into a buffer, write +something, end with `C-c C-c', and then the thing you've written gets +to be the child of the message you're commenting. + +@item Solve the halting problem. @c TODO diff --git a/texi/gnus.texi b/texi/gnus.texi index 2cb8e37..3fc9e08 100644 --- a/texi/gnus.texi +++ b/texi/gnus.texi @@ -10270,8 +10270,8 @@ The file contains one or more line, each of which define one server. @item Each line may contain an arbitrary number of token/value pairs. The valid tokens include @samp{machine}, @samp{login}, @samp{password}, -@samp{default} and @samp{force}. (The latter is not a valid -@file{.netrc}/@code{ftp} token, which is the only way the +@samp{default}, @samp{port} and @samp{force}. (The latter is not a +valid @file{.netrc}/@code{ftp} token, which is almost the only way the @file{.authinfo} file format deviates from the @file{.netrc} file format.) @@ -20749,6 +20749,12 @@ into [-] buttons. (If I click on one of the [+] buttons, it does turn into a [-] button.) @item +Perhaps there should be a command to "attach" a buffer of comments to +a message? That is, `B WHATEVER', you're popped into a buffer, write +something, end with `C-c C-c', and then the thing you've written gets +to be the child of the message you're commenting. + +@item Solve the halting problem. @c TODO -- 1.7.10.4