aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/shell.el
diff options
context:
space:
mode:
authorMichael Albinus2019-03-23 09:55:04 +0100
committerMichael Albinus2019-03-23 09:55:04 +0100
commita3194e7b7654134a51bc066dbf91cf59c3ce393d (patch)
treed8dba7e07759168304f85f031b63429c9ce06c39 /lisp/shell.el
parent86c3cd99bff27e35e25dec0ee3f0dc4536b171ea (diff)
downloademacs-a3194e7b7654134a51bc066dbf91cf59c3ce393d.tar.gz
emacs-a3194e7b7654134a51bc066dbf91cf59c3ce393d.zip
Fix Bug#34943
* lisp/files-x.el (cl-lib): Require when compiling. (hack-connection-local-variables): Regard connection-local variables as safe. (Bug#34943) * lisp/shell.el (shell): Use `with-connection-local-variables' for the whole code block. (Bug#34943) * lisp/net/tramp-adb.el (tramp-connection-local-safe-shell-file-names): Do not set values. * lisp/net/tramp-integration.el (tramp-connection-local-safe-shell-file-names): Remove. (shell-file-name, shell-command-switch): Do not add safe-local-variable property. * lisp/net/tramp.el (tramp-handle-shell-command): Use proper buffer name. * test/lisp/net/tramp-tests.el (tramp-test34-explicit-shell-file-name): Tag it :unstable.
Diffstat (limited to 'lisp/shell.el')
-rw-r--r--lisp/shell.el46
1 files changed, 23 insertions, 23 deletions
diff --git a/lisp/shell.el b/lisp/shell.el
index 264981bd435..53570272111 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -721,9 +721,9 @@ Otherwise, one argument `-i' is passed to the shell.
721 (current-buffer))) 721 (current-buffer)))
722 722
723 (with-current-buffer buffer 723 (with-current-buffer buffer
724 (when (file-remote-p default-directory) 724 (with-connection-local-variables
725 ;; On remote hosts, the local `shell-file-name' might be useless. 725 ;; On remote hosts, the local `shell-file-name' might be useless.
726 (with-connection-local-variables 726 (when (file-remote-p default-directory)
727 (if (and (called-interactively-p 'any) 727 (if (and (called-interactively-p 'any)
728 (null explicit-shell-file-name) 728 (null explicit-shell-file-name)
729 (null (getenv "ESHELL"))) 729 (null (getenv "ESHELL")))
@@ -732,26 +732,26 @@ Otherwise, one argument `-i' is passed to the shell.
732 (expand-file-name 732 (expand-file-name
733 (read-file-name 733 (read-file-name
734 "Remote shell path: " default-directory shell-file-name 734 "Remote shell path: " default-directory shell-file-name
735 t shell-file-name)))))))) 735 t shell-file-name))))))
736 736
737 ;; 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
738 ;; (so that comint sets the COLUMNS env var properly). 738 ;; (so that comint sets the COLUMNS env var properly).
739 (pop-to-buffer buffer) 739 (pop-to-buffer buffer)
740 ;; Rain or shine, BUFFER must be current by now. 740 ;; Rain or shine, BUFFER must be current by now.
741 (unless (comint-check-proc buffer) 741 (unless (comint-check-proc buffer)
742 (let* ((prog (or explicit-shell-file-name 742 (let* ((prog (or explicit-shell-file-name
743 (getenv "ESHELL") shell-file-name)) 743 (getenv "ESHELL") shell-file-name))
744 (name (file-name-nondirectory prog)) 744 (name (file-name-nondirectory prog))
745 (startfile (concat "~/.emacs_" name)) 745 (startfile (concat "~/.emacs_" name))
746 (xargs-name (intern-soft (concat "explicit-" name "-args")))) 746 (xargs-name (intern-soft (concat "explicit-" name "-args"))))
747 (unless (file-exists-p startfile) 747 (unless (file-exists-p startfile)
748 (setq startfile (concat user-emacs-directory "init_" name ".sh"))) 748 (setq startfile (concat user-emacs-directory "init_" name ".sh")))
749 (apply #'make-comint-in-buffer "shell" buffer prog 749 (apply #'make-comint-in-buffer "shell" buffer prog
750 (if (file-exists-p startfile) startfile) 750 (if (file-exists-p startfile) startfile)
751 (if (and xargs-name (boundp xargs-name)) 751 (if (and xargs-name (boundp xargs-name))
752 (symbol-value xargs-name) 752 (symbol-value xargs-name)
753 '("-i"))) 753 '("-i")))
754 (shell-mode))) 754 (shell-mode)))))
755 buffer) 755 buffer)
756 756
757;;; Directory tracking 757;;; Directory tracking