Function: tramp-get-buffer

tramp-get-buffer is a byte-compiled function defined in tramp.el.gz.

Signature

(tramp-get-buffer VEC &optional DONT-CREATE)

Documentation

Get the connection buffer to be used for VEC.

Unless DONT-CREATE, the buffer is created when it doesn't exist yet.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp.el.gz
(defun tramp-get-buffer (vec &optional dont-create)
  "Get the connection buffer to be used for VEC.
Unless DONT-CREATE, the buffer is created when it doesn't exist yet."
  (or (get-buffer (tramp-buffer-name vec))
      (unless dont-create
	(with-current-buffer (get-buffer-create (tramp-buffer-name vec))
	  ;; We use the existence of connection property " connected"
	  ;; as indication, whether a connection is active.  It keeps
	  ;; the connection buffer, for cleanup.
	  (tramp-set-connection-property
	   vec " connected"
	   (tramp-get-connection-property vec " process-buffer"))
	  (setq buffer-undo-list t
		default-directory
		(tramp-make-tramp-file-name vec 'noloc))
	  (current-buffer)))))