1. 12 Jul, 2021 1 commit
    • Michael Albinus's avatar
      Fix a problem with tramp-*-process-file · bfd15953
      Michael Albinus authored
      * lisp/net/tramp-adb.el (tramp-adb-handle-process-file):
      * lisp/net/tramp-sh.el (tramp-sh-handle-process-file):
      * lisp/net/tramp-smb.el (tramp-smb-handle-process-file):
      * lisp/net/tramp-sshfs.el (tramp-sshfs-handle-process-file):
      Use `(expand-file-name default-directory)'.
      bfd15953
  2. 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
  3. 08 Jul, 2021 1 commit
    • 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
  4. 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
  5. 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
  6. 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
  7. 12 Mar, 2021 1 commit
    • Michael Albinus's avatar
      Tramp sshfs fixes · e609bf59
      Michael Albinus authored
      * doc/misc/tramp.texi (FUSE setup): Fix typo.
      
      * lisp/net/tramp-sshfs.el (tramp-sshfs-handle-set-file-modes):
      Use `tramp-compat-set-file-modes'.
      
      * test/lisp/net/tramp-tests.el
      (tramp-test43-asynchronous-requests): Don't run for tramp-sshfs.
      e609bf59
  8. 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
  9. 08 Mar, 2021 1 commit
    • 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