From 513d000c75b582edf9acef1c6df00ee2c382dcb9 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Wed, 26 Apr 2017 09:59:45 +0200 Subject: [PATCH] * lisp/net/tramp.el (tramp-set-connection-local-variables-for-buffer): New defun. --- lisp/net/tramp.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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." :user ,(tramp-file-name-user vec) :machine ,(tramp-file-name-host vec))))) +(defun tramp-set-connection-local-variables-for-buffer () + "Set connection-local variables in the current buffer. +If connection-local variables are not supported by this Emacs +version, the function does nothing." + (when (file-remote-p default-directory) + ;; `hack-connection-local-variables-apply' exists since Emacs 26.1. + (tramp-compat-funcall + 'hack-connection-local-variables-apply + `(:application tramp + :protocol ,(file-remote-p default-directory 'method) + :user ,(file-remote-p default-directory 'user) + :machine ,(file-remote-p default-directory 'host))))) + (defun tramp-debug-buffer-name (vec) "A name for the debug buffer for VEC." (let ((method (tramp-file-name-method vec)) -- 2.39.5