From 2f199ef9b4f7b43022f35ac5d00cd7e9389fa774 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Mon, 31 Mar 2003 17:07:31 +0000 Subject: [PATCH] * nntp.el (nntp-accept-process-output): Use new function. * nnheader.el (nnheader-read-timeout): New variable. (nnheader-accept-process-output): New function. * nntp.el (nntp-read-timeout): Removed. --- lisp/ChangeLog | 7 +++++++ lisp/gnus-fun.el | 2 +- lisp/nnheader.el | 16 ++++++++++++++++ lisp/nntp.el | 14 +------------- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9ce2fbda1..0507362c7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -5,6 +5,13 @@ 2003-03-31 Lars Magne Ingebrigtsen + * nntp.el (nntp-accept-process-output): Use new function. + + * nnheader.el (nnheader-read-timeout): New variable. + (nnheader-accept-process-output): New function. + + * nntp.el (nntp-read-timeout): Removed. + * gnus-sum.el (gnus-summary-prepare-threads): Add comment. 2003-03-30 Katsumi Yamaoka diff --git a/lisp/gnus-fun.el b/lisp/gnus-fun.el index f8afca862..7ef21f939 100644 --- a/lisp/gnus-fun.el +++ b/lisp/gnus-fun.el @@ -222,7 +222,7 @@ colors of the displayed X-Faces." (format "pnmcut -left 110 -top 30 -width 144 -height 144 '%s' | ppmnorm 2>/dev/null | pnmscale -width 48 -height 48 | ppmtopgm > /tmp/gnus.face.ppm" file)) (let ((gnus-convert-image-to-face-command - (format "cat '%%s' | ppmchange %s | ppmquant %%d | pnmtopng" + (format "cat '%%s' | ppmquant %%d | ppmchange %s | pnmtopng" (gnus-fun-ppm-change-string)))) (setq result (gnus-face-from-file "/tmp/gnus.face.ppm"))) (delete-file file) diff --git a/lisp/nnheader.el b/lisp/nnheader.el index 6d521310a..61797dfaf 100644 --- a/lisp/nnheader.el +++ b/lisp/nnheader.el @@ -70,6 +70,14 @@ Integer values will in effect be rounded up to the nearest multiple of (defvar nnheader-head-chop-length 2048 "*Length of each read operation when trying to fetch HEAD headers.") +(defvar nnheader-read-timeout + (if (string-match "windows-nt\\|os/2\\|emx\\|cygwin" + (symbol-name system-type)) + 1.0 + 0.1) + "How long nntp should wait between checking for the end of output. +Shorter values mean quicker response, but is more CPU intensive.") + (defvar nnheader-file-name-translation-alist (let ((case-fold-search t)) (cond @@ -1000,6 +1008,14 @@ find-file-hooks, etc. (defalias 'nnheader-cancel-function-timers 'cancel-function-timers) (defalias 'nnheader-string-as-multibyte 'string-as-multibyte) +(defun nnheader-accept-process-output (process) + (accept-process-output + process + (truncate nnheader-read-timeout) + (truncate (* (- nnheader-read-timeout + (truncate nnheader-read-timeout)) + 1000)))) + (when (featurep 'xemacs) (require 'nnheaderxm)) diff --git a/lisp/nntp.el b/lisp/nntp.el index b2ff43121..f3faa7399 100644 --- a/lisp/nntp.el +++ b/lisp/nntp.el @@ -208,13 +208,6 @@ NOTE: This variable is never seen to work in Emacs 20 and XEmacs 21.") "*Hook run just before posting an article. It is supposed to be used to insert Cancel-Lock headers.") -(defvoo nntp-read-timeout (if (string-match "windows-nt\\|os/2\\|emx\\|cygwin" - (symbol-name system-type)) - 1.0 - 0.1) - "How long nntp should wait between checking for the end of output. -Shorter values mean quicker response, but is more CPU intensive.") - ;;; Internal variables. (defvar nntp-record-commands nil @@ -1308,12 +1301,7 @@ password contained in '~/.nntp-authinfo'." (unless (< len 10) (setq nntp-have-messaged t) (nnheader-message 7 "nntp read: %dk" len))) - (accept-process-output - process - (truncate nntp-read-timeout) - (truncate (* (- nntp-read-timeout - (truncate nntp-read-timeout)) - 1000))) + (nnheader-accept-process-output process) ;; accept-process-output may update status of process to indicate ;; that the server has closed the connection. This MUST be ;; handled here as the buffer restored by the save-excursion may -- 2.25.1