diff options
| author | Michael Albinus | 2017-04-26 09:59:45 +0200 |
|---|---|---|
| committer | Michael Albinus | 2017-04-26 09:59:45 +0200 |
| commit | 513d000c75b582edf9acef1c6df00ee2c382dcb9 (patch) | |
| tree | c95c09cb951e638d3b0c863edb72f538d80a634a | |
| parent | 3a8388a7c6d3f52df5b33d9aa2bdac11711d968b (diff) | |
| download | emacs-513d000c75b582edf9acef1c6df00ee2c382dcb9.tar.gz emacs-513d000c75b582edf9acef1c6df00ee2c382dcb9.zip | |
* lisp/net/tramp.el (tramp-set-connection-local-variables-for-buffer):
New defun.
| -rw-r--r-- | lisp/net/tramp.el | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 9b80c596a3a..56a7b377124 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -1410,6 +1410,19 @@ version, the function does nothing." | |||
| 1410 | :user ,(tramp-file-name-user vec) | 1410 | :user ,(tramp-file-name-user vec) |
| 1411 | :machine ,(tramp-file-name-host vec))))) | 1411 | :machine ,(tramp-file-name-host vec))))) |
| 1412 | 1412 | ||
| 1413 | (defun tramp-set-connection-local-variables-for-buffer () | ||
| 1414 | "Set connection-local variables in the current buffer. | ||
| 1415 | If connection-local variables are not supported by this Emacs | ||
| 1416 | version, the function does nothing." | ||
| 1417 | (when (file-remote-p default-directory) | ||
| 1418 | ;; `hack-connection-local-variables-apply' exists since Emacs 26.1. | ||
| 1419 | (tramp-compat-funcall | ||
| 1420 | 'hack-connection-local-variables-apply | ||
| 1421 | `(:application tramp | ||
| 1422 | :protocol ,(file-remote-p default-directory 'method) | ||
| 1423 | :user ,(file-remote-p default-directory 'user) | ||
| 1424 | :machine ,(file-remote-p default-directory 'host))))) | ||
| 1425 | |||
| 1413 | (defun tramp-debug-buffer-name (vec) | 1426 | (defun tramp-debug-buffer-name (vec) |
| 1414 | "A name for the debug buffer for VEC." | 1427 | "A name for the debug buffer for VEC." |
| 1415 | (let ((method (tramp-file-name-method vec)) | 1428 | (let ((method (tramp-file-name-method vec)) |