From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/48120 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: Mon, 09 Dec 2002 15:02:45 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: <87hedn2su2.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> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1039442847 24253 80.91.224.249 (9 Dec 2002 14:07:27 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 9 Dec 2002 14:07: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 18LOZA-0006Io-00 for ; Mon, 09 Dec 2002 15:07:24 +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 18LOWO-0002Aw-00; Mon, 09 Dec 2002 08:04:32 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Mon, 09 Dec 2002 08:05:21 -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 IAA28569 for ; Mon, 9 Dec 2002 08:05:03 -0600 (CST) Original-Received: (qmail 11062 invoked by alias); 9 Dec 2002 14:03:27 -0000 Original-Received: (qmail 11057 invoked from network); 9 Dec 2002 14:03:27 -0000 Original-Received: from mailout08.sul.t-online.com (194.25.134.20) by gnus.org with SMTP; 9 Dec 2002 14:03:27 -0000 Original-Received: from fwd06.sul.t-online.de by mailout08.sul.t-online.com with smtp id 18LOVF-0003dh-02; Mon, 09 Dec 2002 15:03:21 +0100 Original-Received: from ParadiseCity (0202731138-0001@[217.83.109.151]) by fmrl06.sul.t-online.com with esmtp id 18LOUs-17U9EOC; Mon, 9 Dec 2002 15:02:58 +0100 Original-Received: by ParadiseCity (Postfix, from userid 1000) id DF961F52C1; Mon, 9 Dec 2002 15:02:45 +0100 (CET) Original-To: ding@gnus.org In-Reply-To: <84k7ijaaz2.fsf@lucy.cs.uni-dortmund.de> (kai.grossjohann@uni-duisburg.de's message of "Mon, 09 Dec 2002 08:49:05 +0100") X-Now-Playing: Foo Fighters - Learn To Fly 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:48120 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:48120 --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit On Day 51 of The Aftermath 3168, Kai Großjohann wrote: > Martin Rohde writes: > >> If I get it right, you can almost take the code for that from >> nntp-send-command* and put it into nntp-open-connection. I will send >> a patch, if it works. > > That would be great! (I didn't see code for finding out if there is > an echoed command. Maybe I was just blind.) Well, nntp-send-command looks, if there's an echo, and then deletes it. I don't understand most of the code in nntp-open-connection, so I don't know if anything of this patch makes sense. And I don't know how to test it, because i don't know how to force such a local echo. What this code does, is to send a "MODE READER" as a No-Op command, when the connection is established (I think ;), and then it looks, just like in nntp-send-command, if the command is echoed in the server-buffer. If so, it deletes it and sets nntp-delete-echo to t for future reference (I hope). --=-=-= Content-Disposition: attachment; filename=nntp.el.diff --- nntp.el.old 2002-12-09 13:22:57.000000000 +0100 +++ nntp.el 2002-12-09 14:35:30.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,17 +411,17 @@ ;; 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)) - (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 (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)))) + ))) (nnheader-report 'nntp "Couldn't open connection to %s." nntp-address)))) @@ -1031,7 +1034,25 @@ (set-buffer pbuffer) (nntp-read-server-type) (erase-buffer) + (set-buffer nntp-server-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 "MODE READER") + (pos (point))) + (nntp-send-string process command) + (nntp-wait-for process "\n" (current-buffer)) + (goto-char pos) + (when (looking-at (regexp-quote command)) + (setq nntp-delete-echo t) + (delete-region pos (progn (forward-line 1) + (gnus-point-at-bol)))))) + (let ((nnheader-callback-function nil)) (run-hooks 'nntp-server-opened-hook) (nntp-send-authinfo t)))) --=-=-=--