diff options
| author | Michael Albinus | 2010-10-05 16:20:24 +0200 |
|---|---|---|
| committer | Michael Albinus | 2010-10-05 16:20:24 +0200 |
| commit | bd8fadca2740ff8da308845199799641f25c3934 (patch) | |
| tree | fd9de44abec28665e2aeae144f5500be577d57eb | |
| parent | 6f7e2ffd5e39425cedf22aa444d7fb642840e52b (diff) | |
| download | emacs-bd8fadca2740ff8da308845199799641f25c3934.tar.gz emacs-bd8fadca2740ff8da308845199799641f25c3934.zip | |
* net/tramp.el (tramp-handle-directory-files-and-attributes)
(tramp-handle-file-exists-p, tramp-handle-file-newer-than-file-p):
New defuns, taken from tramp-smb.el.
(tramp-coding-system-change-eol-conversion)
(tramp-set-process-query-on-exit-flag): Removed.
* net/tramp-compat.el (top): Do not check for byte-compiler
objects.
(tramp-compat-coding-system-change-eol-conversion)
(tramp-compat-set-process-query-on-exit-flag): New defuns, taken
from tramp.el.
* net/tramp-gvfs.el:
* net/tramp-gw.el: Replace `tramp-set-process-query-on-exit-flag'
by `tramp-compat-set-process-query-on-exit-flag'.
* net/tramp-imap.el (tramp-imap-file-name-handler-alist): Use
`tramp-handle-directory-files-and-attributes',
`tramp-handle-file-exists-p' and
`tramp-handle-file-newer-than-file-p'.
(tramp-imap-handle-file-exists-p)
(tramp-imap-handle-file-executable-p)
(tramp-imap-handle-file-readable-p)
(tramp-imap-handle-directory-files-and-attributes)
(tramp-imap-handle-file-newer-than-file-p): Removed.
* net/tramp-sh.el: Replace `tramp-set-process-query-on-exit-flag'
by `tramp-compat-set-process-query-on-exit-flag' and
`tramp-coding-system-change-eol-conversion' by
`tramp-compat-coding-system-change-eol-conversion'.
* net/tramp-smb.el (tramp-smb-file-name-handler-alist): Use
`tramp-handle-directory-files-and-attributes',
`tramp-handle-file-exists-p' and
`tramp-handle-file-newer-than-file-p'.
(tramp-smb-handle-directory-files-and-attributes)
(tramp-smb-handle-file-exists-p)
(tramp-smb-handle-file-newer-than-file-p): Removed.
(tramp-smb-maybe-open-connection): Replace
`tramp-set-process-query-on-exit-flag' by
`tramp-compat-set-process-query-on-exit-flag'.
| -rw-r--r-- | lisp/ChangeLog | 44 | ||||
| -rw-r--r-- | lisp/net/tramp-compat.el | 32 | ||||
| -rw-r--r-- | lisp/net/tramp-gvfs.el | 3 | ||||
| -rw-r--r-- | lisp/net/tramp-gw.el | 8 | ||||
| -rw-r--r-- | lisp/net/tramp-imap.el | 40 | ||||
| -rw-r--r-- | lisp/net/tramp-sh.el | 10 | ||||
| -rw-r--r-- | lisp/net/tramp-smb.el | 33 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 47 |
8 files changed, 114 insertions, 103 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 03dee4d904d..6bda1609804 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,47 @@ | |||
| 1 | 2010-10-05 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/tramp.el (tramp-handle-directory-files-and-attributes) | ||
| 4 | (tramp-handle-file-exists-p, tramp-handle-file-newer-than-file-p): | ||
| 5 | New defuns, taken from tramp-smb.el. | ||
| 6 | (tramp-coding-system-change-eol-conversion) | ||
| 7 | (tramp-set-process-query-on-exit-flag): Removed. | ||
| 8 | |||
| 9 | * net/tramp-compat.el (top): Do not check for byte-compiler | ||
| 10 | objects. | ||
| 11 | (tramp-compat-coding-system-change-eol-conversion) | ||
| 12 | (tramp-compat-set-process-query-on-exit-flag): New defuns, taken | ||
| 13 | from tramp.el. | ||
| 14 | |||
| 15 | * net/tramp-gvfs.el: | ||
| 16 | * net/tramp-gw.el: Replace `tramp-set-process-query-on-exit-flag' | ||
| 17 | by `tramp-compat-set-process-query-on-exit-flag'. | ||
| 18 | |||
| 19 | * net/tramp-imap.el (tramp-imap-file-name-handler-alist): Use | ||
| 20 | `tramp-handle-directory-files-and-attributes', | ||
| 21 | `tramp-handle-file-exists-p' and | ||
| 22 | `tramp-handle-file-newer-than-file-p'. | ||
| 23 | (tramp-imap-handle-file-exists-p) | ||
| 24 | (tramp-imap-handle-file-executable-p) | ||
| 25 | (tramp-imap-handle-file-readable-p) | ||
| 26 | (tramp-imap-handle-directory-files-and-attributes) | ||
| 27 | (tramp-imap-handle-file-newer-than-file-p): Removed. | ||
| 28 | |||
| 29 | * net/tramp-sh.el: Replace `tramp-set-process-query-on-exit-flag' | ||
| 30 | by `tramp-compat-set-process-query-on-exit-flag' and | ||
| 31 | `tramp-coding-system-change-eol-conversion' by | ||
| 32 | `tramp-compat-coding-system-change-eol-conversion'. | ||
| 33 | |||
| 34 | * net/tramp-smb.el (tramp-smb-file-name-handler-alist): Use | ||
| 35 | `tramp-handle-directory-files-and-attributes', | ||
| 36 | `tramp-handle-file-exists-p' and | ||
| 37 | `tramp-handle-file-newer-than-file-p'. | ||
| 38 | (tramp-smb-handle-directory-files-and-attributes) | ||
| 39 | (tramp-smb-handle-file-exists-p) | ||
| 40 | (tramp-smb-handle-file-newer-than-file-p): Removed. | ||
| 41 | (tramp-smb-maybe-open-connection): Replace | ||
| 42 | `tramp-set-process-query-on-exit-flag' by | ||
| 43 | `tramp-compat-set-process-query-on-exit-flag'. | ||
| 44 | |||
| 1 | 2010-10-05 Glenn Morris <rgm@gnu.org> | 45 | 2010-10-05 Glenn Morris <rgm@gnu.org> |
| 2 | 46 | ||
| 3 | * obsolete/rnews.el, obsolete/rnewspost.el: Remove files. | 47 | * obsolete/rnews.el, obsolete/rnewspost.el: Remove files. |
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 0a7502399f6..130e3122df9 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el | |||
| @@ -90,12 +90,10 @@ | |||
| 90 | ;; needed to pacify Emacs byte-compiler. | 90 | ;; needed to pacify Emacs byte-compiler. |
| 91 | ;; Note that it was removed altogether in Emacs 24.1. | 91 | ;; Note that it was removed altogether in Emacs 24.1. |
| 92 | (when (boundp 'directory-sep-char) | 92 | (when (boundp 'directory-sep-char) |
| 93 | (unless (boundp 'byte-compile-not-obsolete-var) | 93 | (defvar byte-compile-not-obsolete-var nil) |
| 94 | (defvar byte-compile-not-obsolete-var nil)) | ||
| 95 | (setq byte-compile-not-obsolete-var 'directory-sep-char) | 94 | (setq byte-compile-not-obsolete-var 'directory-sep-char) |
| 96 | ;; Emacs 23.2. | 95 | ;; Emacs 23.2. |
| 97 | (unless (boundp 'byte-compile-not-obsolete-vars) | 96 | (defvar byte-compile-not-obsolete-vars nil) |
| 98 | (defvar byte-compile-not-obsolete-vars nil)) | ||
| 99 | (setq byte-compile-not-obsolete-vars '(directory-sep-char))) | 97 | (setq byte-compile-not-obsolete-vars '(directory-sep-char))) |
| 100 | 98 | ||
| 101 | ;; `remote-file-name-inhibit-cache' has been introduced with Emacs 24.1. | 99 | ;; `remote-file-name-inhibit-cache' has been introduced with Emacs 24.1. |
| @@ -497,10 +495,36 @@ This is the last value stored with `(process-put PROCESS PROPNAME VALUE)'." | |||
| 497 | It can be retrieved with `(process-get PROCESS PROPNAME)'." | 495 | It can be retrieved with `(process-get PROCESS PROPNAME)'." |
| 498 | (ignore-errors (tramp-compat-funcall 'process-put process propname value))) | 496 | (ignore-errors (tramp-compat-funcall 'process-put process propname value))) |
| 499 | 497 | ||
| 498 | (defun tramp-compat-set-process-query-on-exit-flag (process flag) | ||
| 499 | "Specify if query is needed for process when Emacs is exited. | ||
| 500 | If the second argument flag is non-nil, Emacs will query the user before | ||
| 501 | exiting if process is running." | ||
| 502 | (if (fboundp 'set-process-query-on-exit-flag) | ||
| 503 | (tramp-compat-funcall 'set-process-query-on-exit-flag process flag) | ||
| 504 | (tramp-compat-funcall 'process-kill-without-query process flag))) | ||
| 505 | |||
| 500 | (add-hook 'tramp-unload-hook | 506 | (add-hook 'tramp-unload-hook |
| 501 | (lambda () | 507 | (lambda () |
| 502 | (unload-feature 'tramp-compat 'force))) | 508 | (unload-feature 'tramp-compat 'force))) |
| 503 | 509 | ||
| 510 | (defun tramp-compat-coding-system-change-eol-conversion (coding-system eol-type) | ||
| 511 | "Return a coding system like CODING-SYSTEM but with given EOL-TYPE. | ||
| 512 | EOL-TYPE can be one of `dos', `unix', or `mac'." | ||
| 513 | (cond ((fboundp 'coding-system-change-eol-conversion) | ||
| 514 | (tramp-compat-funcall | ||
| 515 | 'coding-system-change-eol-conversion coding-system eol-type)) | ||
| 516 | ((fboundp 'subsidiary-coding-system) | ||
| 517 | (tramp-compat-funcall | ||
| 518 | 'subsidiary-coding-system coding-system | ||
| 519 | (cond ((eq eol-type 'dos) 'crlf) | ||
| 520 | ((eq eol-type 'unix) 'lf) | ||
| 521 | ((eq eol-type 'mac) 'cr) | ||
| 522 | (t | ||
| 523 | (error "Unknown EOL-TYPE `%s', must be %s" | ||
| 524 | eol-type | ||
| 525 | "`dos', `unix', or `mac'"))))) | ||
| 526 | (t (error "Can't change EOL conversion -- is MULE missing?")))) | ||
| 527 | |||
| 504 | (provide 'tramp-compat) | 528 | (provide 'tramp-compat) |
| 505 | 529 | ||
| 506 | ;;; TODO: | 530 | ;;; TODO: |
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 0d9bd36cc05..32322680f14 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el | |||
| @@ -401,7 +401,6 @@ Every entry is a list (NAME ADDRESS).") | |||
| 401 | (file-name-directory . tramp-handle-file-name-directory) | 401 | (file-name-directory . tramp-handle-file-name-directory) |
| 402 | (file-name-nondirectory . tramp-handle-file-name-nondirectory) | 402 | (file-name-nondirectory . tramp-handle-file-name-nondirectory) |
| 403 | ;; `file-name-sans-versions' performed by default handler. | 403 | ;; `file-name-sans-versions' performed by default handler. |
| 404 | ;; CCC: Must be checked! | ||
| 405 | (file-newer-than-file-p . tramp-handle-file-newer-than-file-p) | 404 | (file-newer-than-file-p . tramp-handle-file-newer-than-file-p) |
| 406 | (file-ownership-preserved-p . ignore) | 405 | (file-ownership-preserved-p . ignore) |
| 407 | (file-readable-p . tramp-gvfs-handle-file-readable-p) | 406 | (file-readable-p . tramp-gvfs-handle-file-readable-p) |
| @@ -1194,7 +1193,7 @@ connection if a previous connection has died for some reason." | |||
| 1194 | :name (tramp-buffer-name vec) | 1193 | :name (tramp-buffer-name vec) |
| 1195 | :buffer (tramp-get-buffer vec) | 1194 | :buffer (tramp-get-buffer vec) |
| 1196 | :server t :host 'local :service t))) | 1195 | :server t :host 'local :service t))) |
| 1197 | (tramp-set-process-query-on-exit-flag p nil))) | 1196 | (tramp-compat-set-process-query-on-exit-flag p nil))) |
| 1198 | 1197 | ||
| 1199 | (unless (tramp-gvfs-connection-mounted-p vec) | 1198 | (unless (tramp-gvfs-connection-mounted-p vec) |
| 1200 | (let* ((method (tramp-file-name-method vec)) | 1199 | (let* ((method (tramp-file-name-method vec)) |
diff --git a/lisp/net/tramp-gw.el b/lisp/net/tramp-gw.el index a550d46b9b5..71a23fd2d07 100644 --- a/lisp/net/tramp-gw.el +++ b/lisp/net/tramp-gw.el | |||
| @@ -107,7 +107,7 @@ | |||
| 107 | tramp-gw-vector 4 | 107 | tramp-gw-vector 4 |
| 108 | "Opening auxiliary process `%s', speaking with process `%s'" | 108 | "Opening auxiliary process `%s', speaking with process `%s'" |
| 109 | proc tramp-gw-gw-proc) | 109 | proc tramp-gw-gw-proc) |
| 110 | (tramp-set-process-query-on-exit-flag proc nil) | 110 | (tramp-compat-set-process-query-on-exit-flag proc nil) |
| 111 | ;; We don't want debug messages, because the corresponding debug | 111 | ;; We don't want debug messages, because the corresponding debug |
| 112 | ;; buffer might be undecided. | 112 | ;; buffer might be undecided. |
| 113 | (let (tramp-verbose) | 113 | (let (tramp-verbose) |
| @@ -154,7 +154,7 @@ instead of the host name declared in TARGET-VEC." | |||
| 154 | :name (tramp-buffer-name aux-vec) :buffer nil :host 'local | 154 | :name (tramp-buffer-name aux-vec) :buffer nil :host 'local |
| 155 | :server t :noquery t :service t :coding 'binary)) | 155 | :server t :noquery t :service t :coding 'binary)) |
| 156 | (set-process-sentinel tramp-gw-aux-proc 'tramp-gw-aux-proc-sentinel) | 156 | (set-process-sentinel tramp-gw-aux-proc 'tramp-gw-aux-proc-sentinel) |
| 157 | (tramp-set-process-query-on-exit-flag tramp-gw-aux-proc nil) | 157 | (tramp-compat-set-process-query-on-exit-flag tramp-gw-aux-proc nil) |
| 158 | (tramp-message | 158 | (tramp-message |
| 159 | vec 4 "Opening auxiliary process `%s', listening on port %d" | 159 | vec 4 "Opening auxiliary process `%s', listening on port %d" |
| 160 | tramp-gw-aux-proc (process-contact tramp-gw-aux-proc :service)))) | 160 | tramp-gw-aux-proc (process-contact tramp-gw-aux-proc :service)))) |
| @@ -199,7 +199,7 @@ instead of the host name declared in TARGET-VEC." | |||
| 199 | (tramp-file-name-real-host target-vec) | 199 | (tramp-file-name-real-host target-vec) |
| 200 | (tramp-file-name-port target-vec))) | 200 | (tramp-file-name-port target-vec))) |
| 201 | (set-process-sentinel tramp-gw-gw-proc 'tramp-gw-gw-proc-sentinel) | 201 | (set-process-sentinel tramp-gw-gw-proc 'tramp-gw-gw-proc-sentinel) |
| 202 | (tramp-set-process-query-on-exit-flag tramp-gw-gw-proc nil) | 202 | (tramp-compat-set-process-query-on-exit-flag tramp-gw-gw-proc nil) |
| 203 | (tramp-message | 203 | (tramp-message |
| 204 | vec 4 "Opened %s process `%s'" | 204 | vec 4 "Opened %s process `%s'" |
| 205 | (case gw-method ('tunnel "HTTP tunnel") ('socks "SOCKS")) | 205 | (case gw-method ('tunnel "HTTP tunnel") ('socks "SOCKS")) |
| @@ -230,7 +230,7 @@ authentication is requested from proxy server, provide it." | |||
| 230 | (setq proc (open-network-stream | 230 | (setq proc (open-network-stream |
| 231 | name buffer (nth 1 socks-server) (nth 2 socks-server))) | 231 | name buffer (nth 1 socks-server) (nth 2 socks-server))) |
| 232 | (set-process-coding-system proc 'binary 'binary) | 232 | (set-process-coding-system proc 'binary 'binary) |
| 233 | (tramp-set-process-query-on-exit-flag proc nil) | 233 | (tramp-compat-set-process-query-on-exit-flag proc nil) |
| 234 | ;; Send CONNECT command. | 234 | ;; Send CONNECT command. |
| 235 | (process-send-string proc (format "%s%s\r\n" command authentication)) | 235 | (process-send-string proc (format "%s%s\r\n" command authentication)) |
| 236 | (tramp-message | 236 | (tramp-message |
diff --git a/lisp/net/tramp-imap.el b/lisp/net/tramp-imap.el index 4a5e2418cfb..dade2052126 100644 --- a/lisp/net/tramp-imap.el +++ b/lisp/net/tramp-imap.el | |||
| @@ -122,7 +122,7 @@ | |||
| 122 | (directory-file-name . tramp-handle-directory-file-name) | 122 | (directory-file-name . tramp-handle-directory-file-name) |
| 123 | (directory-files . tramp-handle-directory-files) | 123 | (directory-files . tramp-handle-directory-files) |
| 124 | (directory-files-and-attributes | 124 | (directory-files-and-attributes |
| 125 | . tramp-imap-handle-directory-files-and-attributes) | 125 | . tramp-handle-directory-files-and-attributes) |
| 126 | (dired-call-process . ignore) | 126 | (dired-call-process . ignore) |
| 127 | ;; `dired-compress-file' performed by default handler | 127 | ;; `dired-compress-file' performed by default handler |
| 128 | ;; `dired-uncache' performed by default handler | 128 | ;; `dired-uncache' performed by default handler |
| @@ -130,8 +130,8 @@ | |||
| 130 | ;; `file-accessible-directory-p' performed by default handler | 130 | ;; `file-accessible-directory-p' performed by default handler |
| 131 | (file-attributes . tramp-imap-handle-file-attributes) | 131 | (file-attributes . tramp-imap-handle-file-attributes) |
| 132 | (file-directory-p . tramp-imap-handle-file-directory-p) | 132 | (file-directory-p . tramp-imap-handle-file-directory-p) |
| 133 | (file-executable-p . tramp-imap-handle-file-executable-p) | 133 | (file-executable-p . ignore) |
| 134 | (file-exists-p . tramp-imap-handle-file-exists-p) | 134 | (file-exists-p . tramp-handle-file-exists-p) |
| 135 | (file-local-copy . tramp-imap-handle-file-local-copy) | 135 | (file-local-copy . tramp-imap-handle-file-local-copy) |
| 136 | (file-modes . tramp-handle-file-modes) | 136 | (file-modes . tramp-handle-file-modes) |
| 137 | (file-name-all-completions . tramp-imap-handle-file-name-all-completions) | 137 | (file-name-all-completions . tramp-imap-handle-file-name-all-completions) |
| @@ -140,9 +140,9 @@ | |||
| 140 | (file-name-directory . tramp-handle-file-name-directory) | 140 | (file-name-directory . tramp-handle-file-name-directory) |
| 141 | (file-name-nondirectory . tramp-handle-file-name-nondirectory) | 141 | (file-name-nondirectory . tramp-handle-file-name-nondirectory) |
| 142 | ;; `file-name-sans-versions' performed by default handler | 142 | ;; `file-name-sans-versions' performed by default handler |
| 143 | (file-newer-than-file-p . tramp-imap-handle-file-newer-than-file-p) | 143 | (file-newer-than-file-p . tramp-handle-file-newer-than-file-p) |
| 144 | (file-ownership-preserved-p . ignore) | 144 | (file-ownership-preserved-p . ignore) |
| 145 | (file-readable-p . tramp-imap-handle-file-readable-p) | 145 | (file-readable-p . tramp-handle-file-exists-p) |
| 146 | (file-regular-p . tramp-handle-file-regular-p) | 146 | (file-regular-p . tramp-handle-file-regular-p) |
| 147 | (file-remote-p . tramp-handle-file-remote-p) | 147 | (file-remote-p . tramp-handle-file-remote-p) |
| 148 | ;; `file-selinux-context' performed by default handler. | 148 | ;; `file-selinux-context' performed by default handler. |
| @@ -526,10 +526,6 @@ SIZE MODE WEIRD INODE DEVICE)." | |||
| 526 | (goto-char point) | 526 | (goto-char point) |
| 527 | (list (expand-file-name filename) size)))))) | 527 | (list (expand-file-name filename) size)))))) |
| 528 | 528 | ||
| 529 | (defun tramp-imap-handle-file-exists-p (filename) | ||
| 530 | "Like `file-exists-p' for Tramp files." | ||
| 531 | (and (file-attributes filename) t)) | ||
| 532 | |||
| 533 | (defun tramp-imap-handle-file-directory-p (filename) | 529 | (defun tramp-imap-handle-file-directory-p (filename) |
| 534 | "Like `file-directory-p' for Tramp-IMAP files." | 530 | "Like `file-directory-p' for Tramp-IMAP files." |
| 535 | ;; We allow only mailboxes to be a directory. | 531 | ;; We allow only mailboxes to be a directory. |
| @@ -549,14 +545,6 @@ SIZE MODE WEIRD INODE DEVICE)." | |||
| 549 | "Get inode equivalent \(actually the UID) for Tramp-IMAP FILENAME." | 545 | "Get inode equivalent \(actually the UID) for Tramp-IMAP FILENAME." |
| 550 | (nth 10 (tramp-compat-file-attributes filename id-format))) | 546 | (nth 10 (tramp-compat-file-attributes filename id-format))) |
| 551 | 547 | ||
| 552 | (defun tramp-imap-handle-file-executable-p (filename) | ||
| 553 | "Like `file-executable-p' for Tramp files. False for IMAP." | ||
| 554 | nil) | ||
| 555 | |||
| 556 | (defun tramp-imap-handle-file-readable-p (filename) | ||
| 557 | "Like `file-readable-p' for Tramp files. True for IMAP." | ||
| 558 | (file-exists-p filename)) | ||
| 559 | |||
| 560 | (defun tramp-imap-handle-file-writable-p (filename) | 548 | (defun tramp-imap-handle-file-writable-p (filename) |
| 561 | "Like `file-writable-p' for Tramp files. True for IMAP." | 549 | "Like `file-writable-p' for Tramp files. True for IMAP." |
| 562 | ;; `file-exists-p' does not work yet for directories. | 550 | ;; `file-exists-p' does not work yet for directories. |
| @@ -571,24 +559,6 @@ SIZE MODE WEIRD INODE DEVICE)." | |||
| 571 | (let ((iht (tramp-imap-make-iht v))) | 559 | (let ((iht (tramp-imap-make-iht v))) |
| 572 | (imap-hash-rem (tramp-imap-get-file-inode filename) iht)))))) | 560 | (imap-hash-rem (tramp-imap-get-file-inode filename) iht)))))) |
| 573 | 561 | ||
| 574 | (defun tramp-imap-handle-directory-files-and-attributes | ||
| 575 | (directory &optional full match nosort id-format) | ||
| 576 | "Like `directory-files-and-attributes' for Tramp files." | ||
| 577 | (mapcar | ||
| 578 | (lambda (x) | ||
| 579 | (cons x (tramp-compat-file-attributes | ||
| 580 | (if full x (expand-file-name x directory)) id-format))) | ||
| 581 | (directory-files directory full match nosort))) | ||
| 582 | |||
| 583 | ;; TODO: fix this in tramp-imap-get-file-entries. | ||
| 584 | (defun tramp-imap-handle-file-newer-than-file-p (file1 file2) | ||
| 585 | "Like `file-newer-than-file-p' for Tramp files." | ||
| 586 | (cond | ||
| 587 | ((not (file-exists-p file1)) nil) | ||
| 588 | ((not (file-exists-p file2)) t) | ||
| 589 | (t (tramp-time-less-p (nth 5 (file-attributes file2)) | ||
| 590 | (nth 5 (file-attributes file1)))))) | ||
| 591 | |||
| 592 | (defun tramp-imap-handle-file-local-copy (filename) | 562 | (defun tramp-imap-handle-file-local-copy (filename) |
| 593 | "Like `file-local-copy' for Tramp files." | 563 | "Like `file-local-copy' for Tramp files." |
| 594 | (with-parsed-tramp-file-name (expand-file-name filename) nil | 564 | (with-parsed-tramp-file-name (expand-file-name filename) nil |
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 2d1ea436240..0953342b79f 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -2310,7 +2310,7 @@ The method used must be an out-of-band method." | |||
| 2310 | (append copy-args (list source target)))))) | 2310 | (append copy-args (list source target)))))) |
| 2311 | (tramp-message | 2311 | (tramp-message |
| 2312 | v 6 "%s" (mapconcat 'identity (process-command p) " ")) | 2312 | v 6 "%s" (mapconcat 'identity (process-command p) " ")) |
| 2313 | (tramp-set-process-query-on-exit-flag p nil) | 2313 | (tramp-compat-set-process-query-on-exit-flag p nil) |
| 2314 | (tramp-process-actions p v tramp-actions-copy-out-of-band)))) | 2314 | (tramp-process-actions p v tramp-actions-copy-out-of-band)))) |
| 2315 | 2315 | ||
| 2316 | ;; Reset the transfer process properties. | 2316 | ;; Reset the transfer process properties. |
| @@ -2677,7 +2677,7 @@ the result will be a local, non-Tramp, filename." | |||
| 2677 | ;; Set sentinel and query flag for this process. | 2677 | ;; Set sentinel and query flag for this process. |
| 2678 | (tramp-set-connection-property p "vector" v) | 2678 | (tramp-set-connection-property p "vector" v) |
| 2679 | (set-process-sentinel p 'tramp-process-sentinel) | 2679 | (set-process-sentinel p 'tramp-process-sentinel) |
| 2680 | (tramp-set-process-query-on-exit-flag p t) | 2680 | (tramp-compat-set-process-query-on-exit-flag p t) |
| 2681 | ;; Return process. | 2681 | ;; Return process. |
| 2682 | p)) | 2682 | p)) |
| 2683 | ;; Save exit. | 2683 | ;; Save exit. |
| @@ -3694,10 +3694,10 @@ process to set up. VEC specifies the connection." | |||
| 3694 | (setq cs-encode (cdr cs)) | 3694 | (setq cs-encode (cdr cs)) |
| 3695 | (unless cs-decode (setq cs-decode 'undecided)) | 3695 | (unless cs-decode (setq cs-decode 'undecided)) |
| 3696 | (unless cs-encode (setq cs-encode 'undecided)) | 3696 | (unless cs-encode (setq cs-encode 'undecided)) |
| 3697 | (setq cs-encode (tramp-coding-system-change-eol-conversion | 3697 | (setq cs-encode (tramp-compat-coding-system-change-eol-conversion |
| 3698 | cs-encode 'unix)) | 3698 | cs-encode 'unix)) |
| 3699 | (when (search-forward "\r" nil t) | 3699 | (when (search-forward "\r" nil t) |
| 3700 | (setq cs-decode (tramp-coding-system-change-eol-conversion | 3700 | (setq cs-decode (tramp-compat-coding-system-change-eol-conversion |
| 3701 | cs-decode 'dos))) | 3701 | cs-decode 'dos))) |
| 3702 | (tramp-compat-funcall | 3702 | (tramp-compat-funcall |
| 3703 | 'set-buffer-process-coding-system cs-decode cs-encode) | 3703 | 'set-buffer-process-coding-system cs-decode cs-encode) |
| @@ -4244,7 +4244,7 @@ connection if a previous connection has died for some reason." | |||
| 4244 | vec 6 "%s" (mapconcat 'identity (process-command p) " ")) | 4244 | vec 6 "%s" (mapconcat 'identity (process-command p) " ")) |
| 4245 | 4245 | ||
| 4246 | ;; Check whether process is alive. | 4246 | ;; Check whether process is alive. |
| 4247 | (tramp-set-process-query-on-exit-flag p nil) | 4247 | (tramp-compat-set-process-query-on-exit-flag p nil) |
| 4248 | (tramp-barf-if-no-shell-prompt | 4248 | (tramp-barf-if-no-shell-prompt |
| 4249 | p 60 "Couldn't find local shell prompt %s" tramp-encoding-shell) | 4249 | p 60 "Couldn't find local shell prompt %s" tramp-encoding-shell) |
| 4250 | 4250 | ||
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 84d11972115..d2308216821 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el | |||
| @@ -153,7 +153,7 @@ See `tramp-actions-before-shell' for more info.") | |||
| 153 | (directory-file-name . tramp-handle-directory-file-name) | 153 | (directory-file-name . tramp-handle-directory-file-name) |
| 154 | (directory-files . tramp-smb-handle-directory-files) | 154 | (directory-files . tramp-smb-handle-directory-files) |
| 155 | (directory-files-and-attributes | 155 | (directory-files-and-attributes |
| 156 | . tramp-smb-handle-directory-files-and-attributes) | 156 | . tramp-handle-directory-files-and-attributes) |
| 157 | (dired-call-process . ignore) | 157 | (dired-call-process . ignore) |
| 158 | (dired-compress-file . ignore) | 158 | (dired-compress-file . ignore) |
| 159 | (dired-uncache . tramp-handle-dired-uncache) | 159 | (dired-uncache . tramp-handle-dired-uncache) |
| @@ -161,8 +161,8 @@ See `tramp-actions-before-shell' for more info.") | |||
| 161 | (file-accessible-directory-p . tramp-smb-handle-file-directory-p) | 161 | (file-accessible-directory-p . tramp-smb-handle-file-directory-p) |
| 162 | (file-attributes . tramp-smb-handle-file-attributes) | 162 | (file-attributes . tramp-smb-handle-file-attributes) |
| 163 | (file-directory-p . tramp-smb-handle-file-directory-p) | 163 | (file-directory-p . tramp-smb-handle-file-directory-p) |
| 164 | (file-executable-p . tramp-smb-handle-file-exists-p) | 164 | (file-executable-p . tramp-handle-file-exists-p) |
| 165 | (file-exists-p . tramp-smb-handle-file-exists-p) | 165 | (file-exists-p . tramp-handle-file-exists-p) |
| 166 | (file-local-copy . tramp-smb-handle-file-local-copy) | 166 | (file-local-copy . tramp-smb-handle-file-local-copy) |
| 167 | (file-modes . tramp-handle-file-modes) | 167 | (file-modes . tramp-handle-file-modes) |
| 168 | (file-name-all-completions . tramp-smb-handle-file-name-all-completions) | 168 | (file-name-all-completions . tramp-smb-handle-file-name-all-completions) |
| @@ -171,9 +171,9 @@ See `tramp-actions-before-shell' for more info.") | |||
| 171 | (file-name-directory . tramp-handle-file-name-directory) | 171 | (file-name-directory . tramp-handle-file-name-directory) |
| 172 | (file-name-nondirectory . tramp-handle-file-name-nondirectory) | 172 | (file-name-nondirectory . tramp-handle-file-name-nondirectory) |
| 173 | ;; `file-name-sans-versions' performed by default handler. | 173 | ;; `file-name-sans-versions' performed by default handler. |
| 174 | (file-newer-than-file-p . tramp-smb-handle-file-newer-than-file-p) | 174 | (file-newer-than-file-p . tramp-handle-file-newer-than-file-p) |
| 175 | (file-ownership-preserved-p . ignore) | 175 | (file-ownership-preserved-p . ignore) |
| 176 | (file-readable-p . tramp-smb-handle-file-exists-p) | 176 | (file-readable-p . tramp-handle-file-exists-p) |
| 177 | (file-regular-p . tramp-handle-file-regular-p) | 177 | (file-regular-p . tramp-handle-file-regular-p) |
| 178 | (file-remote-p . tramp-handle-file-remote-p) | 178 | (file-remote-p . tramp-handle-file-remote-p) |
| 179 | ;; `file-selinux-context' performed by default handler. | 179 | ;; `file-selinux-context' performed by default handler. |
| @@ -451,15 +451,6 @@ PRESERVE-UID-GID is completely ignored." | |||
| 451 | ;; That's it. | 451 | ;; That's it. |
| 452 | result)) | 452 | result)) |
| 453 | 453 | ||
| 454 | (defun tramp-smb-handle-directory-files-and-attributes | ||
| 455 | (directory &optional full match nosort id-format) | ||
| 456 | "Like `directory-files-and-attributes' for Tramp files." | ||
| 457 | (mapcar | ||
| 458 | (lambda (x) | ||
| 459 | (cons x (tramp-compat-file-attributes | ||
| 460 | (if full x (expand-file-name x directory)) id-format))) | ||
| 461 | (directory-files directory full match nosort))) | ||
| 462 | |||
| 463 | (defun tramp-smb-handle-expand-file-name (name &optional dir) | 454 | (defun tramp-smb-handle-expand-file-name (name &optional dir) |
| 464 | "Like `expand-file-name' for Tramp files." | 455 | "Like `expand-file-name' for Tramp files." |
| 465 | ;; If DIR is not given, use DEFAULT-DIRECTORY or "/". | 456 | ;; If DIR is not given, use DEFAULT-DIRECTORY or "/". |
| @@ -597,10 +588,6 @@ PRESERVE-UID-GID is completely ignored." | |||
| 597 | (and (file-exists-p filename) | 588 | (and (file-exists-p filename) |
| 598 | (eq ?d (aref (nth 8 (file-attributes filename)) 0)))) | 589 | (eq ?d (aref (nth 8 (file-attributes filename)) 0)))) |
| 599 | 590 | ||
| 600 | (defun tramp-smb-handle-file-exists-p (filename) | ||
| 601 | "Like `file-exists-p' for Tramp files." | ||
| 602 | (not (null (file-attributes filename)))) | ||
| 603 | |||
| 604 | (defun tramp-smb-handle-file-local-copy (filename) | 591 | (defun tramp-smb-handle-file-local-copy (filename) |
| 605 | "Like `file-local-copy' for Tramp files." | 592 | "Like `file-local-copy' for Tramp files." |
| 606 | (with-parsed-tramp-file-name filename nil | 593 | (with-parsed-tramp-file-name filename nil |
| @@ -638,14 +625,6 @@ PRESERVE-UID-GID is completely ignored." | |||
| 638 | (nth 0 x)))) | 625 | (nth 0 x)))) |
| 639 | entries))))))) | 626 | entries))))))) |
| 640 | 627 | ||
| 641 | (defun tramp-smb-handle-file-newer-than-file-p (file1 file2) | ||
| 642 | "Like `file-newer-than-file-p' for Tramp files." | ||
| 643 | (cond | ||
| 644 | ((not (file-exists-p file1)) nil) | ||
| 645 | ((not (file-exists-p file2)) t) | ||
| 646 | (t (tramp-time-less-p (nth 5 (file-attributes file2)) | ||
| 647 | (nth 5 (file-attributes file1)))))) | ||
| 648 | |||
| 649 | (defun tramp-smb-handle-file-writable-p (filename) | 628 | (defun tramp-smb-handle-file-writable-p (filename) |
| 650 | "Like `file-writable-p' for Tramp files." | 629 | "Like `file-writable-p' for Tramp files." |
| 651 | (if (file-exists-p filename) | 630 | (if (file-exists-p filename) |
| @@ -1323,7 +1302,7 @@ connection if a previous connection has died for some reason." | |||
| 1323 | 1302 | ||
| 1324 | (tramp-message | 1303 | (tramp-message |
| 1325 | vec 6 "%s" (mapconcat 'identity (process-command p) " ")) | 1304 | vec 6 "%s" (mapconcat 'identity (process-command p) " ")) |
| 1326 | (tramp-set-process-query-on-exit-flag p nil) | 1305 | (tramp-compat-set-process-query-on-exit-flag p nil) |
| 1327 | 1306 | ||
| 1328 | ;; Set variables for computing the prompt for reading password. | 1307 | ;; Set variables for computing the prompt for reading password. |
| 1329 | (setq tramp-current-method tramp-smb-method | 1308 | (setq tramp-current-method tramp-smb-method |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 1ad5c3aac2c..7b2d8a0a6e6 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -2609,6 +2609,15 @@ User is always nil." | |||
| 2609 | result))) | 2609 | result))) |
| 2610 | (if nosort result (sort result 'string<))))) | 2610 | (if nosort result (sort result 'string<))))) |
| 2611 | 2611 | ||
| 2612 | (defun tramp-handle-directory-files-and-attributes | ||
| 2613 | (directory &optional full match nosort id-format) | ||
| 2614 | "Like `directory-files-and-attributes' for Tramp files." | ||
| 2615 | (mapcar | ||
| 2616 | (lambda (x) | ||
| 2617 | (cons x (tramp-compat-file-attributes | ||
| 2618 | (if full x (expand-file-name x directory)) id-format))) | ||
| 2619 | (directory-files directory full match nosort))) | ||
| 2620 | |||
| 2612 | (defun tramp-handle-dired-uncache (dir &optional dir-p) | 2621 | (defun tramp-handle-dired-uncache (dir &optional dir-p) |
| 2613 | "Like `dired-uncache' for Tramp files." | 2622 | "Like `dired-uncache' for Tramp files." |
| 2614 | ;; DIR-P is valid for XEmacs only. | 2623 | ;; DIR-P is valid for XEmacs only. |
| @@ -2616,6 +2625,10 @@ User is always nil." | |||
| 2616 | (if (or dir-p (file-directory-p dir)) dir (file-name-directory dir)) nil | 2625 | (if (or dir-p (file-directory-p dir)) dir (file-name-directory dir)) nil |
| 2617 | (tramp-flush-directory-property v localname))) | 2626 | (tramp-flush-directory-property v localname))) |
| 2618 | 2627 | ||
| 2628 | (defun tramp-handle-file-exists-p (filename) | ||
| 2629 | "Like `file-exists-p' for Tramp files." | ||
| 2630 | (not (null (file-attributes filename)))) | ||
| 2631 | |||
| 2619 | (defun tramp-handle-file-modes (filename) | 2632 | (defun tramp-handle-file-modes (filename) |
| 2620 | "Like `file-modes' for Tramp files." | 2633 | "Like `file-modes' for Tramp files." |
| 2621 | (let ((truename (or (file-truename filename) filename))) | 2634 | (let ((truename (or (file-truename filename) filename))) |
| @@ -2669,6 +2682,14 @@ User is always nil." | |||
| 2669 | (with-parsed-tramp-file-name file nil | 2682 | (with-parsed-tramp-file-name file nil |
| 2670 | (tramp-run-real-handler 'file-name-nondirectory (list localname)))) | 2683 | (tramp-run-real-handler 'file-name-nondirectory (list localname)))) |
| 2671 | 2684 | ||
| 2685 | (defun tramp-handle-file-newer-than-file-p (file1 file2) | ||
| 2686 | "Like `file-newer-than-file-p' for Tramp files." | ||
| 2687 | (cond | ||
| 2688 | ((not (file-exists-p file1)) nil) | ||
| 2689 | ((not (file-exists-p file2)) t) | ||
| 2690 | (t (tramp-time-less-p (nth 5 (file-attributes file2)) | ||
| 2691 | (nth 5 (file-attributes file1)))))) | ||
| 2692 | |||
| 2672 | (defun tramp-handle-file-regular-p (filename) | 2693 | (defun tramp-handle-file-regular-p (filename) |
| 2673 | "Like `file-regular-p' for Tramp files." | 2694 | "Like `file-regular-p' for Tramp files." |
| 2674 | (and (file-exists-p filename) | 2695 | (and (file-exists-p filename) |
| @@ -3551,32 +3572,6 @@ T1 and T2 are time values (as returned by `current-time' for example)." | |||
| 3551 | (cadr time) | 3572 | (cadr time) |
| 3552 | (/ (or (nth 2 time) 0) 1000000.0)))))) | 3573 | (/ (or (nth 2 time) 0) 1000000.0)))))) |
| 3553 | 3574 | ||
| 3554 | (defun tramp-coding-system-change-eol-conversion (coding-system eol-type) | ||
| 3555 | "Return a coding system like CODING-SYSTEM but with given EOL-TYPE. | ||
| 3556 | EOL-TYPE can be one of `dos', `unix', or `mac'." | ||
| 3557 | (cond ((fboundp 'coding-system-change-eol-conversion) | ||
| 3558 | (tramp-compat-funcall | ||
| 3559 | 'coding-system-change-eol-conversion coding-system eol-type)) | ||
| 3560 | ((fboundp 'subsidiary-coding-system) | ||
| 3561 | (tramp-compat-funcall | ||
| 3562 | 'subsidiary-coding-system coding-system | ||
| 3563 | (cond ((eq eol-type 'dos) 'crlf) | ||
| 3564 | ((eq eol-type 'unix) 'lf) | ||
| 3565 | ((eq eol-type 'mac) 'cr) | ||
| 3566 | (t | ||
| 3567 | (error "Unknown EOL-TYPE `%s', must be %s" | ||
| 3568 | eol-type | ||
| 3569 | "`dos', `unix', or `mac'"))))) | ||
| 3570 | (t (error "Can't change EOL conversion -- is MULE missing?")))) | ||
| 3571 | |||
| 3572 | (defun tramp-set-process-query-on-exit-flag (process flag) | ||
| 3573 | "Specify if query is needed for process when Emacs is exited. | ||
| 3574 | If the second argument flag is non-nil, Emacs will query the user before | ||
| 3575 | exiting if process is running." | ||
| 3576 | (if (fboundp 'set-process-query-on-exit-flag) | ||
| 3577 | (tramp-compat-funcall 'set-process-query-on-exit-flag process flag) | ||
| 3578 | (tramp-compat-funcall 'process-kill-without-query process flag))) | ||
| 3579 | |||
| 3580 | ;; Currently (as of Emacs 20.5), the function `shell-quote-argument' | 3575 | ;; Currently (as of Emacs 20.5), the function `shell-quote-argument' |
| 3581 | ;; does not deal well with newline characters. Newline is replaced by | 3576 | ;; does not deal well with newline characters. Newline is replaced by |
| 3582 | ;; backslash newline. But if, say, the string `a backslash newline b' | 3577 | ;; backslash newline. But if, say, the string `a backslash newline b' |