]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/net/tramp.el (tramp-get-buffer-string): Stabilize.
authorMichael Albinus <michael.albinus@gmx.de>
Sat, 8 Jul 2023 13:43:41 +0000 (15:43 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Sat, 8 Jul 2023 13:43:41 +0000 (15:43 +0200)
lisp/net/tramp.el

index 20678ec8d1ac0befc1475bd65f4902e92ed88813..29361f8a113104dfc4fcf0d7db0fe1ce3d81cc48 100644 (file)
@@ -1960,11 +1960,10 @@ version, the function does nothing."
   "Return contents of BUFFER.
 If BUFFER is not a buffer or a buffer name, return the contents
 of `current-buffer'."
-  (or (let ((buf (or buffer (current-buffer))))
-        (when (bufferp buf)
-          (with-current-buffer (or buffer (current-buffer))
-           (substring-no-properties (buffer-string)))))
-      ""))
+  (with-current-buffer
+      (if (or (bufferp buffer) (and (stringp buffer) (get-buffer buffer)))
+         buffer (current-buffer))
+    (substring-no-properties (buffer-string))))
 
 (defun tramp-debug-buffer-name (vec)
   "A name for the debug buffer for VEC."