* net/tramp.el (tramp-file-name-regexp-unified): Simplify.
(tramp-file-name-for-operation): Use `tramp-tramp-file-p'.
(tramp-handle-substitute-in-file-name): Let-bind `process-environment'
to nil when running original file name handler. Otherwise,
there are problems with constructs like "$$FOO".
* net/tramp-sh.el (tramp-do-copy-or-rename-file): Use correct prefix
for `localname'.
of BEG and END.
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Use
`tramp-handle-insert-file-contents'.
(tramp-gvfs-handle-insert-file-contents): Remove function.
* net/tramp-sh.el (tramp-sh-handle-insert-directory): Use
`save-restriction' in order to keep markers.
* net/trampver.el: Update release number.
(tramp-get-remote-uid-with-id, tramp-get-remote-gid-with-id)
(tramp-get-remote-python): New defuns.
(tramp-get-remote-uid-with-perl)
(tramp-get-remote-gid-with-perl): New defuns. Perl code
contributed by yary <not.com@gmail.com> (tiny change).
(tramp-get-remote-uid-with-python)
(tramp-get-remote-gid-with-python): New defuns. Python code
contributed by Andrey Tykhonov <atykhonov@gmail.com> (tiny change).
(tramp-get-remote-uid, tramp-get-remote-gid): Use new defuns.
* net/tramp.el (tramp-find-method, tramp-find-user): Call `propertize'
only if it is bound. It isn't for XEmacs.
(with-tramp-progress-reporter): Do not let-bind `result'. This
yields to scoping errors in XEmacs.
(tramp-handle-make-auto-save-file-name): New function, moved from
tramp-sh.el.
* net/tramp-adb.el (tramp-adb-file-name-handler-alist): Add handler
for `make-auto-save-file-name'.
(tramp-adb--gnu-switches-to-ash): Use
`tramp-compat-replace-regexp-in-string'.
* net/tramp-cache.el (tramp-cache-print): Call
`substring-no-properties' only if it is bound. It isn't for XEmacs.
* net/tramp-cmds.el (tramp-bug): Call `propertize' only if it is
bound. It isn't for XEmacs.
* net/tramp-compat.el (tramp-compat-copy-file): Catch
`wrong-number-of-arguments' error.
(tramp-compat-replace-regexp-in-string): New defun.
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add handler
for `make-auto-save-file-name'.
(tramp-gvfs-handle-copy-file): Use `tramp-compat-funcall' for
`copy-file'.
(tramp-gvfs-file-gvfs-monitor-file-process-filter)
(tramp-gvfs-file-name): Use `tramp-compat-replace-regexp-in-string'.
(tramp-synce-list-devices): Use `push' instead of `pushnew'.
* net/tramp-gw.el (tramp-gw-open-network-stream): Use
`tramp-compat-replace-regexp-in-string'.
* net/tramp-sh.el (tramp-sh-file-name-handler-alist): Call
`tramp-handle-make-auto-save-file-name'.
(tramp-sh-handle-make-auto-save-file-name): Move to tramp.el.
(tramp-sh-file-gvfs-monitor-dir-process-filter)
(tramp-sh-file-inotifywait-process-filter): Use
`tramp-compat-replace-regexp-in-string'.
(tramp-compute-multi-hops): Use `push' instead of `pushnew'.
* net/tramp-smb.el (tramp-smb-file-name-handler-alist): Add handler
for `make-auto-save-file-name'.
(tramp-smb-handle-copy-directory): Call
`tramp-compat-replace-regexp-in-string'.
(tramp-smb-get-file-entries): Use `push' instead of `pushnew'.
(tramp-smb-handle-copy-file): Improve error message.
(tramp-smb-handle-rename-file): Rename directly only in case
`newname' does not exist yet. This is a restriction of smbclient.
(tramp-smb-maybe-open-connection): Rerun the function only when
`auth-sources' is non-nil.
* net/tramp.el (tramp-find-method, tramp-find-user): Mark result
with text property `tramp-default', if appropriate.
(tramp-check-proper-host): New defun.
(tramp-dissect-file-name): Do not check hostname. Revert change
of 2013-03-18.
(tramp-backtrace): Make VEC-OR-PROC optional.
* net/tramp-adb.el (tramp-adb-maybe-open-connection):
* net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection):
* net/tramp-sh.el (tramp-maybe-open-connection):
* net/tramp-smb.el (tramp-smb-maybe-open-connection): Apply
`tramp-check-proper-host'.
`file-notify-support'. Do not autoload. Adapt all uses.
(file-notify-supported-p): New defun.
* autorevert.el (auto-revert-use-notify): Use
`file-notify-supported-p' instead of `file-notify-support'. Adapt
docstring.
(auto-revert-notify-add-watch): Use `file-notify-supported-p'.
* net/tramp.el (tramp-file-name-for-operation):
Add `file-notify-supported-p'.
* net/tramp-sh.el (tramp-sh-handle-file-notify-supported-p):
New defun.
(tramp-sh-file-name-handler-alist): Add it as handler for
`file-notify-supported-p '.
* net/tramp-adb.el (tramp-adb-file-name-handler-alist):
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist):
* net/tramp-smb.el (tramp-smb-file-name-handler-alist):
Add `ignore' as handler for `file-notify-*' functions.
* net/tramp.el (tramp-current-connection): New defvar, moved from
tramp-sh.el.
(tramp-message-show-progress-reporter-message): Removed, not
needed anymore.
(tramp-error-with-buffer): Show message in minibuffer. Discard
input before waiting. Reset connection timestamp.
(with-tramp-progress-reporter): Improve messages.
(tramp-process-actions): Use progress reporter. Delete process in
case of error. Improve messages.
* net/tramp-sh.el (tramp-barf-if-no-shell-prompt): Use
condition-case. Call `tramp-error-with-buffer' with vector and buffer.
(tramp-current-connection): Removed.
(tramp-maybe-open-connection): The car of
`tramp-current-connection' are the first 3 slots of the vector.
both "gvfs-monitor-dir" and "inotifywait".
(tramp-sh-file-inotifywait-process-filter): Renamed from
`tramp-sh-file-notify-process-filter'.
(tramp-sh-file-gvfs-monitor-dir-process-filter)
(tramp-get-remote-gvfs-monitor-dir): New defuns.
* net/tramp-gvfs.el (top): Extend check for gvfs availability.
(tramp-gvfs-methods-mounttracker, tramp-gvfs-listmounts)
(tramp-gvfs-mountlocation, tramp-gvfs-mountlocation-signature):
New defconst.
(tramp-gvfs-file-name-handler-alist) [directory-files]:
[directory-files-and-attributes, file-exists-p, file-modes]: Use
Tramp default handler.
[file-acl, file-selinux-context, process-file, set-file-acl]:
[set-file-modes, set-file-selinux-context, shell-command]:
[start-file-process ]: Remove handler.
[verify-visited-file-modtime]: New handler.
(tramp-gvfs-dbus-string-to-byte-array)
(tramp-gvfs-dbus-byte-array-to-string): New defuns. Replace all
calls of `dbus-string-to-byte-array' and
`tramp-gvfs-dbus-byte-array-to-string'.
(tramp-gvfs-handle-copy-file)
(tramp-gvfs-handle-delete-directory)
(tramp-gvfs-handle-delete-file, tramp-gvfs-handle-file-attributes)
(tramp-gvfs-handle-file-directory-p)
(tramp-gvfs-handle-file-executable-p)
(tramp-gvfs-handle-file-name-all-completions)
(tramp-gvfs-handle-file-readable-p)
(tramp-gvfs-handle-file-writable-p)
(tramp-gvfs-handle-insert-directory)
(tramp-gvfs-handle-insert-file-contents)
(tramp-gvfs-handle-make-directory, tramp-gvfs-handle-rename-file)
(tramp-gvfs-handle-set-visited-file-modtime)
(tramp-gvfs-handle-write-region): Rewrite.
(tramp-gvfs-handle-file-acl)
(tramp-gvfs-handle-file-selinux-context)
(tramp-gvfs-handle-process-file, tramp-gvfs-handle-set-file-acl)
(tramp-gvfs-handle-set-file-modes)
(tramp-gvfs-handle-set-file-selinux-context)
(tramp-gvfs-handle-shell-command)
(tramp-gvfs-handle-start-file-process)
(tramp-gvfs-handle-verify-visited-file-modtime): Remove defuns.
(tramp-gvfs-url-file-name): Do not use `file-truename', we work
over the symlinks. Fix user handling.
(top, tramp-gvfs-handler-mounted-unmounted): Handle different names
of the D-Bus signals.
(tramp-gvfs-connection-mounted-p): Handle different names of the
D-Bus methods.
(tramp-gvfs-mount-spec-entry): New defun.
(tramp-gvfs-mount-spec): Use it.
(tramp-gvfs-maybe-open-connection): Check, that in case of "smb"
there is a share name. Handle different names of the D-Bus
signals and methods.
(tramp-gvfs-maybe-open-connection): Set connection properties
needed for `tramp-check-cached-permissions'.
(tramp-gvfs-send-command): Apply `tramp-gvfs-maybe-open-connection'.
Return t or nil.
* net/tramp.el (tramp-backtrace): Move up.
(tramp-error): Apply a backtrace into the debug buffer when
`tramp-verbose > 9.
(tramp-file-mode-type-map, tramp-file-mode-from-int)
(tramp-file-mode-permissions, tramp-get-local-uid)
(tramp-get-local-gid, tramp-check-cached-permissions): Move from
tramp-sh.el.
* net/tramp-sh.el (tramp-file-mode-type-map)
(tramp-check-cached-permissions, tramp-file-mode-from-int)
(tramp-file-mode-permissions, tramp-get-local-uid)
(tramp-get-local-gid): Move to tramp.el.
(tramp-warned-obsolete-methods): New defvar.
(tramp-find-method): Check for obsolete methods. Map them to a
replacement method if appropriate.
* net/tramp-sh.el (tramp-methods) [scp1, scp2, ssh1, ssh2, plink1]:
Remove methods.
(top): Remove completion functions for "scp1", "scp2", "ssh1",
"ssh2" and "plink1".
"2>/dev/null" to the ls command, in case "en_US.utf8" is not
defined. POSIX environments fall back to the "C" locale then and
emit a warning, which shall be suppressed.
(tramp-ssh-controlmaster-options): Rename it from
`tramp-ssh-controlmaster-template'. Return a string.
(tramp-default-method): Adapt check for
`tramp-ssh-controlmaster-options'.
* net/tramp-sh.el (tramp-methods): Replace
`tramp-ssh-controlmaster-template' by "%c".
(tramp-do-copy-or-rename-file-out-of-band)
(tramp-maybe-open-connection): Use it in format spec. Ensure,
that it is applied for the first hop only.
(eshell/sudo): Require tramp. Remove now unnecessary check.
* net/tramp-sh.el (tramp-sh-handle-start-file-process): Let-bind
`tramp-current-connection' in order to avoid an error when several
commands are invoked in a short time in eshell and friends.
(tramp-get-connection-property): Use it.
* net/tramp-compat.el (top): Require 'trampver.
* net/tramp-sh.el (tramp-remote-process-environment): Set
tramp-autoload cookie.
* net/tramp-compat.el (top): Declare `remote-file-name-inhibit-cache'
only if it doesn't exist.
* net/tramp-sh.el (tramp-sh-handle-start-file-process): Set
process marker.
(tramp-backtrace): New defun.
(tramp-handle-insert-file-contents): Use `visit' when inserting
the local copy.
* net/tramp-sh.el (tramp-sh-handle-set-visited-file-modtime): Use
`remote-file-name-inhibit-cache'.
`string-as-unibyte'. The function does not exist on XEmacs, and
likely we need another approach.
* net/tramp-sh.el (tramp-compute-multi-hops): Check, whether
`tramp-gw-*' variables are bound.
(tramp-completion-reread-directory-timeout): Fix type.
(tramp-connection-min-time-diff): New defcustom.
* net/tramp-sh.el (tramp-maybe-open-connection): Use it.
(tramp-gw-tunnel-method, tramp-gw-socks-method): Declare for
compatibility.
(tramp-compute-multi-hops): Check, whether
`tramp-gw-tunnel-method' and `tramp-gw-socks-method' are non-nil.
* net/tramp-sh.el (tramp-sh-handle-start-file-process): Catch
`suppress'. Otherwise, `tramp-run-real-handler' might be called
in `tramp-file-name-handler'.