1. 18 Jul, 2021 1 commit
    • Michael Albinus's avatar
      Make remote file locks more robust · 7075ebbf
      Michael Albinus authored
      * lisp/net/tramp.el (tramp-handle-write-region):
      * lisp/net/tramp-adb.el (tramp-adb-handle-write-region):
      * lisp/net/tramp-smb.el (tramp-smb-handle-write-region):
      * lisp/net/tramp-sshfs.el (tramp-sshfs-handle-write-region):
      Make file locks more robust.
      
      * test/lisp/net/tramp-tests.el (tramp-test39-make-lock-file-name):
      Rename and extend.
      7075ebbf
  2. 14 Jul, 2021 1 commit
    • Michael Albinus's avatar
      Preserve backward compatibility in Tramp · 525d5cab
      Michael Albinus authored
      * lisp/net/tramp-crypt.el (tramp-crypt-handle-lock-file)
      (tramp-crypt-handle-unlock-file): Preserve backward compatibility.
      
      * lisp/net/tramp-sh.el (tramp-sh-handle-write-region): Do not
      create lock file twice.
      
      * lisp/net/tramp.el (tramp-handle-make-lock-file-name): Move lock
      file security check ...
      (tramp-handle-lock-file): ... here.
      (tramp-handle-unlock-file): Preserve backward compatibility.
      
      * test/lisp/net/tramp-tests.el (lock-file-name-transforms)
      (remote-file-name-inhibit-locks): Declare.
      (tramp-allow-unsafe-temporary-files): Set to t.
      (tramp-test37-make-auto-save-file-name)
      (tramp-test38-find-backup-file-name): Move binding of
      `tramp-allow-unsafe-temporary-files' up.
      (tramp-test39-lock-file): Bind `tramp-allow-unsafe-temporary-files'.
      Preserve backward compatibility.  Extend test.
      525d5cab
  3. 13 Jul, 2021 1 commit
    • Michael Albinus's avatar
      Add remote-file-name-inhibit-locks · cce84822
      Michael Albinus authored
      * doc/emacs/files.texi (Interlocking):
      * doc/lispref/files.texi (File Locks):
      * doc/misc/tramp.texi (Auto-save File Lock and Backup):
      Add remote-file-name-inhibit-locks.
      
      * etc/NEWS: New user option 'remote-file-name-inhibit-locks'.
      
      * lisp/files.el (remote-file-name-inhibit-locks): New defcustom.
      
      * lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist):
      * lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler-alist):
      * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist):
      * lisp/net/tramp-rclone.el (tramp-rclone-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):
      * lisp/net/tramp-sshfs.el (tramp-sshfs-file-name-handler-alist):
      * lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler-alist):
      Use `tramp-handle-make-lock-file-name'.
      
      * lisp/net/tramp.el (tramp-allow-unsafe-temporary-files): Fix docstring.
      (tramp-handle-make-lock-file-name): New defun.
      
      * test/lisp/net/tramp-tests.el (tramp-test39-lock-file): Extend test.
      cce84822
  4. 11 Jul, 2021 1 commit
    • Michael Albinus's avatar
      Use `auto-save-file-name-p' in tramp-*-write-region · ad6ad164
      Michael Albinus authored
      * lisp/net/tramp.el (tramp-handle-write-region):
      * lisp/net/tramp-adb.el (tramp-adb-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-sshfs.el (tramp-sshfs-handle-write-region):
      Use `auto-save-file-name-p'.
      ad6ad164
  5. 09 Jul, 2021 1 commit
    • Michael Albinus's avatar
      Further cleanup for file locks · 9ce6541a
      Michael Albinus authored
      * doc/misc/tramp.texi (Top, Configuration): Adapt node name for
      file locks.
      (Auto-save File Lock and Backup): Rename node name and section
      title.  Add file-lock to @cindex.  Describe file locks.
      
      * lisp/dired.el (dired-trivial-filenames): Add lock files.
      (dired-font-lock-keywords): Move files suffixed with
      `completion-ignored-extensions' up.  Add lock files to these checks.
      
      * lisp/net/tramp.el (tramp-get-lock-file, tramp-handle-unlock-file):
      Use `when-let'
      (tramp-lock-file-info-regexp): Rename from
      `tramp-lock-file-contents-regexp'.
      (tramp-handle-file-locked-p, tramp-handle-lock-file): Adapt callees.
      (tramp-handle-lock-file): Set file modes of lockname.
      
      * src/buffer.c (Frestore_buffer_modified_p):
      * src/fileio.c (write_region):
      * src/insdel.c (prepare_to_modify_buffer_1): Call Flock_file.
      
      * src/filelock.c (Qmake_lock_file_name): Declare symbol.
      (make_lock_file_name): Use it.  Don't check Fboundp, it doesn't
      work for interned symbols.
      (lock_file): Return a Lisp_Object.  Don't check create_lockfiles.
      Remove MSDOS version of the function.
      (Flock_file): Check create_lockfiles.
      (Flock_buffer): Call Flock_file.
      
      * src/lisp.h (lock_file): Remove.
      
      * test/lisp/shadowfile-tests.el (shadow-test08-shadow-todo)
      (shadow-test09-shadow-copy-files): Let-bind `create-lockfiles'.
      
      * test/lisp/net/tramp-tests.el (create-lockfiles): Don't set it
      globally.
      (tramp-test39-lock-file): Check also for `set-visited-file-name'.
      9ce6541a
  6. 08 Jul, 2021 2 commits
    • Michael Albinus's avatar
      Code cleanup wrt file locks · a6a92e3a
      Michael Albinus authored
      * lisp/files.el (make-lock-file-name): Fix docstring.
      
      * lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist):
      * lisp/net/tramp-archive.el (tramp-archive-file-name-handler-alist):
      * lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler-alist):
      * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist):
      * lisp/net/tramp-rclone.el (tramp-rclone-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):
      * lisp/net/tramp-sshfs.el (tramp-sshfs-file-name-handler-alist):
      * lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler-alist):
      Add `make-lock-file-name'.
      
      * lisp/net/tramp.el (tramp-file-name-for-operation):
      Add `make-lock-file-name'.
      (tramp-handle-unlock-file): Call `userlock--handle-unlock-error'
      in case of error.
      
      * src/buffer.c (Frestore_buffer_modified_p):
      * src/editfns.c (Freplace_buffer_contents):
      * src/fileio.c (Finsert_file_contents, write_region): Call Funlock_file.
      
      * src/filelock.c (unlock_file): Rename from unlock_file_body.
      Remove the other declarations of unlock_file.  Move file name
      handler check to ...
      (Funlock_file): ... here.  Adapt argument numbers.  Call
      unlock_file wrapped by internal_condition_case.
      (Flock_file): Adapt argument numbers.
      (unlock_all_files, Funlock_buffer, unlock_buffer): Call Funlock_file.
      
      * src/lisp.h (unlock_file): Remove.
      a6a92e3a
    • Michael Albinus's avatar
      Some further adaptions wrt Tramp file name locks · 6d580b00
      Michael Albinus authored
      * lisp/files.el (files--transform-file-name): Rename from
      `auto-save--transform-file-name'.  Wrap with `save-match-data'.
      (make-auto-save-file-name): Use it.
      (make-lock-file-name): Use it.  Call file name handler.
      
      * lisp/net/tramp.el (tramp-handle-write-region):
      * lisp/net/tramp-adb.el (tramp-adb-handle-write-region):
      * lisp/net/tramp-sh.el (tramp-sh-handle-write-region):
      * lisp/net/tramp-smb.el (tramp-smb-handle-write-region):
      Suppress file lock for temporary file.
      
      * lisp/net/tramp-compat.el (tramp-compat-make-lock-file-name):
      New defalias.
      
      * lisp/net/tramp.el (tramp-get-lock-file)
      (tramp-handle-lock-file, tramp-handle-unlock-file): Use it.
      (tramp-make-lock-name): Remove.
      
      * test/lisp/filenotify-tests.el (file-notify-test03-events-remote):
      Tag it :unstable temporarily.
      6d580b00
  7. 07 Jul, 2021 1 commit
    • Michael Albinus's avatar
      Implement file locks for remote files (Bug#49261) · d35868be
      Michael Albinus authored
      * doc/lispref/files.texi (Magic File Names): Add file-locked-p,
      lock-file and unlock-file.
      
      * etc/NEWS: Tramp supports file locks now.
      
      * lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist):
      Add `file-locked-p', `lock-file' and `unlock-file'.
      (tramp-adb-handle-write-region): Handle LOCKNAME.
      
      * lisp/net/tramp-archive.el (tramp-archive-file-name-handler-alist):
      Add `file-locked-p', `lock-file' and `unlock-file'.
      
      * lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler-alist):
      Add `file-locked-p', `lock-file' and `unlock-file'.
      (tramp-crypt-handle-file-locked-p, tramp-crypt-handle-lock-file)
      (tramp-crypt-handle-unlock-file): New defun.
      
      * lisp/net/tramp-fuse.el (tramp-fuse-mounted-p): Simplify.
      (tramp-fuse-unmount): New defun.
      
      * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist):
      Add `file-locked-p', `lock-file' and `unlock-file'.
      (tramp-gvfs-maybe-open-connection): Set "lock-pid" connection property.
      
      * lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler-alist):
      Add `file-locked-p', `lock-file' and `unlock-file'.
      (tramp-rclone-maybe-open-connection): Set "lock-pid" connection property.
      
      * lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist):
      Add `file-locked-p', `lock-file' and `unlock-file'.
      (tramp-sh-handle-write-region): Handle LOCKNAME.
      
      * lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist):
      Add `file-locked-p', `lock-file' and `unlock-file'.
      (tramp-smb-handle-copy-directory): Use `sleep-for'.
      (tramp-smb-handle-write-region): Handle LOCKNAME.
      
      * lisp/net/tramp-sshfs.el (tramp-sshfs-file-name-handler-alist):
      Add `file-locked-p', `lock-file' and `unlock-file'.
      (tramp-sshfs-handle-write-region): Handle LOCKNAME.
      (tramp-sshfs-maybe-open-connection): Set "lock-pid" connection property.
      
      * lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler-alist):
      Add `file-locked-p', `lock-file' and `unlock-file'.
      (tramp-sudoedit-maybe-open-connection):
      Set "lock-pid" connection property.
      
      * lisp/net/tramp.el (tramp-file-name-for-operation):
      Add `file-locked-p', `lock-file' and `unlock-file'.
      (tramp-make-lock-name, tramp-get-lock-file, tramp-get-lock-pid)
      (tramp-handle-file-locked-p, tramp-handle-lock-file)
      (tramp-handle-unlock-file): New defuns.
      (tramp-lock-file-contents-regexp): New regexp.
      (tramp-handle-write-region): Handle LOCKNAME.
      
      * src/filelock.c (lock_file, unlock_file_body, Ffile_locked_p):
      Call handler if exists.
      (Flock_file, Funlock_file): New defuns.
      (Qlock_file, Qunlock_file, Qfile_locked_p): Declare symbols.
      (Slock_file, Sunlock_file): Declare subroutines.
      
      * test/lisp/net/tramp-archive-tests.el
      (tramp-archive-test40-make-nearby-temp-file)
      (tramp-archive-test43-file-system-info): Rename.
      
      * test/lisp/net/tramp-tests.el (top): Set `create-lockfiles' to nil.
      (tramp--test-fuse-p): New defun.
      (tramp-test14-delete-directory): Use it.
      (tramp-test39-lock-file): New test.
      (tramp-test40-make-nearby-temp-file)
      (tramp-test41-special-characters)
      (tramp-test41-special-characters-with-stat)
      (tramp-test41-special-characters-with-perl)
      (tramp-test41-special-characters-with-ls, tramp-test42-utf8)
      (tramp-test42-utf8-with-stat, tramp-test42-utf8-with-perl)
      (tramp-test42-utf8-with-ls, tramp-test43-file-system-info)
      (tramp-test44-asynchronous-requests, tramp-test45-auto-load)
      (tramp-test45-delay-load, tramp-test45-recursive-load)
      (tramp-test45-remote-load-path, tramp-test46-unload): Rename.
      (tramp--test-special-characters, tramp--test-utf8)
      (tramp--test-asynchronous-requests-timeout): Modify docstring.
      d35868be
  8. 05 Jul, 2021 1 commit
    • Michael Albinus's avatar
      Don't use LOCKNAME for temp files in Tramp (Bug#49406) · 579b0c00
      Michael Albinus authored
      * lisp/net/tramp.el (tramp-handle-write-region):
      * lisp/net/tramp-adb.el (tramp-adb-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-sshfs.el (tramp-sshfs-handle-write-region):
      Don't use LOCKNAME for temp file.  (Bug#49406)
      
      * test/lisp/shadowfile-tests.el (password-cache-expiry):
      Set `shadow-debug' also on emba.
      579b0c00
  9. 02 Jul, 2021 1 commit
    • Michael Albinus's avatar
      Implement another fix for bug#49229 · 225ca617
      Michael Albinus authored
      * lisp/minibuffer.el (read-file-name-default): Respect remote files.
      (Bug#49229)
      
      * lisp/net/tramp-sh.el (tramp-sh-handle-expand-file-name):
      Handle special file names on MS Windows.
      
      * lisp/net/tramp.el (tramp-file-name-handler): Revert patch.
      (Bug#49229)
      225ca617
  10. 29 Jun, 2021 1 commit
    • Michael Albinus's avatar
      Sync with Tramp 2.5.1 · cd339e85
      Michael Albinus authored
      * doc/misc/trampver.texi:
      * lisp/net/trampver.el: Change version to "2.5.1".
      
      * lisp/tramp.el (tramp-handle-write-region):
      * lisp/tramp-adb.el (tramp-adb-handle-write-region):
      * lisp/tramp-sh.el (tramp-sh-handle-write-region): Call local
      `write-region' directly.
      
      * test/lisp/net/tramp-tests.el (tramp--test-utf8): Adapt test for
      MS Windows.
      cd339e85
  11. 26 Jun, 2021 1 commit
    • Michael Albinus's avatar
      Fix Tramp bug#49229 · d4561201
      Michael Albinus authored
      * lisp/net/tramp.el (tramp-file-name-handler): Drop possible
      volume letter when `expand-file-name' is called with a local
      absolute file name as first argument.  (Bug#49229)
      d4561201
  12. 25 Jun, 2021 1 commit
    • Michael Albinus's avatar
      Fix Tramp bug#49178 · 2fbe17c4
      Michael Albinus authored
      * lisp/net/tramp.el (tramp-handle-find-backup-file-name)
      (tramp-handle-make-auto-save-file-name): Adapt checks.  (Bug#49178)
      2fbe17c4
  13. 14 Jun, 2021 1 commit
    • Michael Albinus's avatar
      Handle sensitive auto-save or backup remote files (Bug#45245) · 6536112b
      Michael Albinus authored
      * doc/misc/tramp.texi (Auto-save and Backup):
      Describe tramp-allow-unsafe-temporary-files.
      (Ad-hoc multi-hops): Use proper format.
      
      * etc/NEWS: Mention confirmation for writing sensitive auto-save
      or backup remote files to the local temporary directory..
      
      * lisp/net/tramp-cache.el (tramp-dump-connection-properties):
      Strengthen test.
      
      * lisp/net/tramp.el (tramp-allow-unsafe-temporary-files): New defcustom.
      (tramp-handle-find-backup-file-name)
      (tramp-handle-make-auto-save-file-name): Don't expose sensible
      auto-save or backup files on local temporary directory.  (Bug#45245)
      
      * test/lisp/net/tramp-tests.el (tramp--test-always): New defalias.
      (tramp-test10-write-region, tramp-test21-file-links)
      (tramp--test--deftest-direct-async-process): Use it.
      (tramp-test37-make-auto-save-file-name)
      (tramp-test38-find-backup-file-name): Extend tests.
      6536112b
  14. 06 Jun, 2021 1 commit
  15. 22 May, 2021 1 commit
    • Michael Albinus's avatar
      Fix bug#48476 · 4db69b32
      Michael Albinus authored
      * lisp/net/tramp-archive.el (tramp-archive-autoload-file-name-handler):
      Add implementation.
      
      * lisp/net/tramp-integration.el (tramp-rename-files)
      (tramp-rename-these-files): Declare them.
      
      * lisp/net/tramp.el (tramp-autoload-file-name-handler):
      Load tramp-archive.el if needed.  (Bug#48476)
      
      * test/lisp/net/tramp-archive-tests.el (tramp-archive-test45-auto-load):
      Extend test.
      
      Use #' syntax for function symbols.
      4db69b32
  16. 13 May, 2021 1 commit
    • Michael Albinus's avatar
      Improve Tramp traces · c9773379
      Michael Albinus authored
      * lisp/net/tramp-cmds.el (tramp-list-tramp-buffers):
      List also trace buffers.
      
      * lisp/net/tramp.el (tramp-buffer-name):
      Add `tramp-suppress-trace' property.
      (tramp-get-debug-file-name): Fix docstring.
      (tramp-trace-buffer-name): New defun.
      (tramp-trace-functions): New defvar.
      (tramp-debug-message): Obey also `tramp-trace-functions'.
      
      * test/lisp/net/tramp-tests.el (tramp--test-instrument-test-case):
      Handle trace buffer accordingly.
      c9773379
  17. 09 May, 2021 1 commit
    • Michael Albinus's avatar
      Cleanups for Tramp out-of-band methods on MS Windows · 515cac0d
      Michael Albinus authored
      * doc/misc/tramp.texi (Frequently Asked Questions):
      tramp-use-ssh-controlmaster-options is nil on MS Windows.
      
      * lisp/net/tramp.el (tramp-unquote-shell-quote-argument): Revert previous
      change, it worked (not as expected but) properly.
      
      * test/lisp/net/tramp-tests.el (tramp-test17-dired-with-wildcards):
      Don't skip on MS Windows.
      (tramp--test-windows-nt-and-scp-p): Remove.
      (tramp--test-special-characters): Skip for out-of-band methods on
      MS Windows, sometimes.
      515cac0d
  18. 07 May, 2021 2 commits
    • Michael Albinus's avatar
      Tramp: Fix file name quoting on MS Windows · 9457d4f2
      Michael Albinus authored
      * lisp/net/tramp-sh.el (tramp-make-copy-program-file-name):
      Use `tramp-unquote-shell-quote-argument'.
      
      * lisp/net/tramp.el (tramp-unquote-shell-quote-argument):
      Adapt for MS Windows.
      
      * test/lisp/net/tramp-tests.el (tramp--test-special-characters):
      Adapt for MS Windows.
      9457d4f2
    • Michael Albinus's avatar
      Tune Tramp traces · 70bfcbcd
      Michael Albinus authored
      * doc/misc/tramp.texi (Traces and Profiles): Describe call traces.
      
      * lisp/net/tramp-compat.el: Add `tramp-suppress-trace' property for all
      functions.
      
      * lisp/net/tramp.el (tramp-verbose): Adapt docstring.
      (tramp-file-name-method, tramp-file-name-user)
      (tramp-file-name-domain, tramp-file-name-host)
      (tramp-file-name-port, tramp-file-name-localname)
      (tramp-file-name-hop, tramp-file-name-user-domain)
      (tramp-file-name-host-port, tramp-file-name-port-or-default)
      (tramp-tramp-file-p, tramp-find-method, tramp-find-user)
      (tramp-find-host, tramp-dissect-file-name)
      (tramp-dissect-hop-name, tramp-debug-buffer-name)
      (tramp-debug-outline-level, tramp-get-debug-buffer)
      (tramp-get-debug-file-name, tramp-read-passwd)
      (tramp-clear-passwd): Add `tramp-suppress-trace' property.
      (tramp-debug-message): Activate call traces.
      
      * test/lisp/net/tramp-tests.el (tramp--test-instrument-test-case): Simplify.
      70bfcbcd
  19. 06 May, 2021 1 commit
    • Michael Albinus's avatar
      In Tramp, use scp "-T" argument if available · b6f5da32
      Michael Albinus authored
      * lisp/net/tramp-sh.el (tramp-scp-strict-file-name-checking): New defvar.
      (tramp-scp-strict-file-name-checking): New defun.
      (tramp-do-copy-or-rename-file-out-of-band): Use it.
      (tramp-methods) <scp, scpx>: Use "%x".
      (tramp-make-copy-program-file-name): Use local quoting.
      (tramp-sh-handle-make-process): Don't call
      `tramp-maybe-open-connection', this happens implicitly by
      `tramp-send-command'.
      
      * lisp/net/tramp.el (tramp-methods): Adapt docstring.
      
      * test/lisp/net/tramp-tests.el (tramp-test40-special-characters)
      (tramp-test40-special-characters-with-stat)
      (tramp-test40-special-characters-with-perl)
      (tramp-test40-special-characters-with-ls): Don't skip for
      `tramp--test-windows-nt-and-scp-p'.
      b6f5da32
  20. 28 Apr, 2021 1 commit
    • Michael Albinus's avatar
      Tramp code cleanup · cccdea7e
      Michael Albinus authored
      * lisp/net/tramp-archive.el (tramp-archive-handle-insert-file-contents):
      Code cleanup.
      
      * lisp/net/tramp.el: Reload `tramp-compat' when we reload
      `tramp-autoloads'.
      (with-tramp-file-property, with-tramp-connection-property):
      Use `tramp-cache-undefined'.
      (tramp-autoload-file-name-handler): Do not load tramp-compat.el.
      (tramp-handle-insert-file-contents): Code cleanup.
      cccdea7e
  21. 27 Apr, 2021 1 commit
  22. 26 Apr, 2021 1 commit
  23. 17 Apr, 2021 1 commit
  24. 10 Apr, 2021 2 commits
    • Michael Albinus's avatar
      Tramp: fix location of files on W32 · ca1ddef2
      Michael Albinus authored
      * lisp/net/tramp.el:
      * lisp/net/tramp-sh.el: Use (eq system-type 'windows-nt) where appropriate.
      (tramp-completion-function-alist-ssh): Fix location of files on W32.
      ca1ddef2
    • Jim Porter's avatar
      Further fix of hostname completion on MS Windows · c975258a
      Jim Porter authored
      * lisp/net/tramp.el (tramp-completion-file-name-regexp-simplified)
      (tramp-completion-file-name-regexp-separate): Fix W32 hostname/method
      completion for simplified and separate syntaxes (same as the previous change
      to default syntax).
      
      Copyright-paperwork-exempt: yes
      c975258a
  25. 09 Apr, 2021 1 commit
    • Jim Porter's avatar
      Fix hostname completion on MS Windows · 1d42f480
      Jim Porter authored
      * lisp/net/tramp.el (tramp-completion-file-name-regexp-default):
      Handle volume letter being added to paths for file name completion on W32
      systems.  This fixes hostname (and method) autocomplete on W32.
      
      Copyright-paperwork-exempt: yes
      1d42f480
  26. 08 Apr, 2021 1 commit
    • Michael Albinus's avatar
      Revert use of powershell in Tramp, there are collateral damages · 9e8ac1f5
      Michael Albinus authored
      * lisp/net/tramp-sh.el (tramp-methods) <sshx, scpx>: Fix quoting
      for MS Windows.
      (tramp-connection-properties): Don't set "encoding-shell".
      (tramp-actions-before-shell): Remove `tramp-no-job-control-regexp'.
      (tramp-maybe-open-connection): Revert changes for "encoding-shell".
      
      * lisp/net/tramp.el (tramp-no-job-control-regexp): Remove.
      9e8ac1f5
  27. 05 Apr, 2021 1 commit
    • Michael Albinus's avatar
      Use powershell for Tramp on MS Windows · 14d29587
      Michael Albinus authored
      * lisp/net/tramp-sh.el (tramp-use-ssh-controlmaster-options):
      Nil on MS Windows.
      (tramp-connection-properties): Add "encoding-shell".
      (tramp-maybe-open-connection): Use it.  Change exit handling.
      (tramp-actions-before-shell): Add `tramp-no-job-control-regexp'.
      
      * lisp/net/tramp.el (tramp-methods): Adapt docstring.
      (tramp-no-job-control-regexp): New defcustom.
      (tramp-get-debug-buffer): Set coding system.
      14d29587
  28. 13 Mar, 2021 1 commit
    • Michael Albinus's avatar
      Remove ;;;###tramp-autoload cookie from Tramp defcustoms (Bug#47063) · 695f6792
      Michael Albinus authored
      * lisp/net/tramp-crypt.el (tramp-crypt-enabled-p): New defun.
      (tramp-crypt-add-directory, tramp-crypt-remove-directory):
      Add property `completion-predicate'.
      
      * lisp/net/tramp-sh.el (tramp-terminal-type, tramp-remote-path)
      (tramp-remote-process-environment): Remove.  Move them to ...
      
      * lisp/net/tramp.el: ... here.
      695f6792
  29. 11 Mar, 2021 1 commit
    • Michael Albinus's avatar
      Add remote processes to Tramp sshfs method · 65441a6f
      Michael Albinus authored
      * doc/misc/tramp.texi (FUSE setup): Method sshfs supports also
      remote processes.
      
      * lisp/net/tramp-cache.el (tramp-get-file-property)
      (tramp-set-file-property): Move setting of
      `tramp-cache-unload-hook' out of function.
      
      * lisp/net/tramp.el (tramp-expand-args): New defun.
      (tramp-handle-make-process):
      * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band)
      (tramp-maybe-open-connection):
      * lisp/net/tramp-sshfs.el (tramp-sshfs-maybe-open-connection):
      * lisp/net/tramp-sudoedit.el (tramp-sudoedit-send-command): Use it.
      
      * lisp/net/tramp-sshfs.el (tramp-methods) <sshfs>:
      Adapt `tramp-mount-args'.  Add `tramp-login-args',
      `tramp-direct-async', `tramp-remote-shell',
      `tramp-remote-shell-login' and `tramp-remote-shell-args'.
      (tramp-connection-properties): Set "direct-async-process" fir sshfs.
      (tramp-sshfs-file-name-handler-alist): Add `exec-path',
      `make-process', `process-file', `set-file-modes', `shell-command',
      `start-file-process', `tramp-get-remote-gid',
      `tramp-get-remote-uid' and `tramp-set-file-uid-gid'.
      (tramp-sshfs-handle-exec-path, tramp-sshfs-handle-process-file)
      (tramp-sshfs-handle-set-file-modes): New defuns.
      
      * test/lisp/net/tramp-tests.el (tramp-test20-file-modes)
      (tramp-test28-process-file, tramp-test29-start-file-process)
      (tramp-test30-make-process, tramp-test32-shell-command)
      (tramp-test32-shell-command-dont-erase-buffer)
      (tramp-test34-explicit-shell-file-name, tramp-test35-exec-path)
      (tramp-test43-asynchronous-requests): Run also for tramp-sshfs.
      (tramp--test-shell-file-name): New defun.
      (tramp-test28-process-file)
      (tramp-test34-explicit-shell-file-name)
      (tramp-test43-asynchronous-requests): Use it.
      (tramp-test40-special-characters-with-stat)
      (tramp-test40-special-characters-with-perl)
      (tramp-test40-special-characters-with-ls)
      (tramp-test41-utf8-with-stat, tramp-test41-utf8-with-perl)
      (tramp-test41-utf8-with-ls): Remove superfluous skip.
      65441a6f
  30. 08 Mar, 2021 2 commits
    • Stefan Monnier's avatar
      * lisp/net/*.el: Use lexical-binding · dc083ebc
      Stefan Monnier authored
      Also remove some redundant `:group` arguments.
      
      * lisp/net/eudc-export.el: Use lexical-binding.
      (eudc-create-bbdb-record): Use `cl-progv` and `apply` to avoid `eval`.
      
      * lisp/net/eudc-hotlist.el: Use lexical-binding.
      
      * lisp/net/eudc.el (eudc-print-attribute-value): Use `funcall` to avoid
      `eval`.
      
      * lisp/net/eudcb-bbdb.el: Use lexical-binding.
      (eudc-bbdb-filter-non-matching-record): Use `funcall` to avoid `eval`.
      Move `bbdb-val` binding to avoid `setq`.
      Use `seq-some` instead of `eval+or`.
      (eudc-bbdb-format-record-as-result): Use `dolist` and `pcase`.
      Use `funcall` to avoid `eval`.
      (eudc-bbdb-query-internal): Simplify a bit.
      
      * lisp/net/eudcb-ldap.el: Use lexical-binding.
      (eudc-ldap-get-host-parameter): Use `defalias` to avoid `eval-and-compile`.
      
      * lisp/net/telnet.el: Use lexical-binding.
      * lisp/net/quickurl.el: Use lexical-binding.
      * lisp/net/newst-ticker.el: Use lexical-binding.
      * lisp/net/newst-reader.el: Use lexical-binding.
      * lisp/net/goto-addr.el: Use lexical-binding.
      * lisp/net/gnutls.el: Use lexical-binding.
      * lisp/net/eudcb-macos-contacts.el: Use lexical-binding.
      * lisp/net/eudcb-mab.el: Use lexical-binding.
      
      * lisp/net/net-utils.el: Use lexical-binding.
      (finger): Remove unused var `found`.
      
      * lisp/net/network-stream.el (open-protocol-stream): Remove redundant
      `defalias`.
      
      * lisp/net/newst-plainview.el: Use lexical-binding.
      (newsticker-hide-entry, newsticker-show-entry): Remove unused var
      `is-invisible`.
      (w3m-fill-column, w3-maximum-line-length): Declare vars.
      
      * lisp/net/tramp.el (tramp-compute-multi-hops):
      * lisp/net/tramp-compat.el (tramp-compat-temporary-file-directory):
      * lisp/net/tramp-cmds.el (tramp-default-rename-file):
      * lisp/net/webjump.el (webjump): Don't forget lexical-binding for `eval`.
      dc083ebc
    • Michael Albinus's avatar
      Add Tramp sshfs method · 11d3af3c
      Michael Albinus authored
      * doc/misc/tramp.texi (Top, Configuration): Insert sections 'FUSE-based
      methods' and 'FUSE setup' in menu.
      (Quick Start Guide): Fix @anchors.  Add doas.  Extend section
      'Using @command{rclone}' to 'Using @acronym{FUSE}-based methods'.
      (External methods): Remove rclone paragraph.
      (FUSE-based methods, FUSE setup): New nodes.
      (Predefined connection information): Mention "mount-point".
      
      * etc/NEWS: Mention Tramp sshfs method.
      Fix typos and other oddities.
      
      * lisp/net/tramp-fuse.el: New file.
      
      * lisp/net/tramp-rclone.el (tramp-fuse): Require.
      (tramp-rclone-file-name-handler-alist): Replace `tramp-rclone-handle-*'
      by `tramp-fuse-handle-*' where appropriate.
      (tramp-rclone-handle-delete-directory)
      (tramp-rclone-handle-delete-file)
      (tramp-rclone-handle-directory-files)
      (tramp-rclone-handle-file-attributes)
      (tramp-rclone-handle-file-executable-p)
      (tramp-rclone-handle-file-name-all-completions)
      (tramp-rclone-handle-file-readable-p)
      (tramp-rclone-handle-insert-directory)
      (tramp-rclone-handle-insert-file-contents)
      (tramp-rclone-handle-make-directory, tramp-rclone-mount-point)
      (tramp-rclone-mounted-p, tramp-rclone-local-file-name):
      Remove.  Functionality moved to tramp-fuse.el.
      (tramp-rclone-remote-file-name)
      (tramp-rclone-maybe-open-connection): Use `tramp-fuse-*' functions.
      
      * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band):
      Simplify check.
      
      * lisp/net/tramp-sshfs.el: New file.
      
      * lisp/net/tramp.el: Remove TODO item.
      
      * test/lisp/net/tramp-tests.el (tramp--test-sshfs-p): New defun.
      (tramp-test14-delete-directory): Use it.
      11d3af3c
  31. 28 Feb, 2021 1 commit
  32. 17 Feb, 2021 1 commit
    • Michael Albinus's avatar
      Further Tramp code cleanup · e5f50f32
      Michael Albinus authored
      * doc/misc/tramp.texi (Predefined connection information):
      Mention "about-args".
      
      * lisp/net/tramp-cmds.el (tramp-version): Adapt docstring.
      
      * lisp/net/tramp.el (tramp-handle-expand-file-name):
      * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name):
      * lisp/net/tramp-sh.el (tramp-sh-handle-expand-file-name)
      * lisp/net/tramp-smb.el (tramp-smb-handle-expand-file-name):
      * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-expand-file-name):
      Handle local "/..".
      
      * lisp/net/tramp-rclone.el (tramp-methods) <rclone>:
      Adapt `tramp-mount-args'.
      (tramp-rclone-flush-directory-cache): Remove.
      (tramp-rclone-do-copy-or-rename-file)
      (tramp-rclone-handle-delete-directory)
      (tramp-rclone-handle-delete-file)
      (tramp-rclone-handle-make-directory): Don't use that function.
      (tramp-rclone-maybe-open-connection): Fix use of `tramp-mount-args'.
      
      * lisp/net/trampver.el (tramp-inside-emacs): New defun.
      * lisp/net/tramp.el (tramp-handle-make-process):
      * lisp/net/tramp-sh.el (tramp-sh-handle-make-process)
      (tramp-sh-handle-process-file, tramp-open-shell): Use it.
      (tramp-get-env-with-u-option): Remove.
      
      * test/lisp/net/tramp-tests.el (tramp-test05-expand-file-name-top):
      New test.
      e5f50f32
  33. 12 Feb, 2021 1 commit
    • Mattias Engdegård's avatar
      Don't inline tramp-debug-message · c4459a10
      Mattias Engdegård authored
      * lisp/net/tramp.el (tramp-debug-message): Change defsubst into defun.
      Until now the byte-compiler hasn't been clever enough to inline this
      function but this is about to change; the code expansion is
      unnecessary and makes compiler improvements more difficult to gauge.
      c4459a10
  34. 03 Feb, 2021 1 commit
    • Michael Albinus's avatar
      Tramp code cleanup · b81516c7
      Michael Albinus authored
      * lisp/net/tramp.el (tramp-signal-hook-function)
      (tramp-handle-access-file, tramp-handle-copy-directory)
      (tramp-handle-directory-files, tramp-handle-file-local-copy)
      (tramp-handle-insert-file-contents, tramp-handle-load):
      * lisp/net/tramp-adb.el (tramp-adb-handle-directory-files-and-attributes)
      (tramp-adb-handle-make-directory)
      (tramp-adb-handle-file-local-copy, tramp-adb-handle-copy-file)
      (tramp-adb-handle-rename-file):
      * lisp/net/tramp-crypt.el (tramp-crypt-do-copy-or-rename-file)
      (tramp-crypt-handle-directory-files)
      (tramp-crypt-handle-make-directory):
      * lisp/net/tramp-gvfs.el (tramp-gvfs-dbus-event-error)
      (tramp-gvfs-do-copy-or-rename-file)
      (tramp-gvfs-handle-make-directory):
      * lisp/net/tramp-rclone.el (tramp-rclone-do-copy-or-rename-file)
      (tramp-rclone-handle-directory-files):
      * lisp/net/tramp-sh.el (tramp-sh-handle-make-symbolic-link)
      (tramp-sh-handle-directory-files-and-attributes)
      (tramp-sh-handle-file-name-all-completions)
      (tramp-sh-handle-copy-directory, tramp-do-copy-or-rename-file)
      (tramp-sh-handle-make-directory)
      (tramp-sh-handle-file-local-copy)
      (tramp-sh-inotifywait-process-filter):
      * lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory)
      (tramp-smb-handle-copy-file, tramp-smb-handle-directory-files)
      (tramp-smb-handle-file-local-copy)
      (tramp-smb-handle-make-directory, tramp-smb-handle-rename-file):
      * lisp/net/tramp-sudoedit.el (tramp-sudoedit-do-copy-or-rename-file):
      Unify error report.
      
      * lisp/net/tramp-adb.el (tramp-adb-file-name-handler): Sync args
      with other `tramp-*-file-name-handler'.
      
      * lisp/net/tramp-compat.el (tramp-error): Declare.
      (tramp-compat-file-missing): New defsubst.
      
      * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file):
      Handle volatile files.
      (tramp-gvfs-set-attribute): New defun.
      (tramp-gvfs-handle-set-file-modes)
      (tramp-gvfs-handle-set-file-times)
      (tramp-gvfs-handle-set-file-uid-gid): Use it.
      
      * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file):
      Use `msg-operation'.
      
      * lisp/net/tramp-smb.el (tramp-smb-handle-insert-directory):
      Remove superfluous `format:
      (tramp-smb-maybe-open-connection): Simplify loop.
      
      * lisp/net/tramp.el (tramp-handle-file-truename): Drop volume letter from
      symlinked files.
      
      * test/lisp/net/tramp-tests.el (tramp--test-gdrive-p): New defun.
      (tramp--test-nextcloud-p): Remove.
      (tramp-test40-special-characters-with-ls): Do not skip on MS Windows.
      (tramp-test41-utf8): Skip if needed.
      b81516c7
  35. 20 Jan, 2021 1 commit
  36. 15 Jan, 2021 1 commit
    • Michael Albinus's avatar
      Some Tramp adaptions, mainly direct async processes · 138486cd
      Michael Albinus authored
      * doc/misc/tramp.texi (Firewalls, Remote processes)
      (Frequently Asked Questions): Add @vindex.
      (Predefined connection information): Precise precondition or direct
      async processes.
      (Remote shell setup): Ban ssh RemoteCommand option.
      (Frequently Asked Questions): Adapt quoting.
      
      * doc/misc/trampver.texi:
      * lisp/net/trampver.el: Change version to "2.5.1-pre".
      
      * lisp/net/tramp-adb.el (tramp-methods) <adb>: Add `tramp-direct-async'
      parameter.
      (tramp-adb-handle-make-process): Adapt docstring.
      
      * lisp/net/tramp-sh.el (tramp-methods) <scp, scpx, rsync, ssh, sshx>:
      Add `tramp-direct-async' parameter.
      (tramp-sh-handle-insert-directory): Simplify merkers.
      (tramp-sh-handle-make-process): Adapt docstring.
      
      * lisp/net/tramp.el (tramp-methods): Adapt docstring.
      (tramp-debug-message): Suppress lockfiles.
      (tramp-test-message): New defun.
      (tramp-direct-async-process-p): Check also for `tramp-direct-async'.
      (tramp-handle-make-process): Do not check for `tramp-direct-async-args'.
      
      * test/lisp/net/tramp-tests.el (all): Replace `string-match' by
      `string-match-p'.
      (dired-copy-dereference): Declare.
      (tramp-test-temporary-file-directory):
      Remove `tramp-direct-async-args` for mock method.
      (tramp-test15-copy-directory, tramp-test40-special-characters)
      (tramp-test40-special-characters-with-stat)
      (tramp-test40-special-characters-with-perl)
      (tramp-test40-special-characters-with-ls, tramp-test41-utf8)
      (tramp-test41-utf8-with-stat, tramp-test41-utf8-with-perl)
      (tramp-test41-utf8-with-ls): Skip for tramp-rclone.el.
      (tramp--test--deftest-direct-async-process): Do not skip for mock
      method.
      (tramp-test32-shell-command): Adapt test for direct async processes.
      (tramp-test36-vc-registered, tramp--test-hpux-p, tramp--test-ksh-p):
      Use `tramp-test-vec'.
      138486cd