2002-06-28 Katsumi Yamaoka <yamaoka@jpl.org>
+ * 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\e,b_\e(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
+
+ * 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 <yamaoka@jpl.org>.
+
+2002-06-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
* nntp.el (nntp-open-via-rlogin-and-telnet): Revert last change.
2002-06-28 Katsumi Yamaoka <yamaoka@jpl.org>
"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
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.")
- `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))
(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))
+2002-06-28 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gnus.texi (NNTP): Add nntp-via-rlogin-command-switches.
+
2002-06-27 Kai Gro\e,b_\e(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
* gnus.texi (Mail Back End Variables): Document
(nntp-via-rlogin-command "ssh")
@end lisp
+@code{nntp-via-rlogin-command-switches} \e$B$b;2>H$7$F2<$5$$!#\e(B
+
\e$B$b$7$"$J$?$,KIJI$NCf$K$$$?$H$7$F$b!"\e(B"runsocks" \e$B$N$h$&$J%i%C%Q!<%3%^%s%I\e(B
\e$B$rDL$7$F30$N@$3&$rD>@\%"%/%;%9$G$-$k$N$J$i$P!"0J2<$N$h$&$K\e(B socks \e$B$rDL$7\e(B
\e$B$F%K%e!<%9%5!<%P!<$H\e(B telnet \e$B@\B3$9$k$3$H$,$G$-$^$9\e(B:
@vindex nntp-via-rlogin-command
\e$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\e(B
\e$B$O\e(B @samp{rsh} \e$B$G$9$,!"\e(B@samp{ssh} \e$B$,?M5$$N$"$kBeBX<jCJ$G$9!#\e(B
+
+@item nntp-via-rlogin-command-switches
+@vindex nntp-via-rlogin-command-switches
+@code{nntp-via-rlogin-command} \e$B$N%3%^%s%I$N%9%$%C%A$H$7$F;H$o$l$kJ8;zNs\e(B
+\e$B$N%j%9%H$G$9!#%G%#%U%)%k%H$O\e(B @code{nil} \e$B$G$9!#$b\e(B
+\e$B$7\e(B @samp{ssh} \e$B$r\e(B @code{nntp-via-rlogin-command} \e$B$NCM$H$7$F;H$$!"$+$DCf4V\e(B
+\e$B$N%[%9%H$G\e(B telnet \e$B%3%^%s%I$,5?;wC<Kv$rI,MW$H$9$k$J$i$P!"$3$l\e(B
+\e$B$r\e(B @samp{("-t")} \e$B$K$7$F2<$5$$!#\e(B
@end table
@item nntp-open-via-telnet-and-telnet
(nntp-via-rlogin-command "ssh")
@end lisp
+See also @code{nntp-via-rlogin-command-switches}.
+
If you're behind a firewall, but have direct access to the outside world
through a wrapper command like "runsocks", you could open a socksified
telnet connection to the news server as follows:
@vindex nntp-via-rlogin-command
Command used to log in on the intermediate host. The default is
@samp{rsh}, but @samp{ssh} is a popular alternative.
+
+@item nntp-via-rlogin-command-switches
+@vindex nntp-via-rlogin-command-switches
+List of strings to be used as the switches to
+@code{nntp-via-rlogin-command}. The default is @code{nil}. Set this to
+@samp{("-t")} if you use @samp{ssh} for @code{nntp-via-rlogin-command}
+and the telnet command requires a pseudo-tty allocation on an
+intermediate host.
@end table
@item nntp-open-via-telnet-and-telnet