From: Michael Albinus Date: Sat, 8 Jul 2023 13:43:41 +0000 (+0200) Subject: * lisp/net/tramp.el (tramp-get-buffer-string): Stabilize. X-Git-Tag: emacs-29.1-rc1~60 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=dbac807605732426e75f1886c2f340d1194013c9;p=emacs.git * lisp/net/tramp.el (tramp-get-buffer-string): Stabilize. --- diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 20678ec8d1a..29361f8a113 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -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."