aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2010-12-14 21:33:33 +0100
committerMichael Albinus2010-12-14 21:33:33 +0100
commitd68b02203ee499f51f3dcb7703e426d971cda664 (patch)
treeabf6792b2a842c055eb2554b8885faa557eb0c34
parent27625a584c4571c3d505945103b27539d08a6ccb (diff)
downloademacs-d68b02203ee499f51f3dcb7703e426d971cda664.tar.gz
emacs-d68b02203ee499f51f3dcb7703e426d971cda664.zip
* 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.
-rw-r--r--lisp/ChangeLog16
-rw-r--r--lisp/net/tramp-cache.el3
-rw-r--r--lisp/net/tramp-sh.el42
-rw-r--r--lisp/net/tramp.el8
4 files changed, 49 insertions, 20 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 083b1b0f924..ed8358a0d61 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,16 @@
12010-12-14 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/tramp.el (tramp-temp-buffer-file-name): Make it permanent-local.
4 (tramp-handle-insert-file-contents): Do not set permanent-local
5 property.
6
7 * net/tramp-cache.el (tramp-persistency-file-name): Use
8 `locate-user-emacs-file' if fboundp.
9
10 * net/tramp-sh.el (tramp-methods): Add "ksu".
11 (tramp-default-user-alist): Add "ksu". Use `regexp-opt' for
12 method list.
13
12010-12-14 Glenn Morris <rgm@gnu.org> 142010-12-14 Glenn Morris <rgm@gnu.org>
2 15
3 * progmodes/js.el: Doc't require font-lock, etags, or easymenu. 16 * progmodes/js.el: Doc't require font-lock, etags, or easymenu.
@@ -49,7 +62,7 @@
492010-12-13 Michael Albinus <michael.albinus@gmx.de> 622010-12-13 Michael Albinus <michael.albinus@gmx.de>
50 63
51 * net/tramp.el (tramp-action-password, tramp-process-actions): 64 * net/tramp.el (tramp-action-password, tramp-process-actions):
52 Revert patch from 2010-12-08. Use `save-restriction'. 65 Revert previous from. Use `save-restriction'.
53 66
542010-12-13 Stephen Berman <stephen.berman@gmx.net> 672010-12-13 Stephen Berman <stephen.berman@gmx.net>
55 68
@@ -64,6 +77,7 @@
64 77
65 * net/tramp.el (tramp-action-password): Delete region, do not narrow. 78 * net/tramp.el (tramp-action-password): Delete region, do not narrow.
66 (tramp-process-actions): Do not widen. 79 (tramp-process-actions): Do not widen.
80
67 * net/tramp-sh.el (tramp-sh-handle-start-file-process): 81 * net/tramp-sh.el (tramp-sh-handle-start-file-process):
68 Protect buffer-modified value. (Bug#7557) 82 Protect buffer-modified value. (Bug#7557)
69 83
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index 7885d143cc2..8a6e9ab827f 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -62,6 +62,8 @@
62(defcustom tramp-persistency-file-name 62(defcustom tramp-persistency-file-name
63 (cond 63 (cond
64 ;; GNU Emacs. 64 ;; GNU Emacs.
65 ((and (fboundp 'locate-user-emacs-file))
66 (expand-file-name (tramp-compat-funcall 'locate-user-emacs-file "tramp")))
65 ((and (boundp 'user-emacs-directory) 67 ((and (boundp 'user-emacs-directory)
66 (stringp (symbol-value 'user-emacs-directory)) 68 (stringp (symbol-value 'user-emacs-directory))
67 (file-directory-p (symbol-value 'user-emacs-directory))) 69 (file-directory-p (symbol-value 'user-emacs-directory)))
@@ -403,5 +405,4 @@ for all methods. Resulting data are derived from connection history."
403 405
404(provide 'tramp-cache) 406(provide 'tramp-cache)
405 407
406;; arch-tag: ee1739b7-7628-408c-9b96-d11a74b05d26
407;;; tramp-cache.el ends here 408;;; tramp-cache.el ends here
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 92f6c2a0335..6bd3043a718 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -306,6 +306,12 @@ detected as prompt when being sent on echoing hosts, therefore.")
306 (tramp-remote-sh "/bin/sh"))) 306 (tramp-remote-sh "/bin/sh")))
307;;;###tramp-autoload 307;;;###tramp-autoload
308(add-to-list 'tramp-methods 308(add-to-list 'tramp-methods
309 '("ksu"
310 (tramp-login-program "ksu")
311 (tramp-login-args (("%u") ("-q")))
312 (tramp-remote-sh "/bin/sh")))
313;;;###tramp-autoload
314(add-to-list 'tramp-methods
309 '("krlogin" 315 '("krlogin"
310 (tramp-login-program "krlogin") 316 (tramp-login-program "krlogin")
311 (tramp-login-args (("%h") ("-l" "%u") ("-x"))) 317 (tramp-login-args (("%h") ("-l" "%u") ("-x")))
@@ -378,9 +384,16 @@ detected as prompt when being sent on echoing hosts, therefore.")
378 `(,tramp-local-host-regexp "\\`root\\'" "su")) 384 `(,tramp-local-host-regexp "\\`root\\'" "su"))
379 385
380(add-to-list 'tramp-default-user-alist 386(add-to-list 'tramp-default-user-alist
381 '("\\`su\\(do\\)?\\'" nil "root")) 387 `(,(concat "\\`" (regexp-opt '("su" "sudo" "ksu")) "\\'")
388 nil "root"))
382(add-to-list 'tramp-default-user-alist 389(add-to-list 'tramp-default-user-alist
383 `("\\`r\\(em\\)?\\(cp\\|sh\\)\\|telnet\\|plink1?\\'" 390 `(,(concat
391 "\\`"
392 (regexp-opt
393 '("rcp" "remcp" "scp" "scp1" "scp2" "scpc" "scpx" "sftp"
394 "rsync" "rsyncc" "rsh" "remsh" "ssh" "ssh1" "ssh2" "sshx"
395 "telnet" "krlogin" "plink" "plink1" "pscp" "psftp" "fcp"))
396 "\\'")
384 nil ,(user-login-name))) 397 nil ,(user-login-name)))
385 398
386(defconst tramp-completion-function-alist-rsh 399(defconst tramp-completion-function-alist-rsh
@@ -437,6 +450,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
437(tramp-set-completion-function "telnet" tramp-completion-function-alist-telnet) 450(tramp-set-completion-function "telnet" tramp-completion-function-alist-telnet)
438(tramp-set-completion-function "su" tramp-completion-function-alist-su) 451(tramp-set-completion-function "su" tramp-completion-function-alist-su)
439(tramp-set-completion-function "sudo" tramp-completion-function-alist-su) 452(tramp-set-completion-function "sudo" tramp-completion-function-alist-su)
453(tramp-set-completion-function "ksu" tramp-completion-function-alist-su)
440(tramp-set-completion-function "krlogin" tramp-completion-function-alist-rsh) 454(tramp-set-completion-function "krlogin" tramp-completion-function-alist-rsh)
441(tramp-set-completion-function "plink" tramp-completion-function-alist-ssh) 455(tramp-set-completion-function "plink" tramp-completion-function-alist-ssh)
442(tramp-set-completion-function "plink1" tramp-completion-function-alist-ssh) 456(tramp-set-completion-function "plink1" tramp-completion-function-alist-ssh)
@@ -2672,20 +2686,20 @@ the result will be a local, non-Tramp, filename."
2672 (narrow-to-region (point-max) (point-max)) 2686 (narrow-to-region (point-max) (point-max))
2673 (if command 2687 (if command
2674 ;; Send the command. 2688 ;; Send the command.
2675 (tramp-send-command v command nil t) ; nooutput 2689 (tramp-send-command v command nil t) ; nooutput
2676 ;; Check, whether a pty is associated. 2690 ;; Check, whether a pty is associated.
2677 (tramp-maybe-open-connection v) 2691 (tramp-maybe-open-connection v)
2678 (unless (tramp-compat-process-get 2692 (unless (tramp-compat-process-get
2679 (tramp-get-connection-process v) 'remote-tty) 2693 (tramp-get-connection-process v) 'remote-tty)
2680 (tramp-error 2694 (tramp-error
2681 v 'file-error 2695 v 'file-error
2682 "pty association is not supported for `%s'" name))))) 2696 "pty association is not supported for `%s'" name)))))
2683 (let ((p (tramp-get-connection-process v))) 2697 (let ((p (tramp-get-connection-process v)))
2684 ;; Set sentinel and query flag for this process. 2698 ;; Set sentinel and query flag for this process.
2685 (tramp-set-connection-property p "vector" v) 2699 (tramp-set-connection-property p "vector" v)
2686 (set-process-sentinel p 'tramp-process-sentinel) 2700 (set-process-sentinel p 'tramp-process-sentinel)
2687 (tramp-compat-set-process-query-on-exit-flag p t) 2701 (tramp-compat-set-process-query-on-exit-flag p t)
2688 ;; Return process. 2702 ;; Return process.
2689 p))) 2703 p)))
2690 ;; Save exit. 2704 ;; Save exit.
2691 (with-current-buffer (tramp-get-connection-buffer v) 2705 (with-current-buffer (tramp-get-connection-buffer v)
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index abcb6ae7d77..79f184efc25 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -603,6 +603,7 @@ It shall be used in combination with `generate-new-buffer-name'.")
603 "File name of a persistent local temporary file. 603 "File name of a persistent local temporary file.
604Useful for \"rsync\" like methods.") 604Useful for \"rsync\" like methods.")
605(make-variable-buffer-local 'tramp-temp-buffer-file-name) 605(make-variable-buffer-local 'tramp-temp-buffer-file-name)
606(put 'tramp-temp-buffer-file-name 'permanent-local t)
606 607
607;; XEmacs is distributed with few Lisp packages. Further packages are 608;; XEmacs is distributed with few Lisp packages. Further packages are
608;; installed using EFS. If we use a unified filename format, then 609;; installed using EFS. If we use a unified filename format, then
@@ -2842,8 +2843,8 @@ User is always nil."
2842 (t (file-local-copy filename))))) 2843 (t (file-local-copy filename)))))
2843 2844
2844 ;; When the file is not readable for the owner, it 2845 ;; When the file is not readable for the owner, it
2845 ;; cannot be inserted, even it is redable for the group 2846 ;; cannot be inserted, even if it is readable for the
2846 ;; or for everybody. 2847 ;; group or for everybody.
2847 (set-file-modes local-copy (tramp-compat-octal-to-decimal "0600")) 2848 (set-file-modes local-copy (tramp-compat-octal-to-decimal "0600"))
2848 2849
2849 (when (and (null remote-copy) 2850 (when (and (null remote-copy)
@@ -2851,8 +2852,7 @@ User is always nil."
2851 method 'tramp-copy-keep-tmpfile)) 2852 method 'tramp-copy-keep-tmpfile))
2852 ;; We keep the local file for performance reasons, 2853 ;; We keep the local file for performance reasons,
2853 ;; useful for "rsync". 2854 ;; useful for "rsync".
2854 (setq tramp-temp-buffer-file-name local-copy) 2855 (setq tramp-temp-buffer-file-name local-copy))
2855 (put 'tramp-temp-buffer-file-name 'permanent-local t))
2856 2856
2857 (with-progress-reporter 2857 (with-progress-reporter
2858 v 3 (format "Inserting local temp file `%s'" local-copy) 2858 v 3 (format "Inserting local temp file `%s'" local-copy)