aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/shell.el
diff options
context:
space:
mode:
authorMichael Albinus2019-03-09 16:44:24 +0100
committerMichael Albinus2019-03-09 16:44:24 +0100
commit21f54feee8c83e2c5fd8eeb6741cbd479a7b19eb (patch)
tree3edf223c49dfedf09ec93804856954a9554a93cd /lisp/shell.el
parentc37bdd00c7dcabaa3ca8405d9dc5122ed36f27e0 (diff)
downloademacs-21f54feee8c83e2c5fd8eeb6741cbd479a7b19eb.tar.gz
emacs-21f54feee8c83e2c5fd8eeb6741cbd479a7b19eb.zip
Do not hardcode "/bin/sh" in compile. Bug#24338, Bug#29723
* doc/emacs/custom.texi (Connection Variables): New node. * doc/emacs/emacs.texi (Top): Add entry for Connection Variables. * doc/emacs/misc.texi (Single Shell): Mention default value for remote buffers. * doc/lispref/variables.texi (Connection Local Variables): Describe `with-connection-local-variables' instead of `with-connection-local-profiles'. * doc/misc/tramp.texi (Remote processes): Refer to Emacs manual. Mention default connection-local settings for `shell-file-name' and `shell-command-switch'. * etc/NEWS: Mention connection-local variables changes. * lisp/files-x.el (hack-connection-local-variables): Push connection-local variables to `file-local-variables-alist'. (connection-local-criteria-for-default-directory): New defsubst. (with-connection-local-variables): Rename from `with-connection-local-profiles'. Adapt implementation. * lisp/files.el (hack-local-variables): Call `hack-connection-local-variables'. * lisp/shell.el (shell): Use `with-connection-local-variables'. * lisp/subr.el (start-file-process-shell-command): * lisp/progmodes/compile.el (compilation-start): Use `with-connection-local-variables'. Do not set "/bin/sh" for remote buffers, trust settings of `shell-file-name'. (Bug#24338), (Bug#29723) * lisp/net/ange-ftp.el (ange-ftp-compress, ange-ftp-uncompress): Use `shell-command-switch'. * lisp/net/tramp-adb.el (tramp-adb-connection-local-default-profile): New defvar. Add it to connection-local profiles after loading "shell". * lisp/net/tramp-integration.el (tramp-compat): Require tramp-compat. (tramp-compat-exec-path): Do not declare anymore. (tramp-connection-local-safe-shell-file-names): New defvar. (tramp-connection-local-default-profile): New defconst. Activate it after loading "shell". (shell-file-name, shell-command-switch): Add safe-local-variable property. * lisp/net/tramp-sh.el (tramp-display-escape-sequence-regexp): Add tramp-autoload cookie. * test/lisp/files-x-tests.el (remote-shell-file-name): Add safe-local-variable property to remote-* variables. (tramp-connection-local-default-profile): Declare. (files-x-test-with-connection-local-variables): Rename from `files-x-test-with-connection-local-profiles'. Adapt implementation. * test/lisp/net/tramp-tests.el (tramp-test34-connection-local-variables): New test. (tramp-test34-explicit-shell-file-name): Run it also for tramp-adb. Bind connection-local-{profile,criteria}-alist. Use tramp-adb specific `shell-file-name'. Add safe-local-variable property to `explicit-shell-file-name' and `explicit-sh-args'.
Diffstat (limited to 'lisp/shell.el')
-rw-r--r--lisp/shell.el27
1 files changed, 11 insertions, 16 deletions
diff --git a/lisp/shell.el b/lisp/shell.el
index 524a8848840..8a2d4489b8a 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -99,6 +99,7 @@
99 99
100(require 'comint) 100(require 'comint)
101(require 'pcomplete) 101(require 'pcomplete)
102(eval-when-compile (require 'files-x)) ;with-connection-local-variables
102 103
103;;; Customization and Buffer Variables 104;;; Customization and Buffer Variables
104 105
@@ -721,23 +722,17 @@ Otherwise, one argument `-i' is passed to the shell.
721 722
722 (with-current-buffer buffer 723 (with-current-buffer buffer
723 (when (file-remote-p default-directory) 724 (when (file-remote-p default-directory)
724 ;; Apply connection-local variables.
725 (hack-connection-local-variables-apply
726 `(:application tramp
727 :protocol ,(file-remote-p default-directory 'method)
728 :user ,(file-remote-p default-directory 'user)
729 :machine ,(file-remote-p default-directory 'host)))
730
731 ;; On remote hosts, the local `shell-file-name' might be useless. 725 ;; On remote hosts, the local `shell-file-name' might be useless.
732 (if (and (called-interactively-p 'any) 726 (with-connection-local-variables
733 (null explicit-shell-file-name) 727 (if (and (called-interactively-p 'any)
734 (null (getenv "ESHELL"))) 728 (null explicit-shell-file-name)
735 (set (make-local-variable 'explicit-shell-file-name) 729 (null (getenv "ESHELL")))
736 (file-local-name 730 (set (make-local-variable 'explicit-shell-file-name)
737 (expand-file-name 731 (file-local-name
738 (read-file-name 732 (expand-file-name
739 "Remote shell path: " default-directory shell-file-name 733 (read-file-name
740 t shell-file-name))))))) 734 "Remote shell path: " default-directory shell-file-name
735 t shell-file-name))))))))
741 736
742 ;; The buffer's window must be correctly set when we call comint 737 ;; The buffer's window must be correctly set when we call comint
743 ;; (so that comint sets the COLUMNS env var properly). 738 ;; (so that comint sets the COLUMNS env var properly).