Gnus development mailing list
 help / color / mirror / Atom feed
From: Martin Rohde <martin.rohde@gmx.de>
Subject: Re: 'g' in the group buffer still very slow
Date: Tue, 10 Dec 2002 19:30:33 +0100	[thread overview]
Message-ID: <878yyxsp4m.fsf@gmx.de> (raw)
In-Reply-To: <87el8qlswk.fsf@gmx.de> (Martin Rohde's message of "Mon, 09 Dec 2002 23:38:35 +0100")

[-- Attachment #1: Type: text/plain, Size: 593 bytes --]

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.


[-- Attachment #2: nntp.el.diff --]
[-- Type: text/plain, Size: 2582 bytes --]

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

  reply	other threads:[~2002-12-10 18:30 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 [this message]
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
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=878yyxsp4m.fsf@gmx.de \
    --to=martin.rohde@gmx.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).