Commit graph

398 commits

Author SHA1 Message Date
Michael Albinus
73a37a6958 (tramp-handle-directory-files): When FULL, do not expand "." and "..".
Reported by Thierry Volpiatto <thierry.volpiatto@gmail.com>.
2010-02-18 11:08:48 +01:00
Michael Albinus
6e4f5731f6 (tramp-handle-insert-file-contents): Set always the permissions of the
temporary file to "0600". In case the remote
file has no read permissions for the owner, there might be
problems otherwise.  Reported by Ole Laursen <olau@iola.dk>.
2010-02-18 11:03:12 +01:00
Michael Albinus
aac0b0f2be * net/tramp.el (tramp-do-copy-or-rename-file-out-of-band): Fix
errors in copying directories.
(tramp-handle-add-name-to-file, tramp-handle-copy-directory)
(tramp-do-copy-or-rename-file, tramp-handle-delete-directory)
(tramp-handle-delete-file)
(tramp-handle-dired-recursive-delete-directory)
(tramp-handle-write-region): Flush also the cache for the upper
directory.
2010-02-16 17:03:29 +01:00
Michael Albinus
7540f02995 * net/tramp.el (tramp-process-actions, tramp-read-passwd):
* net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection): Use VEC
instead of PROC for caching "first-password-request".  Otherwise,
new processes would not profit from passwords already entered.

* net/tramp-cache.el (tramp-dump-connection-properties): Don't
save "first-password-request" property.
2010-02-15 16:04:53 +01:00
Michael Albinus
d5b3979c8a * dired.el (dired-revert): If DIRED-DIRECTORY is a cons cell, call
`dired-uncache' for every elemnt which is an absolute file name.

* net/tramp.el (tramp-handle-dired-uncache): When DIR is not a
directory, handle its directory component.
(tramp-handle-file-remote-p): Let-bind `tramp-verbose' to 3; this
function is called permanently and creates noise, otherwise.

* net/tramp-imap.el (tramp-imap-handle-insert-directory):
* net/tramp-smb.el (tramp-smb-handle-insert-directory):
Handle the case, FILENAME is not in `default-directory'.  (Bug#5478)
2010-02-04 17:25:57 +01:00
Michael Albinus
e5c70c4117 * net/tramp.el (tramp-handle-insert-directory): Handle also
symlinks, when FILENAME is not in `default-directory'.
2010-01-29 17:23:25 +01:00
Stefan Monnier
15ad855107 Fix up spurious execute-bit on net/tramp.el 2010-01-28 16:55:43 -05:00
Michael Albinus
0c0b61f1ea * net/ange-ftp.el (ange-ftp-insert-directory): Handle the case,
FILENAME is not in `default-directory'.  (Bug#5478)

* net/tramp.el (tramp-handle-insert-directory): Simplify handling
of SWITCHES.  Handle the case, FILENAME is not in
`default-directory'.  (Bug#5478)
(tramp-register-file-name-handlers): Add safe-magic property.
2010-01-28 22:13:01 +01:00
Michael Albinus
7e5686f0e5 Fix some busybox annoyances.
* net/tramp.el (tramp-wrong-passwd-regexp): Add "Timeout, server
not responding." string.
(tramp-open-connection-setup-interactive-shell): Dump stty
settings.  Enable "neveropen" arg for all `tramp-send-command'
calls.  Handle "=" in variable values properly.
(tramp-find-inline-encoding): Raise an error, when no encoding is
found.
(tramp-wait-for-output): Check, whether PROC buffer is available.
Remove spurious " ^H" sequences, sent by busybox.
(tramp-get-ls-command): Suppress coloring, if possible.
2010-01-28 07:06:41 +01:00
Juanma Barranquero
db9e401b3b Fix typos in docstrings, error messages, etc. 2010-01-18 05:39:40 +01:00
Glenn Morris
114f9c9679 Add 2010 to copyright years. 2010-01-13 00:35:10 -08:00
Michael Albinus
7f4d4a978d * net/tramp.el (tramp-handle-insert-directory): Quote "'" in the
switches.  Check also for //SUBDIRED// line.
2009-12-26 20:04:43 +00:00
Michael Albinus
1f3611c61a * files.el (file-expand-wildcards): In case of remote files, check
only local file name part for wildcards.  Provide feature 'files
and subfeature 'remote-wildcards.  (Bug#5198)

* net/tramp.el (tramp-handle-file-remote-p): Expand file name only
if there is already an established connection.
(tramp-advice-file-expand-wildcards): Remove it.

* net/tramp-compat.el (top): Autoload `tramp-handle-file-remote-p'.
(tramp-advice-file-expand-wildcards): Moved from tramp.el.
Activate advice for older GNU Emacs versions.  (Bug#5237)
2009-12-17 13:18:03 +00:00
Michael Albinus
68712eb605 * net/tramp.el (tramp-echo-mark-marker-length): New defconst.
(tramp-echo-mark, tramp-echoed-echo-mark-regexp): Use it.
(tramp-check-for-regexp): Check also, when an echoing shell stops
to echo sent commands.
2009-12-15 21:11:39 +00:00
Michael Albinus
fe5facd3c0 * net/tramp.el (tramp-handle-insert-directory): Suppress error messages. 2009-12-09 10:23:00 +00:00
Michael Albinus
dab816a917 Handle prompt rules of ksh in OpenBSD 4.5. Reported by Raphaël
Berbain <raphael.berbain@gmail.com>.

* net/tramp.el (tramp-end-of-output): Move up.  Use `#' and `$'
characters.
(tramp-initial-end-of-output): New defconst.
(tramp-methods, tramp-find-shell)
(tramp-open-connection-setup-interactive-shell)
(tramp-maybe-open-connection): Use it.
(tramp-shell-prompt-pattern, tramp-wait-for-output): Handle
existence of `#' and `$'.

* net/tramp-fish.el (tramp-fish-maybe-open-connection): Use
`tramp-initial-end-of-output'.
2009-12-07 06:38:06 +00:00
Michael Albinus
a09dc9bf9c Cleanup.
* eshell/em-unix.el (top): Require 'esh-opt and 'pcomplete.
(eshell/su, eshell/sudo): Require 'tramp.  Fix problems reading
arguments.  Expand `default-directory'.

* net/tramp.el (tramp-handle-file-remote-p): Expand FILENAME for
the benefit of returning an expanded localname.
(tramp-tramp-file-p): Handle the case NAME is not a string.
2009-12-03 11:34:11 +00:00
Michael Albinus
e2a421af39 * net/tramp.el (tramp-maybe-open-connection): Open the remote
shell with "exec" when possible.  This prevents trailing prompts
in `start-file-process'.
2009-11-29 20:05:23 +00:00
Michael Albinus
605a20a988 Improve handling of processes on remote hosts.
* eshell/esh-util.el (eshell-path-env): New defvar.
(eshell-parse-colon-path): New defun.
(eshell-file-attributes): Use `eshell-parse-colon-path'.

* eshell/esh-ext.el (eshell-search-path): Use
`eshell-parse-colon-path'.
(eshell-remote-command): Remove argument HANDLER.
(eshell-external-command): Check for FTP remote connection.

* eshell/esh-proc.el (eshell-gather-process-output): Use
`file-truename', in order to start also symlinked files. Apply
`start-file-process' instead of `start-process'. Shorten `command'
to the local file name part.

* eshell/em-cmpl.el (eshell-complete-commands-list): Use
`eshell-parse-colon-path'.

* eshell/em-unix.el (eshell/du): Check for FTP remote connection.

* net/tramp.el (tramp-eshell-directory-change): New defun.  Add it
to `eshell-directory-change-hook'.
2009-11-24 10:25:54 +00:00
Michael Albinus
b593f1055a * net/tramp.el (tramp-shell-prompt-pattern): Use \r for carriage
return.
(tramp-handle-make-symbolic-link)
(tramp-handle-dired-compress-file, tramp-handle-expand-file-name):
Quote file names.
(tramp-send-command-and-check): New argument DONT-SUPPRESS-ERR.
(tramp-handle-process-file): Use it.
2009-11-23 15:59:07 +00:00
Michael Albinus
4265deabcb * net/tramp.el (tramp-do-copy-or-rename-file-out-of-band): Set
variables for computing the prompt for reading password.
2009-11-19 09:25:40 +00:00
Michael Albinus
e268e987dc * net/tramp.el (tramp-advice-file-expand-wildcards): Simplify.
Don't set `ad-return-value' if `ad-do-it' doesn't.
2009-11-17 10:38:44 +00:00
Michael Albinus
d7ec1df722 * net/tramp.el (tramp-advice-minibuffer-electric-separator)
(tramp-advice-minibuffer-electric-tilde): Unload advices via
`tramp-unload'.
(tramp-advice-make-auto-save-file-name)
(tramp-advice-file-expand-wildcards): Apply also `ad-activate'
after removing the advice.
2009-11-11 14:40:18 +00:00
Michael Albinus
191bb792fb * net/tramp.el (tramp-advice-make-auto-save-file-name)
(tramp-advice-file-expand-wildcards): Unload via
`ad-remove-advice'.

* net/tramp.el (tramp-advice-file-expand-wildcards): Don't rely on
`ad-do-it'.

* net/tramp.el (tramp-handle-write-region): Copy but rename temp file,
in order to keep context in SELinux.
2009-11-08 10:44:22 +00:00
Michael Albinus
b000a6e24e * net/tramp.el (tramp-handle-copy-directory): Don't use
`file-remote-p' (due to compatibility).
2009-11-07 23:52:48 +00:00
Michael Albinus
293c24f9ad * net/tramp.el (tramp-perl-file-truename): New defconst. Perl
code contributed by yary <not.com@gmail.com> (tiny change).
(tramp-handle-file-truename, tramp-get-remote-perl): Use it.
Check also for "perl-file-spec" and "perl-cwd-realpath"
properties.
(tramp-handle-write-region): In case of APPEND, reuse the tmpfile
name.

* net/tramp.el (tramp-perl-file-name-all-completions): New
defconst.
(tramp-get-remote-readlink): New defun.
(tramp-handle-file-truename): Use it.
(tramp-handle-file-exists-p): Check file-attributes cache, assume
file exists if cache value present.
(tramp-check-cached-permissions) New defun.
(tramp-handle-file-readable-p): Use it.
(tramp-handle-file-writable-p): Likewise.
(tramp-handle-file-executable-p): Likewise.
(tramp-handle-file-name-all-completions): Try using Perl to get
partial completions.  When perl not available, combine `cd' and
`ls' into single remote operation and use shell expansion to get
partial remote directory contents.  Set `file-exists-p' cache for
directory and any files returned by ls.  Change cache handling to
support partial directory contents.  Use error message emitted by
remote `cd' or Perl code for local tramp-error.
(tramp-do-copy-or-rename-file-directly): Avoid separate
tramp-send-command-and-check call.
(tramp-handle-process-file): Merge three remote ops into one.  Do
not flush all caches when `process-file-side-effects' is set.
(tramp-handle-write-region): Avoid tramp-set-file-uid-gid if
file-attributes shows uid/gid to be set already.
2009-10-26 09:29:12 +00:00
Michael Albinus
b88f2d0aa0 * net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
from `rfn-eshadow-update-overlay-hook' when unloading.
(tramp-methods): Add `tramp-copy-keep-tmpfile' for "rsync" and
"rsyncc".  Adjust doc string.
(tramp-temp-buffer-file-name) New buffer-local defvar.
(tramp-handle-insert-file-contents, tramp-handle-write-region):
Keep temporary file when indicated by method ("rsync" and
"rsyncc").
(tramp-handle-write-region): Handle APPEND.
(tramp-delete-temp-file-function): New defun.  Added to
`kill-buffer-hook'.
2009-10-23 15:04:27 +00:00
Michael Albinus
ec5145d684 * net/tramp.el (tramp-replace-environment-variables): Do not fail
if the environment variable does not exist.
2009-10-15 13:15:16 +00:00
Michael Albinus
46bcd78cc0 * net/tramp.el (tramp-local-host-p): Function shall return nil for
connection methods like smb.
2009-10-11 13:59:28 +00:00
Michael Albinus
a17632c1dc * net/tramp.el (tramp-file-name-real-user, tramp-file-name-domain)
(tramp-file-name-real-host, tramp-file-name-port): Apply
`save-match-data.
2009-10-08 15:19:56 +00:00
Glenn Morris
9fb2cdc58b (tramp-handle-start-file-process): Move tramp-error call
inside with-parsed...  macro so that `v' is defined.
2009-10-06 02:50:44 +00:00
Michael Albinus
263c02efe2 * net/tramp.el (tramp-verbose): Fix docstring.
(tramp-methods): Add recursive option to `tramp-copy-args'.  Add
`tramp-copy-recursive'.  Valid for "rcp", "scp", "scp1", "scp2",
"scp1_old", "scp2_old", "rsync", "rsyncc".
(tramp-default-method): Check also for
`auth-source-user-or-password'.
(tramp-file-name-handler-alist, tramp-file-name-for-operation):
Add handler for `copy-directory'.
(tramp-handle-copy-directory): New defun.
(tramp-do-copy-or-rename-file-out-of-band): Handle directory case.
(tramp-handle-start-file-process): Raise an error when PROGRAM is
nil.  Optimize sent command.
2009-10-05 11:30:52 +00:00
Michael Albinus
c15cdf0268 * net/tramp.el (tramp-handle-make-directory): Flush upper
directory's file properties.
(tramp-handle-delete-directory): Handle optional parameter
RECURSIVE.
(tramp-handle-dired-recursive-delete-directory): Flush directory
properties after the remove command only.
2009-10-01 15:34:56 +00:00
Michael Albinus
03db0efcff *** empty log message *** 2009-09-28 11:54:34 +00:00
Michael Albinus
680db9ac65 * net/tramp.el (tramp-perl-file-attributes): Print "nil" when
lstat fails.
(tramp-do-file-attributes-with-ls): Check for file existence at
remote end.
(tramp-do-file-attributes-with-stat): Likewise.
(tramp-convert-file-attributes): Return nil when attr is nil.
2009-09-06 14:19:48 +00:00
Michael Albinus
7ba1d9c24d * net/tramp.el (tramp-handle-insert-directory): Handle "--dired"
also when adding a new directory.
2009-09-04 08:14:30 +00:00
Michael Albinus
7f49fe463d * net/tramp.el (tramp-handle-file-attributes-with-ls)
(tramp-do-file-attributes-with-perl)
(tramp-do-file-attributes-with-stat): Rename from
`tramp-handle-file-attributes-with-*'.
(tramp-handle-file-attributes): Use them.
(tramp-do-directory-files-and-attributes-with-perl)
(tramp-do-directory-files-and-attributes-with-stat): Rename from
`tramp-handle-directory-files-and-attributes-with-*'.
(tramp-handle-directory-files-and-attributes): Use them.
(tramp-method-out-of-band-p): Additional parameter SIZE.
(tramp-do-copy-or-rename-file, tramp-handle-file-local-copy)
(tramp-handle-write-region): Use it.
(tramp-handle-insert-directory): Use "?\ " for compatibility
reasons.
(tramp-handle-vc-registered): Check, whether the first run did
return files to be tested.
(tramp-advice-make-auto-save-file-name): Do not call directly
`tramp-handle-make-auto-save-file-name', because this would bypass
the locking mechanism.
2009-09-02 11:13:42 +00:00
Michael Albinus
aa485f7ca5 * net/tramp.el (all): Replace "'(lambda" by "(lambda".
(tramp-handle-file-local-copy): Unset `file-name-handler-alist'
when writing the temp file.  Otherwise, epa-file gets confused.
(tramp-register-file-name-handlers): Make it a defun.  Move also
`epa-file-handler' to the front of `file-name-handler-alist'.

* net/tramp.el (tramp-shell-prompt-pattern): Allow a prompt to
start right after a ^M.
(tramp-root-regexp, tramp-completion-file-name-regexp-unified)
(tramp-completion-file-name-regexp-separate)
(tramp-completion-file-name-regexp-url): Use \\` and \\'.
(tramp-handle-file-attributes, tramp-set-file-uid-gid): Don't
modify last-coding-system-used by accident.
(tramp-completion-file-name-handler): Apply the checks here,
instead during registration.
(tramp-register-file-name-handlers) Renamed from
`tramp-register-file-name-handler'.  Register both
`tramp-file-name-handler' and `tramp-completion-file-name-handler'.
(tramp-register-completion-file-name-handler): Removed.
2009-08-28 12:11:58 +00:00
Michael Albinus
946a5aeb7d * net/tramp.el (tramp-methods): New method "rsyncc".
(top): Add completion function for "rsyncc".
(tramp-message-show-message): New defvar.
(tramp-message, tramp-error): Use it.
(tramp-do-copy-or-rename-file-directly): Extend check for direct
remote copying.
(tramp-do-copy-or-rename-file-out-of-band): Handle new
`tramp-methods' entry `copy-env' of "rsyncc".
((tramp-handle-process-file): Do not flush all
caches when `process-file-side-effects' is set.
tramp-vc-registered-read-file-names): New defconst.
(tramp-vc-registered-file-names): New defvar.
(tramp-handle-vc-registered): Implement optimization strategy.
(tramp-run-real-handler): Add `tramp-vc-file-name-handler'.
(tramp-vc-file-name-handler): New defun.
(tramp-get-ls-command, tramp-get-test-command)
(tramp-get-file-exists-command, tramp-get-remote-ln)
(tramp-get-remote-perl, tramp-get-remote-stat)
(tramp-get-remote-id): Remove
superfluous `with-current-buffer'.
2009-08-27 13:47:55 +00:00
Michael Albinus
56c195afd0 * net/tramp.el (tramp-register-completion-file-name-handler):
Check also for (member 'partial-completion completion-styles).
2009-08-17 19:12:10 +00:00
Michael Albinus
8e754ea218 * net/tramp.el (tramp-get-ls-command-with-dired): New defun.
(tramp-handle-insert-directory): Handle "--dired".  (Bug#4075)
2009-08-09 14:29:11 +00:00
Michael Albinus
2ac338048e * net/tramp.el (top): Make check for tramp-gvfs loading more
robust.
(tramp-handle-insert-file-contents): `unwind-protect' must be
inside `with-parsed-tramp-file-name'.
2009-08-04 03:32:33 +00:00
Michael Albinus
adcbca532b * net/tramp.el (tramp-rfn-eshadow-update-overlay-regexp) New
defconst.
(tramp-rfn-eshadow-update-overlay): Use it.
2009-08-03 08:22:04 +00:00
Michael Albinus
736ac90f59 * net/tramp.el (tramp-debug-message): Print also microseconds.
(tramp-handle-insert-file-contents): Optimize, when BEG
or END is non-nil.
(tramp-handle-vc-registered): Use `tramp-cache-inhibit-cache'.
(tramp-get-debug-buffer): Change `outline-regexp' according to new
format.
2009-08-02 17:16:39 +00:00
Michael Albinus
905fb90eb1 * net/tramp.el (tramp-do-copy-or-rename-file): Add messages.
Simplify check for out-of-band methods.
(tramp-do-copy-or-rename-file-out-of-band): Allow both files to be
remote.  Remove messages which are in `tramp-do-copy-or-rename-file'.
2009-07-28 20:36:57 +00:00
Michael Albinus
bede3e9f87 * net/tramp.el (tramp-wait-for-output): Handle the case when
commands do not return a newline but a null byte before the shell
prompt.  (Bug#3858)
2009-07-16 10:24:07 +00:00
Michael Albinus
93c3eb7c61 * net/tramp.el (tramp-set-file-uid-gid): Handle the case the
remote user is root, on the local host.
(tramp-local-host-p): Either the local user or the remote user
must be root.
2009-07-08 12:43:42 +00:00
Michael Albinus
3e2fa35354 * net/tramp.el (tramp-handle-write-region): Flush file properties
in case of short track.
2009-07-06 13:37:29 +00:00
Michael Albinus
551b8e0b8c Remove todo items. 2009-06-30 21:10:55 +00:00
Michael Albinus
974647ac91 * net/tramp.el (tramp-default-file-modes) Remove execute permissions. 2009-06-30 15:23:50 +00:00