diff options
Diffstat (limited to 'lisp/net')
| -rw-r--r-- | lisp/net/browse-url.el | 3 | ||||
| -rw-r--r-- | lisp/net/tramp-sh.el | 52 |
2 files changed, 35 insertions, 20 deletions
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 893bfa487e3..4364490f431 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -1340,6 +1340,9 @@ used instead of `browse-url-new-window-flag'." (kill-buffer nil))) (if (and pid (zerop (signal-process pid 0))) ; Mosaic running (save-excursion + ;; This is a predictable temp-file name, which is bad, + ;; but it is what Mosaic uses/used. + ;; So it's not Emacs's problem. http://bugs.debian.org/747100 (find-file (format "/tmp/Mosaic.%d" pid)) (erase-buffer) (insert (if (browse-url-maybe-new-window new-window) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 9c86c8c48bd..900e1c812ae 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -425,7 +425,7 @@ as given in your `~/.profile'." ;;;###tramp-autoload (defcustom tramp-remote-process-environment - `("HISTFILE=$HOME/.tramp_history" "HISTSIZE=1" "TMOUT=0" "LC_CTYPE=''" + `("TMOUT=0" "LC_CTYPE=''" ,(format "TERM=%s" tramp-terminal-type) "EMACS=t" ;; Deprecated. ,(format "INSIDE_EMACS='%s,tramp:%s'" emacs-version tramp-version) @@ -440,6 +440,7 @@ which might have been set in the init files like ~/.profile. Special handling is applied to the PATH environment, which should not be set here. Instead, it should be set via `tramp-remote-path'." :group 'tramp + :version "24.4" :type '(repeat string)) (defcustom tramp-sh-extra-args '(("/bash\\'" . "-norc -noprofile")) @@ -491,9 +492,9 @@ This list is used for copying/renaming with out-of-band methods. See `tramp-actions-before-shell' for more info.") (defconst tramp-uudecode - "(echo begin 600 /tmp/tramp.$$; tail +2) | uudecode -cat /tmp/tramp.$$ -rm -f /tmp/tramp.$$" + "(echo begin 600 %t; tail -n +2) | uudecode +cat %t +rm -f %t" "Shell function to implement `uudecode' to standard output. Many systems support `uudecode -o /dev/stdout' or `uudecode -o -' for this or `uudecode -p', but some systems don't, and for them @@ -3726,8 +3727,7 @@ file exists and nonzero exit status otherwise." (with-tramp-progress-reporter vec 5 (format "Opening remote shell `%s'" shell) ;; Find arguments for this shell. - (let ((tramp-end-of-output tramp-initial-end-of-output) - (alist tramp-sh-extra-args) + (let ((alist tramp-sh-extra-args) item extra-args) (while (and alist (null extra-args)) (setq item (pop alist)) @@ -3735,18 +3735,12 @@ file exists and nonzero exit status otherwise." (setq extra-args (cdr item)))) (tramp-send-command vec (format - "exec env ENV='' PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s %s" + "exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s %s" (tramp-shell-quote-argument tramp-end-of-output) shell (or extra-args "")) t)) (tramp-set-connection-property - (tramp-get-connection-process vec) "remote-shell" shell) - ;; Setting prompts. - (tramp-send-command - vec (format "PS1=%s" (tramp-shell-quote-argument tramp-end-of-output)) t) - (tramp-send-command vec "PS2=''" t) - (tramp-send-command vec "PS3=''" t) - (tramp-send-command vec "PROMPT_COMMAND=''" t))) + (tramp-get-connection-process vec) "remote-shell" shell))) (defun tramp-find-shell (vec) "Opens a shell on the remote host which groks tilde expansion." @@ -4045,7 +4039,7 @@ Each item is a list that looks like this: \(FORMAT ENCODING DECODING [TEST]\) -FORMAT is symbol describing the encoding/decoding format. It can be +FORMAT is a symbol describing the encoding/decoding format. It can be `b64' for base64 encoding, `uu' for uu encoding, or `pack' for simple packing. ENCODING and DECODING can be strings, giving commands, or symbols, @@ -4055,9 +4049,11 @@ filename will be put into the command line at that spot. If the specifier is not present, the input should be read from standard input. -If they are variables, this variable is a string containing a Perl -implementation for this functionality. This Perl program will be transferred -to the remote host, and it is available as shell function with the same name. +If they are variables, this variable is a string containing a +Perl or Shell implementation for this functionality. This +program will be transferred to the remote host, and it is +available as shell function with the same name. A \"%t\" format +specifier in the variable value denotes a temporary file. The optional TEST command can be used for further tests, whether ENCODING and DECODING are applicable.") @@ -4136,10 +4132,25 @@ Goes through the list `tramp-local-coding-commands' and (throw 'wont-work-remote nil)) (when (not (stringp rem-dec)) - (let ((name (symbol-name rem-dec))) + (let ((name (symbol-name rem-dec)) + (value (symbol-value rem-dec)) + tmpfile) (while (string-match (regexp-quote "-") name) (setq name (replace-match "_" nil t name))) - (tramp-maybe-send-script vec (symbol-value rem-dec) name) + (when (string-match "%t" value) + (setq tmpfile + (make-temp-name + (expand-file-name + tramp-temp-name-prefix + (tramp-get-remote-tmpdir vec))) + value + (format-spec + value + (format-spec-make + ?t + (tramp-file-name-handler + 'file-remote-p tmpfile 'localname))))) + (tramp-maybe-send-script vec value name) (setq rem-dec name))) (tramp-message vec 5 @@ -4456,6 +4467,7 @@ connection if a previous connection has died for some reason." (delete-process p)) (setenv "TERM" tramp-terminal-type) (setenv "LC_ALL" "en_US.utf8") + (setenv "HISTFILE" "/dev/null") (setenv "PROMPT_COMMAND") (setenv "PS1" tramp-initial-end-of-output) (let* ((target-alist (tramp-compute-multi-hops vec)) |
