(open-tls-stream): Make it work with the 2nd argument BUFFER that is a string
authorKatsumi Yamaoka <yamaoka@jpl.org>
Fri, 18 Jul 2008 00:59:10 +0000 (00:59 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Fri, 18 Jul 2008 00:59:10 +0000 (00:59 +0000)
 but does not exist as a buffer object, as mentioned in the doc-string.

lisp/ChangeLog
lisp/net/tls.el

index 64c6a97..7782a13 100644 (file)
@@ -1,3 +1,9 @@
+2008-07-18  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * net/tls.el (open-tls-stream): Make it work with the 2nd argument
+       BUFFER that is a string but does not exist as a buffer object, as
+       mentioned in the doc-string.
+
 2008-07-17  Chong Yidong  <cyd@stupidchicken.com>
 
        * simple.el (line-move-visual): Make it a defcustom.
index 3044cb4..64d113a 100644 (file)
@@ -216,7 +216,11 @@ Fourth arg PORT is an integer specifying a port to connect to."
        (use-temp-buffer (null buffer))
        process cmd done)
     (if use-temp-buffer
-       (setq buffer (generate-new-buffer " TLS")))
+       (setq buffer (generate-new-buffer " TLS"))
+      ;; BUFFER is a string but does not exist as a buffer object.
+      (unless (and (get-buffer buffer)
+                  (buffer-name (get-buffer buffer)))
+       (generate-new-buffer buffer)))
     (with-current-buffer buffer
       (message "Opening TLS connection to `%s'..." host)
       (while (and (not done) (setq cmd (pop cmds)))