Commit 7ab3acf4 authored by Paul Eggert's avatar Paul Eggert

Merge from trunk.

parents 806add1d f5e29b9b
2011-09-04 Eli Zaretskii <>
* basic.texi (Inserting Text): Add index entries. (Bug#9433)
2011-08-29 Chong Yidong <>
* modes.texi (Choosing Modes): auto-mode-case-fold is now t.
......@@ -101,7 +101,9 @@ character to insert (@pxref{Arguments}).
@findex ucs-insert
@kindex C-x 8 RET
@cindex Unicode
@cindex Unicode characters, inserting
@cindex insert Unicode character
@cindex characters, inserting by name or code-point
Instead of @kbd{C-q}, you can use @kbd{C-x 8 @key{RET}}
(@code{ucs-insert}) to insert a character based on its Unicode name or
code-point. This command prompts for a character to insert, using
2011-09-04 Michael Albinus <>
* net/tramp.el (top): Require 'shell. Use `tramp-unload-hook' but
`tramp-cache-unload-hook' where appropriate.
(tramp-methods): Rename `tramp-remote-sh' to
`tramp-remote-shell'. Add `tramp-remote-shell-args'.
(tramp-handle-shell-command): New defun, moved from tramp-sh.el.
* net/tramp-sh.el (top): Don't require 'shell.
(tramp-methods): Add `tramp-remote-shell' and
`tramp-remote-shell-args' entries.
(tramp-sh-file-name-handler-alist): Use `tramp-handle-shell-command'.
(tramp-sh-handle-shell-command): Remove.
(tramp-find-shell, tramp-open-connection-setup-interactive-shell):
Use `tramp-remote-shell'.
2011-09-03 Chong Yidong <>
* mail/sendmail.el (sendmail-query-once-function): Deleted.
This diff is collapsed.
......@@ -58,6 +58,7 @@
;;; Code:
(require 'tramp-compat)
(require 'shell)
;;; User Customizable Internal Variables:
......@@ -190,13 +191,16 @@ See the variable `tramp-encoding-shell' for more information."
This is a list of entries of the form (NAME PARAM1 PARAM2 ...).
Each NAME stands for a remote access method. Each PARAM is a
pair of the form (KEY VALUE). The following KEYs are defined:
* `tramp-remote-sh'
* `tramp-remote-shell'
This specifies the Bourne shell to use on the remote host. This
MUST be a Bourne-like shell. It is normally not necessary to set
this to any value other than \"/bin/sh\": Tramp wants to use a shell
which groks tilde expansion, but it can search for it. Also note
that \"/bin/sh\" exists on all Unixen, this might not be true for
the value that you decide to use. You Have Been Warned.
* `tramp-remote-shell-args'
For implementation of `shell-command', this specifies the
argument to let `tramp-remote-shell' run a command.
* `tramp-login-program'
This specifies the name of the program to use for logging in to the
remote host. This may be the name of rsh or a workalike program,
......@@ -2959,6 +2963,92 @@ User is always nil."
(delete-file local-copy)))))
(defun tramp-handle-shell-command
(command &optional output-buffer error-buffer)
"Like `shell-command' for Tramp files."
(let* ((asynchronous (string-match "[ \t]*&[ \t]*\\'" command))
;; We cannot use `shell-file-name' and `shell-command-switch',
;; they are variables of the local host.
(args (append
(tramp-dissect-file-name default-directory))
(tramp-dissect-file-name default-directory))
(list (substring command 0 asynchronous))))
((bufferp output-buffer) output-buffer)
((stringp output-buffer) (get-buffer-create output-buffer))
(setq current-buffer-p t)
(t (get-buffer-create
(if asynchronous
"*Async Shell Command*"
"*Shell Command Output*")))))
((bufferp error-buffer) error-buffer)
((stringp error-buffer) (get-buffer-create error-buffer))))
(if (and (not asynchronous) error-buffer)
(with-parsed-tramp-file-name default-directory nil
(list output-buffer (tramp-make-tramp-temp-file v)))
(p (get-buffer-process output-buffer)))
;; Check whether there is another process running. Tramp does not
;; support 2 (asynchronous) processes in parallel.
(when p
(if (yes-or-no-p "A command is running. Kill it? ")
(ignore-errors (kill-process p))
(error "Shell command in progress")))
(if current-buffer-p
(push-mark nil t))
(with-current-buffer output-buffer
(setq buffer-read-only nil)
(if (and (not current-buffer-p) (integerp asynchronous))
;; Run the process.
(apply 'start-file-process "*Async Shell*" buffer args)
;; Display output.
(pop-to-buffer output-buffer)
(setq mode-line-process '(":%s"))
;; Run the process.
(apply 'process-file (car args) nil buffer nil (cdr args))
;; Insert error messages if they were separated.
(when (listp buffer)
(with-current-buffer error-buffer
(insert-file-contents (cadr buffer)))
(delete-file (cadr buffer)))
(if current-buffer-p
;; This is like exchange-point-and-mark, but doesn't
;; activate the mark. It is cleaner to avoid activation,
;; even though the command loop would deactivate the mark
;; because we inserted text.
(goto-char (prog1 (mark t)
(set-marker (mark-marker) (point)
;; There's some output, display it.
(when (with-current-buffer output-buffer (> (point-max) (point-min)))
(if (functionp 'display-message-or-buffer)
(tramp-compat-funcall 'display-message-or-buffer output-buffer)
(pop-to-buffer output-buffer))))))))
(defun tramp-handle-substitute-in-file-name (filename)
"Like `substitute-in-file-name' for Tramp files.
\"//\" and \"/~\" substitute only in the local filename part.
......@@ -3477,7 +3567,7 @@ Return the local name of the temporary file."
(ignore-errors (delete-file tramp-temp-buffer-file-name))))
(add-hook 'kill-buffer-hook 'tramp-delete-temp-file-function)
(add-hook 'tramp-cache-unload-hook
(add-hook 'tramp-unload-hook
(lambda ()
(remove-hook 'kill-buffer-hook
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment