From 0368f4e68e36c1099eaa4cc37d2e51cde92e0233 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Fri, 28 Jun 2002 12:15:54 +0000 Subject: [PATCH] Synch with Oort Gnus. --- lisp/ChangeLog | 13 +++++++++++++ lisp/message.el | 42 +++++++++++++++++++++++++++++++++--------- lisp/nntp.el | 18 ++++++++++++++---- texi/ChangeLog | 4 ++++ texi/gnus-ja.texi | 10 ++++++++++ texi/gnus.texi | 10 ++++++++++ 6 files changed, 84 insertions(+), 13 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8bbb610..a9a4e1b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,18 @@ 2002-06-28 Katsumi Yamaoka + * nntp.el (nntp-via-rlogin-command-switches): New variable. + (nntp-open-via-rlogin-and-telnet): Re-revert; use the var above. + +2002-06-28 Kai Gro,b_(Bjohann + + * message.el (message-font-lock-keywords): Don't fontify + headers in the message body, only in the header. + (message-font-lock-make-header-matcher): New function, used by + message-font-lock-keywords. + From Katsumi Yamaoka . + +2002-06-28 Katsumi Yamaoka + * nntp.el (nntp-open-via-rlogin-and-telnet): Revert last change. 2002-06-28 Katsumi Yamaoka diff --git a/lisp/message.el b/lisp/message.el index d5b304c..fdfc1cb 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -1167,27 +1167,51 @@ candidates: "Face used for displaying MML." :group 'message-faces) +(defun message-font-lock-make-header-matcher (regexp) + (let ((form + `(lambda (limit) + (let ((start (point))) + (save-restriction + (widen) + (goto-char (point-min)) + (if (re-search-forward + (concat "^" (regexp-quote mail-header-separator) "$") + nil t) + (setq limit (min limit (match-beginning 0)))) + (goto-char start)) + (and (< start limit) + (re-search-forward ,regexp limit t)))))) + (if (featurep 'bytecomp) + (byte-compile form) + form))) + (defvar message-font-lock-keywords (let ((content "[ \t]*\\(.+\\(\n[ \t].*\\)*\\)\n?")) - `((,(concat "^\\([Tt]o:\\)" content) + `((,(message-font-lock-make-header-matcher + (concat "^\\([Tt]o:\\)" content)) (1 'message-header-name-face) (2 'message-header-to-face nil t)) - (,(concat "^\\([GBF]?[Cc][Cc]:\\|[Rr]eply-[Tt]o:\\|" - "[Mm]ail-[Cc]opies-[Tt]o:\\|" - "[Mm]ail-[Rr]eply-[Tt]o:\\|" - "[Mm]ail-[Ff]ollowup-[Tt]o:\\)" content) + (,(message-font-lock-make-header-matcher + (concat "^\\([GBF]?[Cc][Cc]:\\|[Rr]eply-[Tt]o:\\|" + "[Mm]ail-[Cc]opies-[Tt]o:\\|" + "[Mm]ail-[Rr]eply-[Tt]o:\\|" + "[Mm]ail-[Ff]ollowup-[Tt]o:\\)" content)) (1 'message-header-name-face) (2 'message-header-cc-face nil t)) - (,(concat "^\\([Ss]ubject:\\)" content) + (,(message-font-lock-make-header-matcher + (concat "^\\([Ss]ubject:\\)" content)) (1 'message-header-name-face) (2 'message-header-subject-face nil t)) - (,(concat "^\\([Nn]ewsgroups:\\|Followup-[Tt]o:\\)" content) + (,(message-font-lock-make-header-matcher + (concat "^\\([Nn]ewsgroups:\\|Followup-[Tt]o:\\)" content)) (1 'message-header-name-face) (2 'message-header-newsgroups-face nil t)) - (,(concat "^\\([A-Z][^: \n\t]+:\\)" content) + (,(message-font-lock-make-header-matcher + (concat "^\\([A-Z][^: \n\t]+:\\)" content)) (1 'message-header-name-face) (2 'message-header-other-face nil t)) - (,(concat "^\\(X-[A-Za-z0-9-]+:\\|In-Reply-To:\\)" content) + (,(message-font-lock-make-header-matcher + (concat "^\\(X-[A-Za-z0-9-]+:\\|In-Reply-To:\\)" content)) (1 'message-header-name-face) (2 'message-header-name-face)) ,@(if (and mail-header-separator diff --git a/lisp/nntp.el b/lisp/nntp.el index 8bbf408..6efb0a1 100644 --- a/lisp/nntp.el +++ b/lisp/nntp.el @@ -138,6 +138,12 @@ using and indirect connection method (nntp-open-via-*).") This command is used by the `nntp-open-via-rlogin-and-telnet' method. The default is \"rsh\", but \"ssh\" is a popular alternative.") +(defvoo nntp-via-rlogin-command-switches nil + "*Switches given to the rlogin command `nntp-via-rlogin-command'. +Set this to (\"-t\") if you use \"ssh\" for `nntp-via-rlogin-command' and +the telnet command requires a pseudo-tty allocation on an intermediate +host.") + (defvoo nntp-via-telnet-command "telnet" "*Telnet command used to connect to an intermediate host. This command is used by the `nntp-open-via-telnet-and-telnet' method.") @@ -1673,11 +1679,12 @@ Please refer to the following variables to customize the connection: - `nntp-end-of-line'." (let ((command `(,nntp-via-address ,nntp-telnet-command - ,@nntp-telnet-switches - ,nntp-address ,nntp-port-number)) + ,@nntp-telnet-switches)) proc) - (and nntp-via-user-name - (setq command `("-l" ,nntp-via-user-name ,@command))) + (when nntp-via-user-name + (setq command `("-l" ,nntp-via-user-name ,@command))) + (when nntp-via-rlogin-command-switches + (setq command (append nntp-via-rlogin-command-switches command))) (push nntp-via-rlogin-command command) (and nntp-pre-command (push nntp-pre-command command)) @@ -1685,6 +1692,9 @@ Please refer to the following variables to customize the connection: (apply 'start-process "nntpd" buffer command))) (save-excursion (set-buffer buffer) + (nntp-wait-for-string "^r?telnet") + (process-send-string proc (concat "open " nntp-address + " " nntp-port-number "\n")) (nntp-wait-for-string "^\r*20[01]") (beginning-of-line) (delete-region (point-min) (point)) diff --git a/texi/ChangeLog b/texi/ChangeLog index d341985..baaca3a 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,7 @@ +2002-06-28 Katsumi Yamaoka + + * gnus.texi (NNTP): Add nntp-via-rlogin-command-switches. + 2002-06-27 Kai Gro,b_(Bjohann * gnus.texi (Mail Back End Variables): Document diff --git a/texi/gnus-ja.texi b/texi/gnus-ja.texi index 9754dc7..1e1fb65 100644 --- a/texi/gnus-ja.texi +++ b/texi/gnus-ja.texi @@ -10963,6 +10963,8 @@ Also @xref{Security, ,Security, message, Message Manual}. (nntp-via-rlogin-command "ssh") @end lisp +@code{nntp-via-rlogin-command-switches} $B$b;2>H$7$F2<$5$$!#(B + $B$b$7$"$J$?$,KIJI$NCf$K$$$?$H$7$F$b!"(B"runsocks" $B$N$h$&$J%i%C%Q!<%3%^%s%I(B $B$rDL$7$F30$N@$3&$rD>@\%"%/%;%9$G$-$k$N$J$i$P!"0J2<$N$h$&$K(B socks $B$rDL$7(B $B$F%K%e!<%9%5!<%P!<$H(B telnet $B@\B3$9$k$3$H$,$G$-$^$9(B: @@ -11481,6 +11483,14 @@ Emacs $B$N%;%C%7%g%sA4BN$r%i%C%W$7$F!"%G%#%U%)%k%H$N%a%=%C%I$r;H$&$H$$$&$N(B @vindex nntp-via-rlogin-command $BCf4V$N%[%9%H$K%m%0%$%s$9$k$?$a$K;H$o$l$k%3%^%s%I$G$9!#%G%#%U%)%k%H(B $B$O(B @samp{rsh} $B$G$9$,!"(B@samp{ssh} $B$,?M5$$N$"$kBeBX