summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2023-07-08 15:43:41 +0200
committerMichael Albinus <michael.albinus@gmx.de>2023-07-08 15:43:41 +0200
commitdbac807605732426e75f1886c2f340d1194013c9 (patch)
tree4875da5753d73a5d9561b68f9951da7423e1b4b4 /lisp
parenta82486e5a4e1ea3abb5afb6f279b22c44f0218d8 (diff)
downloademacs-dbac807605732426e75f1886c2f340d1194013c9.tar.gz
* lisp/net/tramp.el (tramp-get-buffer-string): Stabilize.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/net/tramp.el9
1 files changed, 4 insertions, 5 deletions
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."