diff options
Diffstat (limited to 'lisp/net/tramp-sudoedit.el')
| -rw-r--r-- | lisp/net/tramp-sudoedit.el | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el index d3bb8b8478e..9511c899b2b 100644 --- a/lisp/net/tramp-sudoedit.el +++ b/lisp/net/tramp-sudoedit.el | |||
| @@ -52,6 +52,10 @@ | |||
| 52 | `(,(rx bos (literal tramp-sudoedit-method) eos) | 52 | `(,(rx bos (literal tramp-sudoedit-method) eos) |
| 53 | nil ,tramp-root-id-string)) | 53 | nil ,tramp-root-id-string)) |
| 54 | 54 | ||
| 55 | (add-to-list 'tramp-default-host-alist | ||
| 56 | `(,(rx bos (literal tramp-sudoedit-method) eos) | ||
| 57 | nil ,(system-name))) | ||
| 58 | |||
| 55 | (tramp-set-completion-function | 59 | (tramp-set-completion-function |
| 56 | tramp-sudoedit-method tramp-completion-function-alist-su)) | 60 | tramp-sudoedit-method tramp-completion-function-alist-su)) |
| 57 | 61 | ||
| @@ -742,6 +746,10 @@ connection if a previous connection has died for some reason." | |||
| 742 | (unless (tramp-connectable-p vec) | 746 | (unless (tramp-connectable-p vec) |
| 743 | (throw 'non-essential 'non-essential)) | 747 | (throw 'non-essential 'non-essential)) |
| 744 | 748 | ||
| 749 | (unless (string-match-p tramp-local-host-regexp (tramp-file-name-host vec)) | ||
| 750 | (tramp-error | ||
| 751 | vec 'remote-file-error "%s is not a local host" (tramp-file-name-host vec))) | ||
| 752 | |||
| 745 | (with-tramp-debug-message vec "Opening connection" | 753 | (with-tramp-debug-message vec "Opening connection" |
| 746 | ;; We need a process bound to the connection buffer. Therefore, | 754 | ;; We need a process bound to the connection buffer. Therefore, |
| 747 | ;; we create a dummy process. Maybe there is a better solution? | 755 | ;; we create a dummy process. Maybe there is a better solution? |
| @@ -775,7 +783,6 @@ in case of error, t otherwise." | |||
| 775 | (append | 783 | (append |
| 776 | (tramp-expand-args | 784 | (tramp-expand-args |
| 777 | vec 'tramp-sudo-login nil | 785 | vec 'tramp-sudo-login nil |
| 778 | ?h (or (tramp-file-name-host vec) "") | ||
| 779 | ?u (or (tramp-file-name-user vec) "")) | 786 | ?u (or (tramp-file-name-user vec) "")) |
| 780 | (flatten-tree args)))) | 787 | (flatten-tree args)))) |
| 781 | ;; We suppress the messages `Waiting for prompts from remote shell'. | 788 | ;; We suppress the messages `Waiting for prompts from remote shell'. |
| @@ -817,7 +824,7 @@ In case there is no valid Lisp expression, it raises an error." | |||
| 817 | (when (search-forward-regexp (rx (not blank)) (line-end-position) t) | 824 | (when (search-forward-regexp (rx (not blank)) (line-end-position) t) |
| 818 | (error nil))) | 825 | (error nil))) |
| 819 | (error (tramp-error | 826 | (error (tramp-error |
| 820 | vec 'file-error | 827 | vec 'remote-file-error |
| 821 | "`%s' does not return a valid Lisp expression: `%s'" | 828 | "`%s' does not return a valid Lisp expression: `%s'" |
| 822 | (car args) (buffer-string))))))) | 829 | (car args) (buffer-string))))))) |
| 823 | 830 | ||