Gnus development mailing list
 help / color / mirror / Atom feed
From: kai.grossjohann@uni-duisburg.de (Kai Großjohann)
Subject: Re: 'g' in the group buffer still very slow
Date: Wed, 11 Dec 2002 09:21:27 +0100	[thread overview]
Message-ID: <84smx5ufso.fsf@lucy.cs.uni-dortmund.de> (raw)
In-Reply-To: <878yyxsp4m.fsf@gmx.de>

Martin Rohde <martin.rohde@gmx.de> writes:

> +	      ;; 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)

I think it is dangerous to just erase the buffer here.  Consider the
following:

Gnus sends MyNOOP command.  The response arrives in two chunks: first
the echo arrives, then the response from the remote server ("500
what?" or so) arrives.

Then accept-process-output would return after the first chunk, and
erase-buffer would erase too little.

>  	      (set-buffer nntp-server-buffer)
> +	      
>  	      (let ((nnheader-callback-function nil))
>  		(run-hooks 'nntp-server-opened-hook)
>  		(nntp-send-authinfo t))))

I think what you want to do is to wait until all of the response from
the server has appeared.  Ie, you wait until you see the line with
the status code.

You can't use nntp-wait-for to do this because it looks at the
beginning of the buffer (you'll see (goto-char (point-min)) if you
look at the code).  (That's also why your previous approach didn't
work I think.)

Idea: after accept-process-output, you look for the echo.  If there
is one, remove it (and only it) from the buffer.  Then do
nntp-wait-for.  Then erase-buffer.  Do you think that might work?

-- 
~/.signature is: umop ap!sdn    (Frank Nobis)



  parent reply	other threads:[~2002-12-11  8:21 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-21 20:16 Sebastian D.B. Krause
2002-07-26 12:45 ` Simon Josefsson
2002-07-26 12:52   ` Kai Großjohann
2002-12-08 18:00   ` Sebastian D.B. Krause
2002-12-08 19:45     ` Kai Großjohann
2002-12-08 20:28       ` Sebastian D.B. Krause
2002-12-08 23:33       ` Martin Rohde
2002-12-09  7:49         ` Kai Großjohann
2002-12-09 14:02           ` Martin Rohde
2002-12-09 17:22             ` Kai Großjohann
2002-12-09 22:38               ` Martin Rohde
2002-12-10 18:30                 ` Martin Rohde
2002-12-11  4:13                   ` kgreiner
2002-12-11 20:05                     ` Martin Rohde
2002-12-11 21:09                       ` kgreiner
2002-12-12 11:37                       ` Kai Großjohann
2002-12-13 15:41                         ` Martin Rohde
2002-12-13 16:24                           ` Kai Großjohann
2002-12-13 17:18                             ` Martin Rohde
2002-12-14 12:52                               ` Kai Großjohann
2002-12-14 14:11                                 ` Martin Rohde
2002-12-11  8:21                   ` Kai Großjohann [this message]
2002-12-09  8:36         ` Kai Großjohann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84smx5ufso.fsf@lucy.cs.uni-dortmund.de \
    --to=kai.grossjohann@uni-duisburg.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).