Commit d68b0220 authored by Michael Albinus's avatar Michael Albinus

* net/tramp.el (tramp-temp-buffer-file-name): Make it permanent-local.

(tramp-handle-insert-file-contents): Do not set permanent-local
property.

* net/tramp-cache.el (tramp-persistency-file-name): Use
`locate-user-emacs-file' if fboundp.

* net/tramp-sh.el (tramp-methods): Add "ksu".
(tramp-default-user-alist): Add "ksu".  Use `regexp-opt' for
method list.
parent 27625a58
2010-12-14 Michael Albinus <michael.albinus@gmx.de>
* net/tramp.el (tramp-temp-buffer-file-name): Make it permanent-local.
(tramp-handle-insert-file-contents): Do not set permanent-local
property.
* net/tramp-cache.el (tramp-persistency-file-name): Use
`locate-user-emacs-file' if fboundp.
* net/tramp-sh.el (tramp-methods): Add "ksu".
(tramp-default-user-alist): Add "ksu". Use `regexp-opt' for
method list.
2010-12-14 Glenn Morris <rgm@gnu.org> 2010-12-14 Glenn Morris <rgm@gnu.org>
* progmodes/js.el: Doc't require font-lock, etags, or easymenu. * progmodes/js.el: Doc't require font-lock, etags, or easymenu.
...@@ -49,7 +62,7 @@ ...@@ -49,7 +62,7 @@
2010-12-13 Michael Albinus <michael.albinus@gmx.de> 2010-12-13 Michael Albinus <michael.albinus@gmx.de>
* net/tramp.el (tramp-action-password, tramp-process-actions): * net/tramp.el (tramp-action-password, tramp-process-actions):
Revert patch from 2010-12-08. Use `save-restriction'. Revert previous from. Use `save-restriction'.
2010-12-13 Stephen Berman <stephen.berman@gmx.net> 2010-12-13 Stephen Berman <stephen.berman@gmx.net>
...@@ -64,6 +77,7 @@ ...@@ -64,6 +77,7 @@
* net/tramp.el (tramp-action-password): Delete region, do not narrow. * net/tramp.el (tramp-action-password): Delete region, do not narrow.
(tramp-process-actions): Do not widen. (tramp-process-actions): Do not widen.
* net/tramp-sh.el (tramp-sh-handle-start-file-process): * net/tramp-sh.el (tramp-sh-handle-start-file-process):
Protect buffer-modified value. (Bug#7557) Protect buffer-modified value. (Bug#7557)
......
...@@ -62,6 +62,8 @@ ...@@ -62,6 +62,8 @@
(defcustom tramp-persistency-file-name (defcustom tramp-persistency-file-name
(cond (cond
;; GNU Emacs. ;; GNU Emacs.
((and (fboundp 'locate-user-emacs-file))
(expand-file-name (tramp-compat-funcall 'locate-user-emacs-file "tramp")))
((and (boundp 'user-emacs-directory) ((and (boundp 'user-emacs-directory)
(stringp (symbol-value 'user-emacs-directory)) (stringp (symbol-value 'user-emacs-directory))
(file-directory-p (symbol-value 'user-emacs-directory))) (file-directory-p (symbol-value 'user-emacs-directory)))
...@@ -403,5 +405,4 @@ for all methods. Resulting data are derived from connection history." ...@@ -403,5 +405,4 @@ for all methods. Resulting data are derived from connection history."
(provide 'tramp-cache) (provide 'tramp-cache)
;; arch-tag: ee1739b7-7628-408c-9b96-d11a74b05d26
;;; tramp-cache.el ends here ;;; tramp-cache.el ends here
...@@ -305,6 +305,12 @@ detected as prompt when being sent on echoing hosts, therefore.") ...@@ -305,6 +305,12 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-login-args (("-u" "%u") ("-s") ("-H") ("-p" "Password:"))) (tramp-login-args (("-u" "%u") ("-s") ("-H") ("-p" "Password:")))
(tramp-remote-sh "/bin/sh"))) (tramp-remote-sh "/bin/sh")))
;;;###tramp-autoload ;;;###tramp-autoload
(add-to-list 'tramp-methods
'("ksu"
(tramp-login-program "ksu")
(tramp-login-args (("%u") ("-q")))
(tramp-remote-sh "/bin/sh")))
;;;###tramp-autoload
(add-to-list 'tramp-methods (add-to-list 'tramp-methods
'("krlogin" '("krlogin"
(tramp-login-program "krlogin") (tramp-login-program "krlogin")
...@@ -378,9 +384,16 @@ detected as prompt when being sent on echoing hosts, therefore.") ...@@ -378,9 +384,16 @@ detected as prompt when being sent on echoing hosts, therefore.")
`(,tramp-local-host-regexp "\\`root\\'" "su")) `(,tramp-local-host-regexp "\\`root\\'" "su"))
(add-to-list 'tramp-default-user-alist (add-to-list 'tramp-default-user-alist
'("\\`su\\(do\\)?\\'" nil "root")) `(,(concat "\\`" (regexp-opt '("su" "sudo" "ksu")) "\\'")
nil "root"))
(add-to-list 'tramp-default-user-alist (add-to-list 'tramp-default-user-alist
`("\\`r\\(em\\)?\\(cp\\|sh\\)\\|telnet\\|plink1?\\'" `(,(concat
"\\`"
(regexp-opt
'("rcp" "remcp" "scp" "scp1" "scp2" "scpc" "scpx" "sftp"
"rsync" "rsyncc" "rsh" "remsh" "ssh" "ssh1" "ssh2" "sshx"
"telnet" "krlogin" "plink" "plink1" "pscp" "psftp" "fcp"))
"\\'")
nil ,(user-login-name))) nil ,(user-login-name)))
(defconst tramp-completion-function-alist-rsh (defconst tramp-completion-function-alist-rsh
...@@ -437,6 +450,7 @@ detected as prompt when being sent on echoing hosts, therefore.") ...@@ -437,6 +450,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-set-completion-function "telnet" tramp-completion-function-alist-telnet) (tramp-set-completion-function "telnet" tramp-completion-function-alist-telnet)
(tramp-set-completion-function "su" tramp-completion-function-alist-su) (tramp-set-completion-function "su" tramp-completion-function-alist-su)
(tramp-set-completion-function "sudo" tramp-completion-function-alist-su) (tramp-set-completion-function "sudo" tramp-completion-function-alist-su)
(tramp-set-completion-function "ksu" tramp-completion-function-alist-su)
(tramp-set-completion-function "krlogin" tramp-completion-function-alist-rsh) (tramp-set-completion-function "krlogin" tramp-completion-function-alist-rsh)
(tramp-set-completion-function "plink" tramp-completion-function-alist-ssh) (tramp-set-completion-function "plink" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "plink1" tramp-completion-function-alist-ssh) (tramp-set-completion-function "plink1" tramp-completion-function-alist-ssh)
...@@ -2672,20 +2686,20 @@ the result will be a local, non-Tramp, filename." ...@@ -2672,20 +2686,20 @@ the result will be a local, non-Tramp, filename."
(narrow-to-region (point-max) (point-max)) (narrow-to-region (point-max) (point-max))
(if command (if command
;; Send the command. ;; Send the command.
(tramp-send-command v command nil t) ; nooutput (tramp-send-command v command nil t) ; nooutput
;; Check, whether a pty is associated. ;; Check, whether a pty is associated.
(tramp-maybe-open-connection v) (tramp-maybe-open-connection v)
(unless (tramp-compat-process-get (unless (tramp-compat-process-get
(tramp-get-connection-process v) 'remote-tty) (tramp-get-connection-process v) 'remote-tty)
(tramp-error (tramp-error
v 'file-error v 'file-error
"pty association is not supported for `%s'" name))))) "pty association is not supported for `%s'" name)))))
(let ((p (tramp-get-connection-process v))) (let ((p (tramp-get-connection-process v)))
;; Set sentinel and query flag for this process. ;; Set sentinel and query flag for this process.
(tramp-set-connection-property p "vector" v) (tramp-set-connection-property p "vector" v)
(set-process-sentinel p 'tramp-process-sentinel) (set-process-sentinel p 'tramp-process-sentinel)
(tramp-compat-set-process-query-on-exit-flag p t) (tramp-compat-set-process-query-on-exit-flag p t)
;; Return process. ;; Return process.
p))) p)))
;; Save exit. ;; Save exit.
(with-current-buffer (tramp-get-connection-buffer v) (with-current-buffer (tramp-get-connection-buffer v)
......
...@@ -603,6 +603,7 @@ It shall be used in combination with `generate-new-buffer-name'.") ...@@ -603,6 +603,7 @@ It shall be used in combination with `generate-new-buffer-name'.")
"File name of a persistent local temporary file. "File name of a persistent local temporary file.
Useful for \"rsync\" like methods.") Useful for \"rsync\" like methods.")
(make-variable-buffer-local 'tramp-temp-buffer-file-name) (make-variable-buffer-local 'tramp-temp-buffer-file-name)
(put 'tramp-temp-buffer-file-name 'permanent-local t)
;; XEmacs is distributed with few Lisp packages. Further packages are ;; XEmacs is distributed with few Lisp packages. Further packages are
;; installed using EFS. If we use a unified filename format, then ;; installed using EFS. If we use a unified filename format, then
...@@ -2842,8 +2843,8 @@ User is always nil." ...@@ -2842,8 +2843,8 @@ User is always nil."
(t (file-local-copy filename))))) (t (file-local-copy filename)))))
;; When the file is not readable for the owner, it ;; When the file is not readable for the owner, it
;; cannot be inserted, even it is redable for the group ;; cannot be inserted, even if it is readable for the
;; or for everybody. ;; group or for everybody.
(set-file-modes local-copy (tramp-compat-octal-to-decimal "0600")) (set-file-modes local-copy (tramp-compat-octal-to-decimal "0600"))
(when (and (null remote-copy) (when (and (null remote-copy)
...@@ -2851,8 +2852,7 @@ User is always nil." ...@@ -2851,8 +2852,7 @@ User is always nil."
method 'tramp-copy-keep-tmpfile)) method 'tramp-copy-keep-tmpfile))
;; We keep the local file for performance reasons, ;; We keep the local file for performance reasons,
;; useful for "rsync". ;; useful for "rsync".
(setq tramp-temp-buffer-file-name local-copy) (setq tramp-temp-buffer-file-name local-copy))
(put 'tramp-temp-buffer-file-name 'permanent-local t))
(with-progress-reporter (with-progress-reporter
v 3 (format "Inserting local temp file `%s'" local-copy) v 3 (format "Inserting local temp file `%s'" local-copy)
......
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