summaryrefslogtreecommitdiff
path: root/lisp/net/tramp-integration.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2020-11-21 15:28:52 +0100
committerMichael Albinus <michael.albinus@gmx.de>2020-11-21 15:28:52 +0100
commit789ee3e1d55a86b9ce38d1374c0e01d04f97eb7d (patch)
tree4c52079602b78a31cbdbc529ee191251a86f65db /lisp/net/tramp-integration.el
parent2c7687738d0b7da60014a7af05ab199936617d71 (diff)
downloademacs-789ee3e1d55a86b9ce38d1374c0e01d04f97eb7d.tar.gz
Handle connection-local null-device and path-separator variables
* doc/lispref/os.texi (System Environment): Add `path-separator' function and `null-device' variable and function. * etc/NEWS: Mention 'null-device' and 'path-separator'. Fix typos. * lisp/files-x.el (path-separator, null-device): New defuns. (Bug#3736) * lisp/net/tramp-adb.el (tramp-adb-connection-local-default-shell-variables): Rename from `tramp-adb-connection-local-default-profile'. * lisp/net/tramp-integration.el (tramp-connection-local-default-system-variables): New defvar. Add it to connection-local profiles. (tramp-connection-local-default-shell-variables): Rename from `tramp-connection-local-default-profile'. * lisp/progmodes/grep.el (grep-hello-file): New defun. (grep-compute-defaults): Use `null-device' function for remote case. Handle remote `hello-file'. Use `process-file-shell-command'. (grep,grep-expand-keywords, lgrep): Use `null-device' function for remote case.
Diffstat (limited to 'lisp/net/tramp-integration.el')
-rw-r--r--lisp/net/tramp-integration.el34
1 files changed, 25 insertions, 9 deletions
diff --git a/lisp/net/tramp-integration.el b/lisp/net/tramp-integration.el
index 7e4a9bf05e5..566c673af16 100644
--- a/lisp/net/tramp-integration.el
+++ b/lisp/net/tramp-integration.el
@@ -262,23 +262,39 @@ NAME must be equal to `tramp-current-connection'."
(info-lookup->topic-cache 'symbol))))))))
;;; Default connection-local variables for Tramp:
+;; `connection-local-set-profile-variables' and
+;; `connection-local-set-profiles' exists since Emacs 26.1.
+
+(defconst tramp-connection-local-default-system-variables
+ '((path-separator . ":")
+ (null-device . "/dev/null"))
+ "Default connection-local system variables for remote connections.")
+
+(tramp-compat-funcall
+ 'connection-local-set-profile-variables
+ 'tramp-connection-local-default-system-profile
+ tramp-connection-local-default-system-variables)
+
+(tramp-compat-funcall
+ 'connection-local-set-profiles
+ `(:application tramp)
+ 'tramp-connection-local-default-system-profile)
-(defconst tramp-connection-local-default-profile
+(defconst tramp-connection-local-default-shell-variables
'((shell-file-name . "/bin/sh")
(shell-command-switch . "-c"))
- "Default connection-local variables for remote connections.")
+ "Default connection-local shell variables for remote connections.")
+
+(tramp-compat-funcall
+ 'connection-local-set-profile-variables
+ 'tramp-connection-local-default-shell-profile
+ tramp-connection-local-default-shell-variables)
-;; `connection-local-set-profile-variables' and
-;; `connection-local-set-profiles' exists since Emacs 26.1.
(with-eval-after-load 'shell
(tramp-compat-funcall
- 'connection-local-set-profile-variables
- 'tramp-connection-local-default-profile
- tramp-connection-local-default-profile)
- (tramp-compat-funcall
'connection-local-set-profiles
`(:application tramp)
- 'tramp-connection-local-default-profile))
+ 'tramp-connection-local-default-shell-profile))
(add-hook 'tramp-unload-hook
(lambda () (unload-feature 'tramp-integration 'force)))