From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/48204 Path: main.gmane.org!not-for-mail From: Martin Rohde Newsgroups: gmane.emacs.gnus.general Subject: Re: 'g' in the group buffer still very slow Date: Sat, 14 Dec 2002 15:11:09 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: <87isxwr8qq.fsf@gmx.de> References: <87heisn8f4.fsf@sdbk.de> <87d6ocmlux.fsf@sdbk.de> <84adjg8fbd.fsf@lucy.cs.uni-dortmund.de> <87wumk5bmq.fsf@gmx.de> <84k7ijaaz2.fsf@lucy.cs.uni-dortmund.de> <87hedn2su2.fsf@gmx.de> <84of7vxg2t.fsf@lucy.cs.uni-dortmund.de> <87el8qlswk.fsf@gmx.de> <878yyxsp4m.fsf@gmx.de> <873cp4s4m4.fsf@gmx.de> <84smx3o4ck.fsf@lucy.cs.uni-dortmund.de> <87isxydiz0.fsf@gmx.de> <84bs3pubse.fsf@lucy.cs.uni-dortmund.de> <87d6o5et2g.fsf@gmx.de> <84lm2skbjt.fsf@lucy.cs.uni-dortmund.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1039875267 30403 80.91.224.249 (14 Dec 2002 14:14:27 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 14 Dec 2002 14:14:27 +0000 (UTC) Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18ND3h-0007uE-00 for ; Sat, 14 Dec 2002 15:14:25 +0100 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 18ND1b-0000Vz-00; Sat, 14 Dec 2002 08:12:15 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sat, 14 Dec 2002 08:13:03 -0600 (CST) Original-Received: from sclp3.sclp.com (qmailr@[209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id IAA11661 for ; Sat, 14 Dec 2002 08:12:43 -0600 (CST) Original-Received: (qmail 16903 invoked by alias); 14 Dec 2002 14:11:42 -0000 Original-Received: (qmail 16898 invoked from network); 14 Dec 2002 14:11:42 -0000 Original-Received: from mailout04.sul.t-online.com (194.25.134.18) by gnus.org with SMTP; 14 Dec 2002 14:11:42 -0000 Original-Received: from fwd11.sul.t-online.de by mailout04.sul.t-online.com with smtp id 18ND11-0005Xh-00; Sat, 14 Dec 2002 15:11:39 +0100 Original-Received: from ParadiseCity (0202731138-0001@[80.133.43.53]) by fmrl11.sul.t-online.com with esmtp id 18ND0i-1YzJVQC; Sat, 14 Dec 2002 15:11:20 +0100 Original-Received: by ParadiseCity (Postfix, from userid 1000) id A3F7AF52BC; Sat, 14 Dec 2002 15:11:09 +0100 (CET) Original-To: ding@gnus.org In-Reply-To: <84lm2skbjt.fsf@lucy.cs.uni-dortmund.de> (kai.grossjohann@uni-duisburg.de's message of "Sat, 14 Dec 2002 13:52:22 +0100") X-Now-Playing: Joey Ramone - What A Wonderful World User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-debian-linux-gnu) X-Sender: 0202731138-0001@t-dialin.net Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:48204 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:48204 --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit On Day 56 of The Aftermath 3168, Kai Großjohann wrote: >> I thought, it would make the start of gnus a bit faster when you are >> using nntp-open-network-stream, because otherwise you would still >> have the delay from nntp-accept-response when nntp-send-command is >> called for the first time. > > Hm. This happens if the first command doesn't produce a response, > right? Anyhow, it's not so important. Just leave it like that but a > comment (connections created with nntp-open-network-stream will never > echo; don't bother checking for echoes there) would be nice. In nntp-send-command, there still is the comment of your last change of this part, which is just right for this purpose. (Oh, but it's absent in the other two functions, so I added it there.) > What do you think about making it (defvar nntp-process-delete-echo t), > then then, in nntp-make-process-buffer, to just do > (make-local-variable 'nntp-process-delete-echo)? > > It might make it a little bit clearer what is the default value of the > variable, so outsiders have a better chance of understanding the code. > > Just my two cents. I agree with you, I missed that make-local-variable adopts the global value. --=-=-= Content-Disposition: attachment; filename=nntp.el.diff --- nntp.el.old 2002-12-14 14:22:49.000000000 +0100 +++ nntp.el 2002-12-14 14:27:55.000000000 +0100 @@ -218,6 +218,7 @@ (defvar nntp-process-to-buffer nil) (defvar nntp-process-callback nil) (defvar nntp-process-decode nil) +(defvar nntp-process-delete-echo t) (defvar nntp-process-start-point nil) (defvar nntp-inside-change-function nil) (defvoo nntp-last-command-time nil) @@ -411,14 +412,15 @@ (unless (or wait-for (equal nntp-open-connection-function 'nntp-open-network-stream)) - (nntp-accept-response) (save-excursion (set-buffer buffer) - (goto-char pos) - (if (looking-at (regexp-quote command)) - (delete-region pos (progn (forward-line 1) - (gnus-point-at-bol)))) - ))) + (when nntp-process-delete-echo + (nntp-accept-response) + (goto-char pos) + (if (setq nntp-process-delete-echo (looking-at (regexp-quote command))) + (delete-region pos (progn (forward-line 1) + (gnus-point-at-bol)))) + )))) (nnheader-report 'nntp "Couldn't open connection to %s." nntp-address)))) @@ -435,15 +437,20 @@ nntp-server-buffer wait-for nnheader-callback-function) ;; If nothing to wait for, still remove possibly echo'ed commands - (unless wait-for - (nntp-accept-response) + ;; We don't have echos if nntp-open-connection-function + ;; is `nntp-open-network-stream', so we skip this in that case. + (unless (or wait-for + (equal nntp-open-connection-function + 'nntp-open-network-stream)) (save-excursion (set-buffer buffer) - (goto-char pos) - (if (looking-at (regexp-quote command)) - (delete-region pos (progn (forward-line 1) - (gnus-point-at-bol)))) - ))) + (when nntp-process-delete-echo + (nntp-accept-response) + (goto-char pos) + (if (setq nntp-process-delete-echo (looking-at (regexp-quote command))) + (delete-region pos (progn (forward-line 1) + (gnus-point-at-bol)))) + )))) (nnheader-report 'nntp "Couldn't open connection to %s." nntp-address)))) @@ -465,14 +472,20 @@ nntp-server-buffer wait-for nnheader-callback-function t) ;; If nothing to wait for, still remove possibly echo'ed commands - (unless wait-for - (nntp-accept-response) + ;; We don't have echos if nntp-open-connection-function + ;; is `nntp-open-network-stream', so we skip this in that case. + (unless (or wait-for + (equal nntp-open-connection-function + 'nntp-open-network-stream)) (save-excursion - (set-buffer buffer) - (goto-char pos) - (if (looking-at (regexp-quote command)) - (delete-region pos (progn (forward-line 1) (gnus-point-at-bol)))) - ))) + (set-buffer buffer) + (when nntp-process-delete-echo + (nntp-accept-response) + (goto-char pos) + (if (setq nntp-process-delete-echo (looking-at (regexp-quote command))) + (delete-region pos (progn (forward-line 1) + (gnus-point-at-bol)))) + )))) (nnheader-report 'nntp "Couldn't open connection to %s." nntp-address)))) @@ -1048,6 +1061,7 @@ (set (make-local-variable 'nntp-process-to-buffer) nil) (set (make-local-variable 'nntp-process-start-point) nil) (set (make-local-variable 'nntp-process-decode) nil) + (make-local-variable 'nntp-process-delete-echo) (current-buffer))) (defun nntp-open-connection (buffer) --=-=-=--