From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/48135 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: Tue, 10 Dec 2002 19:30:33 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: <878yyxsp4m.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> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1039545166 10718 80.91.224.249 (10 Dec 2002 18:32:46 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 10 Dec 2002 18:32:46 +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 18LpBO-0002lo-00 for ; Tue, 10 Dec 2002 19:32:38 +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 18LpA0-00013g-00; Tue, 10 Dec 2002 12:31:13 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Tue, 10 Dec 2002 12:32:01 -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 MAA02373 for ; Tue, 10 Dec 2002 12:31:40 -0600 (CST) Original-Received: (qmail 6523 invoked by alias); 10 Dec 2002 18:30:41 -0000 Original-Received: (qmail 6518 invoked from network); 10 Dec 2002 18:30:40 -0000 Original-Received: from mailout11.sul.t-online.com (194.25.134.85) by gnus.org with SMTP; 10 Dec 2002 18:30:40 -0000 Original-Received: from fwd07.sul.t-online.de by mailout11.sul.t-online.com with smtp id 18Lp9S-0007bh-0B; Tue, 10 Dec 2002 19:30:38 +0100 Original-Received: from ParadiseCity (0202731138-0001@[217.83.107.229]) by fmrl07.sul.t-online.com with esmtp id 18Lp9Q-0ZdTyCC; Tue, 10 Dec 2002 19:30:36 +0100 Original-Received: by ParadiseCity (Postfix, from userid 1000) id 8BE1DF52C1; Tue, 10 Dec 2002 19:30:33 +0100 (CET) Original-To: ding@gnus.org In-Reply-To: <87el8qlswk.fsf@gmx.de> (Martin Rohde's message of "Mon, 09 Dec 2002 23:38:35 +0100") X-Now-Playing: Foo Fighters - Generator 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:48135 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:48135 --=-=-= Ok, now it works, I think: Using telnet with local echo, leads to setting nntp-delete-echo to t, and the lines in the server-buffer are deleted. When I disable local echo, nntp-delete-echo is nil and the lines are not touched. Because "mode reader" and "slave" still _could_ affect something (whatever that would be), I now think, that the best way is to send something stupid like "MyNOOP", for NNTP doesn't close the connection on wrong commands. Furthermore I changed the functions nntp-send-command-nodelete and nntp-send-command-and-decode, that had the code to delete echos, too. --=-=-= Content-Disposition: attachment; filename=nntp.el.diff --- nntp.el.old 2002-12-09 13:22:57.000000000 +0100 +++ nntp.el 2002-12-10 18:48:10.000000000 +0100 @@ -251,6 +251,9 @@ (autoload 'mail-source-read-passwd "mail-source") (autoload 'open-ssl-stream "ssl")) +(defvar nntp-delete-echo nil) + + ;;; Internal functions. @@ -408,9 +411,9 @@ ;; If nothing to wait for, still remove possibly echo'ed commands. ;; 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)) + + (when (and (not wait-for) + nntp-delete-echo) (nntp-accept-response) (save-excursion (set-buffer buffer) @@ -435,7 +438,8 @@ nntp-server-buffer wait-for nnheader-callback-function) ;; If nothing to wait for, still remove possibly echo'ed commands - (unless wait-for + (when (and (not wait-for) + nntp-delete-echo) (nntp-accept-response) (save-excursion (set-buffer buffer) @@ -465,14 +469,15 @@ nntp-server-buffer wait-for nnheader-callback-function t) ;; If nothing to wait for, still remove possibly echo'ed commands - (unless wait-for + (unless (and (not wait-for) + nntp-delete-echo) (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)))) - ))) + (set-buffer buffer) + (goto-char pos) + (if (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)))) @@ -1031,7 +1036,22 @@ (set-buffer pbuffer) (nntp-read-server-type) (erase-buffer) + + ;; Send a No-Op command to recognize if we need to delete local echo + ;; in future. This only makes sense, if we are using a non-direct connection... + (unless (equal nntp-open-connection-function + 'nntp-open-network-stream) + (let ((command "MyNOOP") + (pos (point))) + (nntp-send-string process command) + (accept-process-output process) + (goto-char pos) + (when (looking-at (regexp-quote command)) + (setq nntp-delete-echo t)))) + + (erase-buffer) (set-buffer nntp-server-buffer) + (let ((nnheader-callback-function nil)) (run-hooks 'nntp-server-opened-hook) (nntp-send-authinfo t)))) --=-=-=--