diff options
| author | Tom Tromey <tromey@redhat.com> | 2013-06-03 12:25:05 -0600 |
|---|---|---|
| committer | Tom Tromey <tromey@redhat.com> | 2013-06-03 12:25:05 -0600 |
| commit | 68359abba96d7ec4db8aab3d3dd9cf1105c3bab5 (patch) | |
| tree | 862703e7e1a1888170136a8296a5750d6b2ae2eb /lisp/eshell/em-unix.el | |
| parent | cbcba8ce7f980b01c18c0fd561ef6687b1361507 (diff) | |
| parent | e2d8a6f0a229b4ebe26484b892ec4f14888f58b6 (diff) | |
| download | emacs-68359abba96d7ec4db8aab3d3dd9cf1105c3bab5.tar.gz | |
merge from trunk; clean up some issues
Diffstat (limited to 'lisp/eshell/em-unix.el')
| -rw-r--r-- | lisp/eshell/em-unix.el | 85 |
1 files changed, 4 insertions, 81 deletions
diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index 94508d71592..af54d875cb0 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el @@ -148,7 +148,7 @@ Otherwise, Emacs will attempt to use rsh to invoke du on the remote machine." (make-local-variable 'eshell-complex-commands) (setq eshell-complex-commands (append '("grep" "egrep" "fgrep" "agrep" "glimpse" "locate" - "cat" "time" "cp" "mv" "make" "du" "diff" "su" "sudo") + "cat" "time" "cp" "mv" "make" "du" "diff") eshell-complex-commands))) (defalias 'eshell/date 'current-time-string) @@ -532,8 +532,10 @@ Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY. "don't change anything on disk") (?p "preserve" nil preserve "preserve file attributes if possible") - (?R "recursive" nil em-recursive + (?r "recursive" nil em-recursive "copy directories recursively") + (?R nil nil em-recursive + "as for -r") (?v "verbose" nil em-verbose "explain what is being done") (nil "help" nil nil "show this usage screen") @@ -1038,85 +1040,6 @@ Show wall-clock time elapsed during execution of COMMAND.") (put 'eshell/occur 'eshell-no-numeric-conversions t) -(defun eshell/su (&rest args) - "Alias \"su\" to call Tramp." - (require 'tramp) - (setq args (eshell-stringify-list (eshell-flatten-list args))) - (let ((orig-args (copy-tree args))) - (eshell-eval-using-options - "su" args - '((?h "help" nil nil "show this usage screen") - (?l "login" nil login "provide a login environment") - (? nil nil login "provide a login environment") - :usage "[- | -l | --login] [USER] -Become another USER during a login session.") - (throw 'eshell-replace-command - (let ((user "root") - (host (or (file-remote-p default-directory 'host) - "localhost")) - (dir (or (file-remote-p default-directory 'localname) - (expand-file-name default-directory))) - (prefix (file-remote-p default-directory))) - (dolist (arg args) - (if (string-equal arg "-") (setq login t) (setq user arg))) - ;; `eshell-eval-using-options' does not handle "-". - (if (member "-" orig-args) (setq login t)) - (if login (setq dir "~/")) - (if (and prefix - (or - (not (string-equal - "su" (file-remote-p default-directory 'method))) - (not (string-equal - user (file-remote-p default-directory 'user))))) - (eshell-parse-command - "cd" (list (format "%s|su:%s@%s:%s" - (substring prefix 0 -1) user host dir))) - (eshell-parse-command - "cd" (list (format "/su:%s@%s:%s" user host dir))))))))) - -(put 'eshell/su 'eshell-no-numeric-conversions t) - -(defun eshell/sudo (&rest args) - "Alias \"sudo\" to call Tramp." - (require 'tramp) - (setq args (eshell-stringify-list (eshell-flatten-list args))) - (let ((orig-args (copy-tree args))) - (eshell-eval-using-options - "sudo" args - '((?h "help" nil nil "show this usage screen") - (?u "user" t user "execute a command as another USER") - :show-usage - :usage "[(-u | --user) USER] COMMAND -Execute a COMMAND as the superuser or another USER.") - (throw 'eshell-external - (let ((user (or user "root")) - (host (or (file-remote-p default-directory 'host) - "localhost")) - (dir (or (file-remote-p default-directory 'localname) - (expand-file-name default-directory))) - (prefix (file-remote-p default-directory))) - ;; `eshell-eval-using-options' reads options of COMMAND. - (while (and (stringp (car orig-args)) - (member (car orig-args) '("-u" "--user"))) - (setq orig-args (cddr orig-args))) - (let ((default-directory - (if (and prefix - (or - (not - (string-equal - "sudo" - (file-remote-p default-directory 'method))) - (not - (string-equal - user - (file-remote-p default-directory 'user))))) - (format "%s|sudo:%s@%s:%s" - (substring prefix 0 -1) user host dir) - (format "/sudo:%s@%s:%s" user host dir)))) - (eshell-named-command (car orig-args) (cdr orig-args)))))))) - -(put 'eshell/sudo 'eshell-no-numeric-conversions t) - (provide 'em-unix) ;; Local Variables: |
