unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#19583: nntp-open-server: wrong buffer for nnoo-change-server; breaks url-news
@ 2015-01-13 16:12 Ivan Shmakov
  2015-01-13 17:28 ` Lars Magne Ingebrigtsen
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Ivan Shmakov @ 2015-01-13 16:12 UTC (permalink / raw)
  To: 19583

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

Package: emacs
Tags: patch

	As of 88bc8332eb14 (2015-01-07 13:51:41 +0000), nntp-open-server
	appears to call nnoo-change-server without switching to
	nntp-server-buffer first, thus installing the local variables in
	the whatever buffer current at the time it’s called.  One of
	these variables is nntp-port-number, which means that when
	open-protocol-stream is called in the proper buffer later, it
	gets 0 for the port number to connect, and thus fails.

	This affects url-retrieve-synchronously; consider, e. g.:

(let ((url-news-server "news.gmane.org"))
  (url-retrieve-synchronously "news:87y4p9y2cq.fsf@violet.siamics.net"))

	Please thus consider the patch MIMEd.

	* lisp/gnus/nntp.el (nntp-open-server): Switch to
	nntp-server-buffer temporarily while calling nnoo-change-server.

	To note is that to get url-retrieve-synchronously working in
	this case, I had to comment out the :starttls-function argument
	to open-protocol-stream in nntp-open-connection (an issue I
	haven’t investigated much as of yet, but which may be related to
	the use of a self-signed certificate), /and/ define the default
	port for the ‘news’ URI scheme, like the (untested) patch MIMEd.

-- 
FSF associate member #7257  http://boycottsystemd.org/  … 3013 B6A0 230E 334A

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/diff, Size: 558 bytes --]

--- a/lisp/gnus/nntp.el	2015-01-01 22:26:41 +0000
+++ b/lisp/gnus/nntp.el
@@ -1066,7 +1066,8 @@ deffoo nntp-open-server (server &optional defs connectionless)
       (setq defs (cons (list 'nntp-port-number (car defs)) (cdr defs))))
     (unless (assq 'nntp-address defs)
       (setq defs (append defs (list (list 'nntp-address server)))))
-    (nnoo-change-server 'nntp server defs)
+    (with-current-buffer nntp-server-buffer
+      (nnoo-change-server 'nntp server defs))
     (if connectionless
 	t
       (or (nntp-find-connection nntp-server-buffer)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: Type: text/diff, Size: 689 bytes --]

--- a/lisp/gnus/nntp.el
+++ b/lisp/gnus/nntp.el	2015-01-13 15:48:37 +0000
@@ -1282,11 +1283,12 @@ defun nntp-open-connection (buffer)
 		     :end-of-command "^\\([2345]\\|[.]\\).*\n"
 		     :capability-command "HELP\r\n"
 		     :success "^3"
-		     :starttls-function
-		     (lambda (capabilities)
-		       (if (not (string-match "STARTTLS" capabilities))
-			   nil
-			 "STARTTLS\r\n")))
+		     ; :starttls-function
+		     ; (lambda (capabilities)
+		     ;   (if (not (string-match "STARTTLS" capabilities))
+		     ; 	   nil
+		     ; 	 "STARTTLS\r\n"))
+		     )
 		  (funcall nntp-open-connection-function pbuffer)))
 	    (error
 	     (nnheader-report 'nntp ">>> %s" err))

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: Type: text/diff, Size: 405 bytes --]

--- a/lisp/url/url-news.el	2015-01-01 22:26:41 +0000
+++ b/lisp/url/url-news.el	2015-01-13 16:05:25 +0000
@@ -28,6 +28,9 @@
 (autoload 'url-warn "url")
 (autoload 'gnus-group-read-ephemeral-group "gnus-group")
 
+(defconst url-news-default-port 119 "Default NNTP port.")
+(defconst url-snews-default-port 563 "Default NNTPS port.")
+
 ;; Unused.
 ;;; (defgroup url-news nil
 ;;;   "News related options."

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-01-25 21:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-13 16:12 bug#19583: nntp-open-server: wrong buffer for nnoo-change-server; breaks url-news Ivan Shmakov
2015-01-13 17:28 ` Lars Magne Ingebrigtsen
2015-01-13 17:50   ` Ivan Shmakov
2015-02-14  5:24 ` Lars Ingebrigtsen
2015-02-14  5:31 ` Lars Ingebrigtsen
2015-02-14  7:05   ` Ivan Shmakov
2015-02-14 12:26     ` Lars Ingebrigtsen
2015-02-14 13:37       ` Ivan Shmakov
2015-02-15  4:45         ` Lars Ingebrigtsen
2015-02-15  5:42           ` Ivan Shmakov
2016-02-23 11:21             ` Lars Ingebrigtsen
2017-01-25 21:11               ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).