summaryrefslogtreecommitdiff
path: root/lisp/net/tramp-sh.el
Commit message (Collapse)AuthorAgeFilesLines
* Fix (Bug#32218). Do not merge with masterMichael Albinus2018-07-201-6/+5
| | | | | | | | | | | | | | | * doc/misc/trampver.texi: * lisp/net/trampver.el: Change version to "2.3.4.26.2". (customize-package-emacs-version-alist): Add Tramp version integrated in Emacs 26.2. * lisp/net/tramp.el (tramp-handle-file-truename): * lisp/net/tramp-adb.el (tramp-adb-handle-file-truename): * lisp/net/tramp-sh.el (tramp-sh-handle-file-truename): Fix problem with trailing slash. (Bug#32218) * test/lisp/net/tramp-tests.el (tramp-test21-file-links): Remove `tramp--test-emacs27-p' check.
* Tramp editorialsMichael Albinus2018-07-061-1/+1
| | | | | | | * doc/misc/tramp.texi (Android shell setup): Mention Termux. * lisp/net/tramp-sh.el (tramp-remote-process-environment): Use proper spelling "Tramp" in docstring.
* Fix last change in tramp-sh.elMichael Albinus2018-06-251-2/+4
| | | | | * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-directly): Use "-R" rather than "-r" for recursive copy of directories.
* Fix Bug#31941Michael Albinus2018-06-241-3/+5
| | | | | | | * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file): In case of FILENAME being a directory, check whether `copy-directory' could be avoided. Suggested by Stephen Nutt <stnutt@gmail.com>. (Bug#31941) (tramp-do-copy-or-rename-file-directly): Call "cp" with "-r".
* Sync with Tramp 2.3.4-preMichael Albinus2018-05-291-31/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/misc/trampver.texi: Change version to "2.3.4-pre * lisp/net/tramp.el (tramp-mode, tramp-verbose) (tramp-backup-directory-alist, tramp-auto-save-directory) (tramp-encoding-shell, tramp-encoding-command-switch) (tramp-encoding-command-interactive, tramp-default-method) (tramp-default-method-alist, tramp-default-user) (tramp-default-user-alist, tramp-default-host) (tramp-default-host-alist, tramp-default-proxies-alist) (tramp-save-ad-hoc-proxies, tramp-restricted-shell-hosts-alist) (tramp-local-end-of-line, tramp-rsh-end-of-line) (tramp-login-prompt-regexp, tramp-shell-prompt-pattern) (tramp-password-prompt-regexp, tramp-wrong-passwd-regexp) (tramp-yesno-prompt-regexp, tramp-yn-prompt-regexp) (tramp-terminal-prompt-regexp) (tramp-operation-not-permitted-regexp, tramp-copy-failed-regexp) (tramp-process-alive-regexp, tramp-chunksize) (tramp-process-connection-type, tramp-connection-timeout) (tramp-connection-min-time-diff) (tramp-completion-reread-directory-timeout): * lisp/net/tramp-adb.el (tramp-adb-program) (tramp-adb-connect-if-not-connected, tramp-adb-prompt): * lisp/net/tramp-cache.el (tramp-connection-properties) (tramp-persistency-file-name): * lisp/net/tramp-gvfs.el (tramp-gvfs-methods) (tramp-gvfs-zeroconf-domain, tramp-bluez-discover-devices-timeout): * lisp/net/tramp-sh.el (tramp-inline-compress-start-size) (tramp-copy-size-limit, tramp-terminal-type) (tramp-histfile-override, tramp-use-ssh-controlmaster-options) (tramp-remote-path, tramp-remote-process-environment) (tramp-sh-extra-args): * lisp/net/tramp-smb.el (tramp-smb-program, tramp-smb-acl-program) (tramp-smb-conf, tramp-smb-winexe-program) (tramp-smb-winexe-shell-command) (tramp-smb-winexe-shell-command-switch): Dont't require 'tramp. (Bug#31558) * lisp/net/tramp.el (tramp-accept-process-output): * lisp/net/tramp-adb.el (tramp-adb-handle-start-file-process): * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band) (tramp-sh-handle-start-file-process): * lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory) (tramp-smb-handle-file-acl, tramp-smb-handle-process-file) (tramp-smb-handle-set-file-acl) (tramp-smb-handle-start-file-process): Suppress timers. * lisp/net/tramp-adb.el (tramp-adb-handle-write-region): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-write-region): * lisp/net/tramp-sh.el (tramp-sh-handle-write-region): * lisp/net/tramp-smb.el (tramp-smb-handle-write-region): Write proper message. * lisp/net/tramp-cmds.el (tramp-change-syntax): Use `customize-set-variable'. * lisp/net/tramp-sh.el (tramp-open-connection-setup-interactive-shell): Ensure proper EOL handling for Darwin. (tramp-find-inline-compress): Improve command quoting for w32. Reported by Chris Zheng <chriszheng99@gmail.com>. (tramp-open-connection-setup-interactive-shell): Wrap both echo calls in parentheses, in order to avoid double prompt. * lisp/net/tramp-smb.el (tramp-smb-errors): Add "NT_STATUS_RESOURCE_NAME_NOT_FOUND". * lisp/net/tramp.el (tramp-default-user-alist) (tramp-default-host-alist): Fix docstring. (tramp-dissect-file-name): Adapt docstring. (Bug#30904) (tramp-make-tramp-file-name): Check, that method is not empty. (Bug#30038) (tramp-message-show-message): Change default. * lisp/net/trampver.el: Change version to "2.3.4-pre". * test/lisp/net/tramp-tests.el (ert-x): Require it. (tramp-test10-write-region): Extend test. (tramp--test-emacs27-p, tramp--test-windows-nt): New defuns. (tramp-test11-copy-file, tramp-test12-rename-file) (tramp-test21-file-links, tramp-test24-file-acl) (tramp-test25-file-selinux, tramp--test-check-files): Use them. (tramp-test21-file-links): Do not call `make-symbolic-link' on w32. Fix file name quoting test. (tramp-test32-environment-variables-and-port-numbers): Adapt check for systems which do not support "echo -n". (Bug#29712) (tramp-test36-find-backup-file-name): Call also `convert-standard-filename' due to w32. (tramp-test41-asynchronous-requests): Use $REMOTE_PARALLEL_PROCESSES. Flush cache prior file operations. (tramp-test42-auto-load, tramp-test42-delay-load) (tramp-test42-recursive-load, tramp-test42-remote-load-path): Quote command due to w32.
* Fix copyright years by handPaul Eggert2018-01-011-2/+2
| | | | | These are dates that admin/update-copyright did not update, or updated incorrectly.
* Update copyright year to 2018Paul Eggert2018-01-011-1/+1
| | | | Run admin/update-copyright.
* Fix Bug#29579Michael Albinus2017-12-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | * lisp/files.el (file-name-non-special): Inhibit `file-name-handler-alist' only for some operations. Add missing operations. (Bug#29579) * lisp/net/tramp-compat.el (tramp-compat-file-name-quote): Do not quote if it is quoted already. * lisp/net/tramp-smb.el (tramp-smb-handle-insert-directory): Use `copy-tree' but `copy-sequence'. * lisp/net/tramp.el (tramp-handle-file-truename): Handle several trailing slashes correctly. * test/lisp/net/tramp-tests.el (tramp-test11-copy-file) (tramp-test12-rename-file, tramp-test24-file-acl) (tramp-test25-file-selinux, tramp--test-check-files): Handle also quoted file names. (tramp-test21-file-links): Fix file name quoting test. (tramp-test24-file-acl): Be more robust for "smb" method. (tramp-test35-make-auto-save-file-name): Enable hidden test cases.
* Fix Bug#28139Daniel Pittman2017-11-141-6/+19
| | | | | | | | | * tramp-sh.el: Set TERM and INSIDE_EMACS environment earlier. (tramp-remote-process-environment): Remove TERM and INSIDE_EMACS. (tramp-remote-process-environment): Document their special handling. (tramp-open-shell): Set TERM and INSIDE_EMACS prior to starting the initial remote shell, so that it is also aware of the environment in which it is operating. (Bug#28139)
* Fix Bug#28896Michael Albinus2017-10-201-84/+90
| | | | | | | | | | * lisp/net/tramp-adb.el (tramp-adb-handle-rename-file): * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file): * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file): Handle FILENAME being a directory. (Bug#28896) * test/lisp/net/tramp-tests.el (tramp-test11-copy-file) (tramp-test12-rename-file): Test also FILENAME being a directory.
* Add support for `file-system-info' in TrampMichael Albinus2017-10-031-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/net/tramp.el (tramp-file-name-for-operation): Add `file-system-info'. * lisp/net/tramp-adb.el (tramp-adb-handle-file-system-info): New defun. (tramp-adb-file-name-handler-alist): Use it. * lisp/net/tramp-gvfs.el (tramp-gvfs-file-system-attributes) (tramp-gvfs-file-system-attributes-regexp): New defconst. (tramp-gvfs-handle-file-system-info): New defun. (tramp-gvfs-file-name-handler-alist): Use it. (tramp-gvfs-get-directory-attributes): Fix property name. (tramp-gvfs-get-root-attributes): Support also file system attributes. * lisp/net/tramp-sh.el (tramp-sh-handle-file-system-info): New defun. (tramp-sh-file-name-handler-alist): Use it. (tramp-sh-handle-insert-directory): Insert size information. (tramp-get-remote-df): New defun. * lisp/net/tramp-smb.el (tramp-smb-handle-file-system-info): New defun. (tramp-smb-file-name-handler-alist): Use it. (tramp-smb-handle-insert-directory): Insert size information. * test/lisp/net/tramp-tests.el (tramp-test37-file-system-info): New test. (tramp-test38-asynchronous-requests) (tramp-test39-recursive-load, tramp-test40-remote-load-path) (tramp-test41-unload): Rename.
* Work on Tramp's file-truenameMichael Albinus2017-09-191-17/+9
| | | | | | | | | | * lisp/net/tramp-sh.el (tramp-perl-file-truename): Check also for symlinks. (tramp-sh-handle-file-truename): Move check for a symlink cycle to the end. Do not blame symlinks which look like a remote file name. * lisp/net/tramp.el (tramp-handle-file-truename): Expand result.
* Fix compatibility problem in TrampMichael Albinus2017-09-171-1/+1
| | | | | | | | | | | | | | | | * lisp/net/tramp.el (tramp-interrupt-process): Better error handling. * lisp/net/tramp-compat.el (default-toplevel-value): Move up. (top): Do not call `tramp-change-syntax' anymore. (tramp-compat-directory-name-p): New defalias. * lisp/net/tramp-adb.el (tramp-adb-handle-copy-file): * lisp/net/tramp-sh.el (tramp-sh-handle-copy-directory): * lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory) (tramp-smb-handle-copy-file): Use it. * test/lisp/net/tramp-tests.el (tramp-test28-interrupt-process): Modify test.
* Improve Tramp behaviour according to bug#27986Michael Albinus2017-09-151-10/+12
| | | | | | | | | * lisp/net/tramp-adb.el (tramp-adb-handle-copy-file): * lisp/net/tramp-sh.el (tramp-sh-handle-copy-directory): * lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory) (tramp-smb-handle-copy-file): Check, that NEWNAME is a directory name when existing. Use `file-name-as-directory' where appropriate.
* Prefer HTTPS to FTP and HTTP in documentationPaul Eggert2017-09-131-1/+1
| | | | | | | | | | | | | Most of this change is to boilerplate commentary such as license URLs. This change was prompted by ftp://ftp.gnu.org's going-away party, planned for November. Change these FTP URLs to https://ftp.gnu.org instead. Make similar changes for URLs to other organizations moving away from FTP. Also, change HTTP to HTTPS for URLs to gnu.org and fsf.org when this works, as this will further help defend against man-in-the-middle attacks (for this part I omitted the MS-DOS and MS-Windows sources and the test tarballs to keep the workload down). HTTPS is not fully working to lists.gnu.org so I left those URLs alone for now.
* Further optimization in Tramp's file name decompositionMichael Albinus2017-09-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/net/tramp.el (tramp-syntax): Recompute all file name components. Call `custom-set-variables' after loading. (tramp-build-prefix-format, tramp-build-prefix-regexp) (tramp-build-method-regexp) (tramp-build-postfix-method-format) (tramp-build-postfix-method-regexp) (tramp-build-prefix-ipv6-format) (tramp-build-prefix-ipv6-regexp) (tramp-build-postfix-ipv6-format) (tramp-build-postfix-ipv6-regexp) (tramp-build-postfix-host-format) (tramp-build-postfix-host-regexp) (tramp-build-file-name-regexp) (tramp-build-completion-file-name-regexp): New defuns. (tramp-prefix-format, tramp-prefix-regexp) (tramp-method-regexp, tramp-postfix-method-format) (tramp-postfix-method-regexp, tramp-prefix-ipv6-format) (tramp-prefix-ipv6-regexp, tramp-postfix-ipv6-format) (tramp-postfix-ipv6-regexp, tramp-postfix-host-format) (tramp-postfix-host-regexp) (tramp-remote-file-name-spec-regexp) (tramp-file-name-structure, tramp-file-name-regexp) (tramp-completion-file-name-regexp): Convert defuns into defvars. (tramp-prefix-regexp-alist) (tramp-postfix-method-regexp-alist) (tramp-prefix-ipv6-regexp-alist) (tramp-postfix-ipv6-regexp-alist) (tramp-postfix-host-regexp-alist) (tramp-remote-file-name-spec-regexp-alist): Remove. (tramp-build-remote-file-name-spec-regexp) (tramp-build-file-name-structure): Simplify. (tramp-completion-file-name-regexp-alist): New defconst. (tramp-tramp-file-p, tramp-dissect-file-name) (tramp-make-tramp-file-name) (tramp-completion-make-tramp-file-name) (tramp-rfn-eshadow-update-overlay-regexp) (tramp-register-file-name-handlers) (tramp-completion-handle-file-name-all-completions) (tramp-completion-dissect-file-name, tramp-clear-passwd): * lisp/net/tramp-ftp.el (tramp-ftp-file-name-handler): * lisp/net/tramp-sh.el (tramp-sh-handle-vc-registered) (tramp-compute-multi-hops): Use variables but functions for file name components. * test/lisp/net/tramp-tests.el (tramp-test24-file-name-completion): Use variables but functions for file name components.
* Work on Tramp's (symbolic) linksMichael Albinus2017-09-041-44/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/misc/tramp.texi (Traces and Profiles): Mention the backtrace when tramp-verbose is greater than or equal to 10. * lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist): Use `tramp-handle-add-name-to-file'. * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Use `tramp-handle-add-name-to-file' and `tramp-handle-file-truename'. * lisp/net/tramp-sh.el (tramp-sh-handle-make-symbolic-link): Improve. * lisp/net/tramp-smb.el (tramp-smb-errors): Add "NT_STATUS_CONNECTION_DISCONNECTED" and "NT_STATUS_OBJECT_PATH_SYNTAX_BAD". (tramp-smb-file-name-handler-alist): Use `tramp-handle-file-truename'. (tramp-smb-do-file-attributes-with-stat): Return non-nil only if one of the attributes is non-nil. (tramp-smb-handle-file-local-copy): Use `file-truename'. (tramp-smb-handle-file-truename): Move to tramp.el. (tramp-smb-handle-insert-directory): Show symlinks. (tramp-smb-handle-make-symbolic-link): Improve. (tramp-smb-read-file-entry): Handle extended file modes in Samba. * lisp/net/tramp.el (tramp-handle-add-name-to-file) (tramp-handle-file-truename): New defuns. * test/lisp/net/tramp-tests.el (tramp-test21-file-links): Extend test. (tramp--test-check-files): Make check for "smb".
* Improve symlinks for TrampMichael Albinus2017-08-301-5/+13
| | | | | | | | | | | | | | * lisp/files.el (files--splice-dirname-file): Quote whole file. * lisp/net/tramp-sh.el (tramp-sh-handle-make-symbolic-link): Do not expand TARGET, it could be remote. (tramp-sh-handle-file-truename): Check for cyclic symlink also in case of readlink. Quote result if it looks remote. (tramp-sh-handle-file-local-copy): Use `file-truename'. * test/lisp/net/tramp-tests.el (tramp-test08-file-local-copy) (tramp-test09-insert-file-contents): Test also file missing. (tramp-test21-file-links): Extend test.
* Tramp cleanupMichael Albinus2017-08-271-7/+4
| | | | | | | | | | | | | | | | * lisp/net/tramp-sh.el (tramp-sh-extra-args): Remove compat code. (tramp-sh-handle-make-symbolic-link): More robust check for TARGET remoteness. * lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory): Disable copying by tar temporarily, it doesn't work reliably. (tramp-smb-do-file-attributes-with-stat): Resolve symlink. (tramp-smb-handle-make-symbolic-link): Fix implementation. * lisp/net/tramp.el (tramp-handle-file-symlink-p): Simplify. * test/lisp/net/tramp-tests.el (tramp-test21-file-links): Extend test.
* Fix Tramp part of Bug#28156Michael Albinus2017-08-261-63/+66
| | | | | | | | | | | | | | | | * lisp/files.el (file-name-non-special): Use `file-name-quote' instead prefixing "/:", the file could already be quoted. * lisp/net/tramp.el (tramp-error): Handle null arguments. (tramp-handle-make-symbolic-link): * lisp/net/tramp-sh.el (tramp-sh-handle-make-symbolic-link) (tramp-sh-handle-add-name-to-file): * lisp/net/tramp-smb.el (tramp-smb-handle-add-name-to-file) (tramp-smb-handle-make-symbolic-link): Adapt implementation to stronger semantics in Emacs. (Bug#28156) * test/lisp/net/tramp-tests.el (tramp-test21-file-links): Extend test.
* Implement `interrupt-process' for remote processes (Bug#28066)Michael Albinus2017-08-201-18/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/net/tramp-sh.el (tramp-sh-handle-start-file-process): Support sending signals remotely. (tramp-open-connection-setup-interactive-shell): Trace "remote-tty" connection property. * lisp/net/tramp.el (tramp-advice-interrupt-process): New defun. (top): Add advice to `interrupt-process'. (Bug#28066) * test/lisp/net/tramp-tests.el (tramp-test28-interrupt-process): New test. (tramp-test29-shell-command) (tramp-test30-environment-variables) (tramp-test30-environment-variables-and-port-numbers) (tramp-test31-explicit-shell-file-name) (tramp-test32-vc-registered) (tramp-test33-make-auto-save-file-name) (tramp-test34-make-nearby-temp-file) (tramp-test35-special-characters) (tramp-test35-special-characters-with-stat) (tramp-test35-special-characters-with-perl) (tramp-test35-special-characters-with-ls, tramp-test36-utf8) (tramp-test36-utf8-with-stat, tramp-test36-utf8-with-perl) (tramp-test36-utf8-with-ls) (tramp-test37-asynchronous-requests) (tramp-test38-recursive-load, tramp-test39-remote-load-path) (tramp-test40-unload): Rename. (tramp-test40-unload): Test also removal of advice.
* Implement EXCL of write-region for TrampMichael Albinus2017-08-121-24/+12
| | | | | | | | | | | | | | | | | | | | | | | | | * lisp/net/ange-ftp.el (ange-ftp-write-region): * lisp/net/tramp-adb.el (tramp-adb-handle-write-region) * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-write-region): * lisp/net/tramp-sh.el (tramp-sh-handle-write-region) * lisp/net/tramp-smb.el (tramp-smb-handle-write-region): Implement MUSTBENEW. * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file) * lisp/net/tramp-sh.el (tramp-sh-handle-make-symbolic-link) (tramp-sh-handle-add-name-to-file) (tramp-do-copy-or-rename-file) * lisp/net/tramp-smb.el (tramp-smb-handle-make-symbolic-link): Adapt error message for `file-already-exists'. * src/lisp.h: * src/eval.c (call8): New function. * src/fileio.c (write_region): Pass also lockname and mustbenew to the file name handler. * test/lisp/net/tramp-tests.el (tramp-test10-write-region): Add tests for MUSTBENEW.
* Use `with-demoted-errors' in TrampMichael Albinus2017-07-101-2/+5
| | | | | | * lisp/net/tramp.el (tramp-with-demoted-errors): New defmacro. * lisp/net/tramp-sh.el (tramp-sh-handle-vc-registered): Use it.
* Improve timer handling when Tramp accepts outputMichael Albinus2017-06-291-15/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/net/tramp-compat.el: Avoid compiler warning. * lisp/net/tramp-sh.el (tramp-sh-file-name-handler): Remove lock machinery. * lisp/net/tramp.el (tramp-locked, tramp-locker): Move up. (tramp-file-name-handler): Add lock machinery from `tramp-sh-file-name-handler'. Allow timers to run. (tramp-accept-process-output): Remove nasty workaround. Suppress timers. * test/lisp/net/tramp-tests.el (shell-command-sentinel): Suppress run in tests. (tramp--instrument-test-case-p): New defvar. (tramp--instrument-test-case): Use it in order to allow nested calls. (tramp--test-message, tramp--test-backtrace): New defsubst, will be used for occasional test instrumentation. (tramp-test00-availability, tramp-test31-vc-registered): Use them. (tramp-test28-shell-command) (tramp--test-shell-command-to-string-asynchronously): Suppress nasty messages. Don't overwrite sentinel. (tramp-test36-asynchronous-requests): Rewrite major parts. Expect :passed.
* * lisp/net/tramp-sh.el (tramp-set-file-uid-gid): Do not handle locally on w32.Michael Albinus2017-06-131-4/+4
|
* Handle port and domain in Tramp's password cacheMichael Albinus2017-06-121-4/+8
| | | | | | | | | | | | | * doc/misc/tramp.texi (Password handling): Explain port and domain handling in authinfo. * lisp/net/tramp.el (tramp-process-actions, tramp-clear-passwd): * lisp/net/tramp-gvfs.el (tramp-gvfs-handler-askpassword): * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band) (tramp-maybe-open-connection): * lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory) (tramp-smb-handle-file-acl, tramp-smb-handle-set-file-acl) (tramp-smb-maybe-open-connection): Handle also domain and port.
* * lisp/net/tramp-sh.el (tramp-maybe-open-connection): Fix port handling.Michael Albinus2017-06-071-7/+1
|
* Fix error in Tramp rsync methodMichael Albinus2017-06-051-1/+1
| | | | | * lisp/net/tramp-sh.el (tramp-methods) <rsync>: Add "-c" argument. Otherwise, `tramp-test10-write-region' could fail.
* Remove Emacs 23 compat code from TrampMichael Albinus2017-05-261-31/+15
| | | | | | | | | | | | | | | | | | | | | | * doc/misc/tramp.texi (Remote processes): Don't mention Emacs 24 explicitely. (Frequently Asked Questions): Remove Emacs 23 from compatibility list. * lisp/net/tramp.el: * lisp/net/tramp-adb.el: * lisp/net/tramp-cache.el: * lisp/net/tramp-gvfs.el: * lisp/net/tramp-sh.el: * lisp/net/tramp-smb.el: Replace compat function calls. * lisp/net/tramp-compat.el (remote-file-name-inhibit-cache) (tramp-compat-condition-case-unless-debug) (tramp-compat-copy-file, tramp-compat-copy-directory) (tramp-compat-delete-file, tramp-compat-delete-directory) (tramp-compat-process-live-p): Remove them. * lisp/net/trampver.el: Make version check fit for Emacs 24.
* Switch Tramp to cl-libMichael Albinus2017-05-251-6/+5
| | | | | | | | | | | | | | | | | | | | | | | * lisp/net/tramp-compat.el (cl-lib): Require it rather than cl. * lisp/net/tramp-ftp.el: Don't require cl. * lisp/net/tramp-gvfs.el: Don't require cl. (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p): Use `cl-*' macros. * lisp/net/tramp-sh.el: Don't require cl. (tramp-set-file-uid-gid): Use `shell-quote-argument'. (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter): Use `cl-*' macros. * lisp/net/tramp-smb.el: Don't require cl. (tramp-smb-read-file-entry): Use `cl-*' macros. * lisp/net/tramp.el (cl-lib): Require it rather than cl. (tramp-parse-file, tramp-parse-shostkeys-sknownhosts) (tramp-parse-passwd, tramp-parse-etc-group) (tramp-parse-putty): Use `cl-*' macros.
* Introduce a defstruct `tramp-file-name' as central data structure.Michael Albinus2017-05-241-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This solves also Bug#27009. * lisp/net/tramp.el (tramp-current-domain) (tramp-current-port): New defvars. (tramp-file-name): New defstruct. (tramp-file-name-user-domain, tramp-file-name-host-port) (tramp-file-name-equal-p): New defuns. (tramp-file-name-p, tramp-file-name-method) (tramp-file-name-user, tramp-file-name-host) (tramp-file-name-localname, tramp-file-name-hop) (tramp-file-name-real-user, tramp-file-name-domain) (tramp-file-name-real-host, tramp-file-name-port): Remove defuns. They are provided by the defstruct, or not needed anymore. (tramp-dissect-file-name, tramp-buffer-name) (tramp-make-tramp-file-name, tramp-get-buffer) (tramp-set-connection-local-variables) (tramp-debug-buffer-name, tramp-message) (tramp-error-with-buffer, with-parsed-tramp-file-name) (tramp-completion-dissect-file-name1) (tramp-handle-file-name-as-directory) (tramp-handle-file-name-directory) (tramp-handle-file-remote-p, tramp-handle-file-symlink-p) (tramp-handle-find-backup-file-name) (tramp-handle-insert-file-contents, tramp-process-actions) (tramp-check-cached-permissions, tramp-local-host-p) (tramp-get-remote-tmpdir, tramp-call-process) (tramp-call-process-region, tramp-read-passwd) (tramp-clear-passwd): * lisp/net/tramp-adb.el (tramp-adb-parse-device-names) (tramp-adb-handle-expand-file-name) (tramp-adb-handle-file-truename, tramp-adb-handle-copy-file) (tramp-adb-handle-process-file) (tramp-adb-maybe-open-connection): * lisp/net/tramp-cache.el (tramp-get-hash-table) (tramp-get-file-property, tramp-set-file-property) (tramp-flush-file-property, tramp-flush-directory-property) (tramp-get-connection-property) (tramp-set-connection-property, tramp-connection-property-p) (tramp-flush-connection-property, tramp-cache-print) (tramp-list-connections, tramp-dump-connection-properties) (tramp-parse-connection-properties): * lisp/net/tramp-cmds.el (tramp-cleanup-connection): * lisp/net/tramp-ftp.el (tramp-ftp-file-name-handler): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name) (tramp-gvfs-url-file-name, tramp-gvfs-handler-askpassword) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-mount-spec, tramp-gvfs-get-remote-uid) (tramp-gvfs-get-remote-gid) (tramp-gvfs-maybe-open-connection): * lisp/net/tramp-sh.el (tramp-sh-handle-file-truename) (tramp-do-copy-or-rename-file-out-of-band) (tramp-sh-handle-expand-file-name) (tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-compute-multi-hops) (tramp-maybe-open-connection) (tramp-make-copy-program-file-name, tramp-get-remote-path) (tramp-get-inline-coding): * lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory) (tramp-smb-handle-expand-file-name) (tramp-smb-handle-file-acl, tramp-smb-handle-process-file) (tramp-smb-handle-set-file-acl) (tramp-smb-maybe-open-connection): Adapt according to defstruct.
* Add test for Bug#27009 in tramp-tests.elMichael Albinus2017-05-231-1/+1
| | | | | | | | | | | * lisp/net/tramp-sh.el (tramp-compute-multi-hops): Check `tramp-file-name-real-host' for being a local host. * lisp/net/tramp.el (tramp-postfix-host-regexp): Fix docstring. * test/lisp/net/tramp-tests.el (tramp-test-temporary-file-directory): Declare default host for mock method. (tramp-test29-environment-variables-and-port-numbers): New test.
* Fix a problem with OpenSSH 7 in TrampMichael Albinus2017-05-191-1/+3
| | | | | * lisp/net/tramp-sh.el (tramp-ssh-controlmaster-options): Set also "ConnectTimeout" during test. Otherwise, OpenSSH 7 will hang.
* Revert "Output number of characters added to file (Bug#354)"Noam Postavsky2017-05-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The extra message text turned out to be quite annoying in practice, and is generally more trouble than it's worth. Also revert several related changes. Partially revert "Handle `write-region' messages in Tramp properly" Revert "New var write-region-verbose, default nil" Revert "* src/fileio.c (write_region): Don't say "1 characters". (Bug#26796)" Revert "Minor tuneup of write-region change" Revert "Adjust write-region so file name is at the beginning again" Revert "Fix handling of non-integer START param to write-region" Revert "Output number of characters added to file (Bug#354)" * doc/emacs/files.texi (Misc File Ops): * etc/NEWS: * lisp/epa-file.el (epa-file-write-region): * lisp/gnus/mm-util.el (mm-append-to-file): * lisp/jka-compr.el (jka-compr-write-region): * lisp/net/ange-ftp.el (ange-ftp-write-region): * lisp/net/tramp-adb.el (tramp-adb-handle-write-region): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-write-region): * lisp/net/tramp-sh.el (tramp-sh-handle-write-region): * lisp/net/tramp-smb.el (tramp-smb-handle-write-region): * lisp/net/tramp.el (tramp-handle-write-region-message): * src/fileio.c (write_region, syms_of_fileio): * test/lisp/net/tramp-tests.el (tramp-test10-write-region): Remove extra characters from file writing messages.
* Handle `write-region' messages in Tramp properlyMichael Albinus2017-05-081-5/+1
| | | | | | | | | | | | | | | | | | | | | | * lisp/net/tramp.el (tramp-handle-write-region-message): New defsubst. * lisp/net/tramp-adb.el (tramp-adb-handle-write-region): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-write-region): * lisp/net/tramp-sh.el (tramp-sh-handle-write-region): * lisp/net/tramp-smb.el (tramp-smb-handle-write-region): Use it. * lisp/net/tramp.el (tramp-password-prompt-regexp) (tramp-completion-mode-p): * lisp/net/tramp-cmds.el (tramp-reporter-dump-variable) (tramp-append-tramp-buffers): * lisp/net/tramp-smb.el (tramp-smb-maybe-open-connection): Use `bound-and-true-p'. * lisp/net/tramp-compat.el (tramp-compat-delete-file): Don't check for `boundp' anymore. * test/lisp/net/tramp-tests.el (ert-x): Require it. (tramp--test-messages): New defvar. (tramp-test10-write-region): Extend test.
* Set process property `adjust-window-size-function' to `ignore' in TrampMichael Albinus2017-05-041-0/+2
| | | | | | | | | | | | * lisp/net/tramp-adb.el (tramp-adb-parse-device-names) (tramp-adb-maybe-open-connection): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-notify-add-watch): * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band) (tramp-maybe-open-connection): * lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory) (tramp-smb-handle-file-acl, tramp-smb-handle-set-file-acl) (tramp-smb-maybe-open-connection): Set process property `adjust-window-size-function' to `ignore'.
* Fix Bug#26763Michael Albinus2017-05-031-6/+9
| | | | | | | | | | | | | | * lisp/files.el (delete-directory): Call file name handler with `trash' argument. * lisp/net/ange-ftp.el (ange-ftp-delete-directory): * lisp/net/tramp-sh.el (tramp-sh-handle-delete-directory): Add TRASH arg. Implement it. (Bug#26763) (tramp-get-remote-trash): Check for `delete-by-moving-to-trash'. * lisp/net/tramp-adb.el (tramp-adb-handle-delete-directory): * lisp/net/tramp-smb.el (tramp-smb-handle-delete-directory): Add _TRASH arg.
* Adjust write-region so file name is at the beginning againNoam Postavsky2017-04-071-3/+2
| | | | | | | | | | | * lisp/epa-file.el (epa-file-write-region): * lisp/gnus/mm-util.el (mm-append-to-file): * lisp/jka-compr.el (jka-compr-write-region): * lisp/net/ange-ftp.el (ange-ftp-write-region): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-write-region): * lisp/net/tramp-sh.el (tramp-sh-handle-write-region): * src/fileio.c (write_region): Put file name at the beginning and move number of characters to the end of the message.
* Fix handling of non-integer START param to write-regionNoam Postavsky2017-04-071-1/+4
| | | | | | | | | | | | The previous patch for Bug#354 incorrectly assumed that START would always be an integer. * lisp/epa-file.el (epa-file-write-region): * lisp/jka-compr.el (jka-compr-write-region): * lisp/net/ange-ftp.el (ange-ftp-write-region): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-write-region): * lisp/net/tramp-sh.el (tramp-sh-handle-write-region): * src/fileio.c (write_region): Handle nil and string values of START.
* Output number of characters added to file (Bug#354)Jeff Clough2017-04-061-1/+2
| | | | | | | | | | | | | * fileio.c (write_region): * epa-file.el (epa-file-write-region): * jka-compr.el (jka-compr-write-region): * ange-ftp.el (ange-ftp-write-region): * tramp-gvfs.el (tramp-gvfs-handle-write-region): * tramp-sh.el (tramp-sh-handle-write-region): * mm-util.el (mm-append-to-file): Functions now output characters written in addition to file name. * files.texi: Added documentation to write-region and append-to-file describing their output.
* Add new Tramp syntaxMichael Albinus2017-04-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/net/tramp-cmds.el (tramp-change-syntax): New defun. * lisp/net/tramp.el (tramp-syntax): Change default to `def'. Add :set function. (tramp-prefix-port-format): Simplify. (tramp-file-name-regexp-separate): Remove. (tramp-initial-file-name-regexp) (tramp-completion-file-name-regexp-old-style) (tramp-initial-completion-file-name-regexp): New defconst. (tramp-prefix-format, tramp-prefix-regexp) (tramp-method-regexp, tramp-postfix-method-format) (tramp-postfix-method-regexp, tramp-prefix-ipv6-format) (tramp-prefix-ipv6-regexp, tramp-postfix-ipv6-format) (tramp-postfix-ipv6-regexp) (tramp-postfix-host-format, tramp-postfix-host-regexp) (tramp-remote-file-name-spec-regexp) (tramp-file-name-structure, tramp-file-name-regexp) (tramp-completion-file-name-regexp) (tramp-rfn-eshadow-update-overlay-regexp): Change them to be defuns. (tramp-tramp-file-p, tramp-find-method) (tramp-dissect-file-name, tramp-make-tramp-file-name) (tramp-completion-make-tramp-file-name) (tramp-rfn-eshadow-update-overlay) (tramp-register-autoload-file-name-handlers) (tramp-register-file-name-handlers) (tramp-unload-file-name-handlers) (tramp-completion-handle-file-name-all-completions) (tramp-completion-dissect-file-name, tramp-clear-passwd): * lisp/net/tramp-ftp.el (tramp-ftp-file-name-handler): * lisp/net/tramp-sh.el (tramp-sh-handle-vc-registered) (tramp-compute-multi-hops): Use them.
* * lisp/net/tramp-sh.el (tramp-get-remote-locale): Add "C.UTF-8" as candidate.Michael Albinus2017-03-301-1/+1
|
* Fix Bug#26258Michael Albinus2017-03-261-5/+6
| | | | | | | | | | | | | | | * lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): * lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist): * lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist): Autoload. Call `tramp-register-foreign-file-name-handler'. (Bug#26258) * lisp/net/tramp.el (tramp-autoload-file-name-handler): Remove. (tramp-register-autoload-file-name-handlers) (tramp-register-file-name-handlers): Do not handle `tramp-autoload-file-name-handler' anymore. Mark `operations' the handlers are responsible for. (tramp-register-foreign-file-name-handler): New defun.
* Use lexical-bind in TrampMichael Albinus2017-03-231-4/+4
| | | | | | | | | | | | | | | | | | | | | * lisp/net/tramp*.el: Add lexical-binding cookie. Move declarations up. * lisp/net/tramp-adb.el (tramp-adb-parse-device-names): Use `push' rather than `add-to-list'. (tramp-adb-get-device): Remove unused variable. * lisp/net/tramp-gvfs.el (tramp-gvfs-parse-device-names): Remove unused variable. * lisp/net/tramp.el (auto-save-file-name-transforms): Declare. (tramp-find-file-name-coding-system-alist): Use `push' rather than `add-to-list'. * test/lisp/net/tramp-tests.el: Add lexical-binding cookie. Require 'dired. Move declarations up. (tramp-test32-make-nearby-temp-file): Wrap `make-nearby-temp-file' and `temporary-file-directory' calls with `with-no-warnings'. (tramp-test35-asynchronous-requests): Mark unused variable.
* Require method in remote file name syntaxMichael Albinus2017-03-131-22/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/minibuffer.el (completion--nth-completion): Do not bind `non-essential'. * lisp/net/tramp-adb.el (tramp-adb-maybe-open-connection): * lisp/net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection): * lisp/net/tramp-sh.el (tramp-maybe-open-connection): * lisp/net/tramp-smb.el (tramp-smb-maybe-open-connection): Do not call `tramp-check-proper-method-and-host'. * lisp/net/tramp-sh.el (tramp-ssh-controlmaster-options): Better traces. (tramp-maybe-open-connection): Do not use argument for ´tramp-completion-mode-p'. * lisp/net/tramp.el (tramp-default-method-marker): New defconst. (tramp-prefix-format, tramp-postfix-method-format) (tramp-prefix-ipv6-format, tramp-postfix-ipv6-format) (tramp-prefix-port-format, tramp-postfix-host-format) (tramp-file-name-regexp, tramp-completion-file-name-regexp): Use `eq' instead of `eqal'. (tramp-method-regexp, tramp-domain-regexp) (tramp-remote-file-name-spec-regexp) (tramp-file-name-regexp-unified) (tramp-completion-file-name-regexp-unified) (tramp-completion-file-name-regexp-separate): Adapt regexp. (tramp-completion-file-name-handler-alist) (tramp-run-real-handler): Autoload them. (tramp-find-method): Handle `tramp-default-method-marker'. (tramp-check-proper-method-and-host) (tramp-completion-run-real-handler): Remove them. (tramp-error-with-buffer, tramp-connectable-p): Do not use argument for ´tramp-completion-mode-p'. (tramp-find-foreign-file-name-handler): Remove COMPLETION argument. Do not apply heuristic for completion. (tramp-file-name-handler): Do not modify `non-essential'. (tramp-completion-file-name-handler): Change implementation. (tramp-autoload-file-name-handler) (tramp-completion-handle-file-name-all-completions): Call `tramp-run-real-handler'. (tramp-completion-mode-p): Do not autoload. Remove argument. Do not apply heuristic for completion. (tramp-completion-dissect-file-name): Simplify implementation. (tramp-handle-file-name-as-directory): Call `tramp-connectable-p'. * test/lisp/net/tramp-tests.el (tramp-test01-file-name-syntax) (tramp-test02-file-name-dissect) (tramp-test03-file-name-defaults) (tramp-test06-directory-file-name): Adapt to the new syntax. (tramp-test11-copy-file, tramp-test12-rename-file) (tramp--test-check-files): Deactivate temporarily tests with quoted file names. (tramp-test16-directory-files, tramp-test17-insert-directory): Adapt tests. (tramp-test24-file-name-completion): Do not check for completion mode. (tramp-test31-make-auto-save-file-name): Deactivate temporarily two tests.
* Fix bug#23006Michael Albinus2017-03-091-1/+1
| | | | | | | | | | | | * lisp/minibuffer.el (completion--nth-completion): Let-bind `non-essential'. * lisp/net/tramp.el (tramp-completion-mode): Fix docstring. (tramp-completion-mode-p): Optional parameter VEC. Replace check for `last-input-event' by analysing VEC argument. (tramp-error-with-buffer, tramp-file-name-handler) (tramp-connectable-p, tramp-handle-file-name-as-directory): * lisp/net/tramp-sh.el (tramp-maybe-open-connection): Use it.
* Fix bug#26011Michael Albinus2017-03-081-0/+5
| | | | | * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-via-buffer): Check, whether file is too large. (Bug#26011)
* Fix bug#25854Michael Albinus2017-02-251-14/+17
| | | | | | * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls): Simplify error handling for huge inodes. (tramp-convert-file-attributes): Handle very huge inodes. (Bug#25854)
* Unset `non-essential' in Tramp when not needed anymoreMichael Albinus2017-02-181-4/+3
| | | | | | | | | | | * doc/misc/trampver.texi: * lisp/net/trampver.el: Change version to "2.3.2-pre". * lisp/net/tramp-sh.el (tramp-maybe-open-connection): Use `tramp-completion-mode-p'. * lisp/net/tramp.el (tramp-file-name-handler): Unset `non-essential' when file name doesn't match `tramp-completion-file-name-regexp'.
* Support stat 8.26 in TrampMichael Albinus2017-01-111-4/+6
| | | | | * lisp/net/tramp-sh.el (tramp-get-remote-stat): Use QUOTING_STYLE environment variable of newer coreutils. (Bug#23422)