diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2023-07-08 15:43:41 +0200 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2023-07-08 15:43:41 +0200 |
commit | dbac807605732426e75f1886c2f340d1194013c9 (patch) | |
tree | 4875da5753d73a5d9561b68f9951da7423e1b4b4 /lisp/net | |
parent | a82486e5a4e1ea3abb5afb6f279b22c44f0218d8 (diff) | |
download | emacs-dbac807605732426e75f1886c2f340d1194013c9.tar.gz emacs-dbac807605732426e75f1886c2f340d1194013c9.tar.bz2 emacs-dbac807605732426e75f1886c2f340d1194013c9.zip |
* lisp/net/tramp.el (tramp-get-buffer-string): Stabilize.
Diffstat (limited to 'lisp/net')
-rw-r--r-- | lisp/net/tramp.el | 9 |
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." |