emacs/lisp/net/tramp-gvfs.el

2525 lines
97 KiB
EmacsLisp
Raw Normal View History

;;; tramp-gvfs.el --- Tramp access functions for GVFS daemon -*- lexical-binding:t -*-
2009-06-22 21:04:49 +00:00
;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
2009-06-22 21:04:49 +00:00
;; Author: Michael Albinus <michael.albinus@gmx.de>
;; Keywords: comm, processes
;; Package: tramp
2009-06-22 21:04:49 +00:00
2009-06-23 07:44:08 +00:00
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
2009-06-22 21:04:49 +00:00
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
2009-06-23 07:44:08 +00:00
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
2009-06-22 21:04:49 +00:00
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
2009-06-22 21:04:49 +00:00
;;; Commentary:
;; Access functions for the GVFS daemon from Tramp. Tested with GVFS
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
;; 1.0 (Ubuntu 8.10, Gnome 2.24). It has been reported also to run
;; with GVFS 0.2.5 (Ubuntu 8.04, Gnome 2.22), but there is an
;; incompatibility with the mount_info structure, which has been
;; worked around.
2009-06-22 21:04:49 +00:00
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
;; It has also been tested with GVFS 1.6 (Ubuntu 10.04, Gnome 2.30),
;; where the default_location has been added to mount_info (see
;; <https://bugzilla.gnome.org/show_bug.cgi?id=561998>.
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
;; With GVFS 1.14 (Ubuntu 12.10, Gnome 3.6) the interfaces have been
;; changed, again. So we must introspect the D-Bus interfaces.
2009-06-22 21:04:49 +00:00
;; All actions to mount a remote location, and to retrieve mount
;; information, are performed by D-Bus messages. File operations
;; themselves are performed via the mounted filesystem in ~/.gvfs.
;; Consequently, GNU Emacs with enabled D-Bus bindings is a
2009-06-22 21:04:49 +00:00
;; precondition.
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
;; The GVFS D-Bus interface is said to be unstable. There were even
;; no introspection data before GVFS 1.14. The interface, as
;; discovered during development time, is given in respective
;; comments.
2009-06-22 21:04:49 +00:00
;; The user option `tramp-gvfs-methods' contains the list of supported
;; connection methods. Per default, these are "afp", "dav", "davs",
;; "gdrive", "mtp", "nextcloud" and "sftp".
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
;; "gdrive" and "nextcloud" connection methods require a respective
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
;; account in GNOME Online Accounts, with enabled "Files" service.
2009-06-22 21:04:49 +00:00
;; The "mtp" connection method is responsible for media devices,
;; like cell phones, tablets, cameras etc. The device must already be
;; connected via USB, before accessing it.
;; Other possible connection methods are "ftp", "http", "https" and
;; "smb". When one of these methods is added to the list, the remote
;; access for that method is performed via GVFS instead of the native
;; Tramp implementation. However, this is not recommended. These
;; methods are listed here for the benefit of file archives, see
;; tramp-archive.el.
2009-06-22 21:04:49 +00:00
;; GVFS offers even more connection methods. The complete list of
;; connection methods of the actual GVFS implementation can be
;; retrieved by:
;;
;; (message
;; "%s"
;; (mapcar
;; #'car
2009-06-22 21:04:49 +00:00
;; (dbus-call-method
;; :session tramp-gvfs-service-daemon tramp-gvfs-path-mounttracker
;; tramp-gvfs-interface-mounttracker "ListMountableInfo")))
2009-06-22 21:04:49 +00:00
;; See also /usr/share/gvfs/mounts
2009-06-22 21:04:49 +00:00
;; Note that all other connection methods are not tested, beside the
;; ones offered for customization in `tramp-gvfs-methods'. If you
;; request an additional connection method to be supported, please
;; drop me a note.
;; For hostname completion, information is retrieved from the zeroconf
;; daemon (for the "afp", "dav", "davs", and "sftp" methods). The
;; zeroconf daemon is pre-configured to discover services in the
;; "local" domain. If another domain shall be used for discovering
;; services, the user option `tramp-gvfs-zeroconf-domain' can be set
;; accordingly.
2009-06-22 21:04:49 +00:00
;; Restrictions:
;;
;; * Two shares of the same SMB server cannot be mounted in parallel.
;;; Code:
;; D-Bus support in the Emacs core can be disabled with configuration
;; option "--without-dbus". Declare used subroutines and variables.
(declare-function dbus-get-unique-name "dbusbind.c")
(eval-when-compile (require 'cl-lib))
2009-06-22 21:04:49 +00:00
(require 'tramp)
(require 'dbus)
(require 'url-parse)
(require 'url-util)
2009-06-22 21:04:49 +00:00
2013-08-15 19:02:09 +02:00
;; Pacify byte-compiler.
(declare-function zeroconf-init "zeroconf")
(declare-function zeroconf-list-service-types "zeroconf")
(declare-function zeroconf-list-services "zeroconf")
(declare-function zeroconf-service-host "zeroconf")
(declare-function zeroconf-service-port "zeroconf")
(declare-function zeroconf-service-txt "zeroconf")
;; We don't call `dbus-ping', because this would load dbus.el.
(defconst tramp-gvfs-enabled
(ignore-errors
(and (featurep 'dbusbind)
(autoload 'zeroconf-init "zeroconf")
(tramp-compat-funcall 'dbus-get-unique-name :system)
(tramp-compat-funcall 'dbus-get-unique-name :session)
(or ;; Until Emacs 25, `process-attributes' could crash Emacs
;; for some processes. Better we don't check.
(<= emacs-major-version 25)
(tramp-process-running-p "gvfs-fuse-daemon")
(tramp-process-running-p "gvfsd-fuse"))))
"Non-nil when GVFS is available.")
Migrate to Tramp 2.2. Rearrange load dependencies. (Bug#1529, Bug#5448, Bug#5705) * Makefile.in (TRAMP_DIR, TRAMP_SRC): New variables. ($(TRAMP_DIR)/tramp-loaddefs.el): New target. (LOADDEFS): Add $(lisp)/net/tramp-loaddefs.el. * net/tramp.el (top): Remove all other tramp-* loads except tramp-compat.el. Remove all changes to tramp-unload-hook for other tramp-* packages. Rearrange defun order. Change calls of `tramp-compat-call-process', `tramp-compat-decimal-to-octal', `tramp-compat-octal-to-decimal' to new function names. (tramp-terminal-type, tramp-initial-end-of-output) (tramp-methods, tramp-foreign-file-name-handler-alist) (tramp-tramp-file-p, tramp-completion-mode-p) (tramp-send-command-and-check, tramp-get-remote-path) (tramp-get-remote-tmpdir, tramp-get-remote-ln) (tramp-shell-quote-argument): Set tramp-autoload cookie. (with-file-property, with-connection-property): Move to tramp-cache.el. (tramp-local-call-process, tramp-decimal-to-octal) (tramp-octal-to-decimal): Move to tramp-compat.el. (tramp-handle-shell-command): Do not require 'shell. (tramp-compute-multi-hops): No special handling for tramp-gw-* symbols. (tramp-unload-tramp): Do not call `tramp-unload-file-name-handlers'. * net/tramp-cache.el (top): Require 'tramp. Add to `tramp-unload-hook'. (tramp-cache-data, 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-flush-connection-property) (tramp-cache-print, tramp-list-connections): Set tramp-autoload cookie. (with-file-property, with-connection-property): New defuns, moved from tramp.el. (tramp-flush-file-function): Use `with-parsed-tramp-file-name' macro. * net/tramp-cmds.el (top): Add to `tramp-unload-hook'. (tramp-version): Set tramp-autoload cookie. * net/tramp-compat.el (top): Require 'tramp-loaddefs. Remove all changes to tramp-unload-hook for other tramp-* packages. Add to `tramp-unload-hook'. (tramp-compat-decimal-to-octal, tramp-compat-octal-to-decimal) (tramp-compat-call-process): New defuns, moved from tramp.el. * net/tramp-fish.el (top) Require just 'tramp. Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. Change call of `tramp-compat-decimal-to-octal' to new function name. (tramp-fish-method): Make it a defconst. (tramp-fish-file-name-p): Make it a defsubst. (tramp-fish-method, tramp-fish-file-name-handler) (tramp-fish-file-name-p): Set tramp-autoload cookie. * net/tramp-ftp.el (top) Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. (tramp-ftp-method): Make it a defconst. (tramp-ftp-file-name-p): Make it a defsubst. (tramp-ftp-method, tramp-ftp-file-name-handler) (tramp-ftp-file-name-p): Set tramp-autoload cookie. * net/tramp-gvfs.el (top) Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. Change checks, whether package can be loaded. (tramp-gvfs-file-name-p): Make it a defsubst. (tramp-gvfs-methods, tramp-gvfs-file-name-handler) (tramp-gvfs-file-name-p): Set tramp-autoload cookie. (tramp-gvfs-handle-file-directory-p): New defun. (tramp-gvfs-file-name-handler-alist): Use it. * net/tramp-gw.el (top) Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. (tramp-gw-tunnel-method, tramp-gw-default-tunnel-port) (tramp-gw-socks-method, tramp-gw-default-socks-port): Make it a defconst. (tramp-gw-tunnel-method, tramp-gw-socks-method) (tramp-gw-open-connection): Set tramp-autoload cookie. * net/tramp-imap.el (top) Require just 'tramp. Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. Change checks, whether package can be loaded. (tramp-imap-file-name-p): Make it a defsubst. (tramp-imap-method, tramp-imaps-method) (tramp-imap-file-name-handler) (tramp-imap-file-name-p): Set tramp-autoload cookie. * net/tramp-smb.el (top) Require just 'tramp. Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. Change checks, whether package can be loaded. Change call of `tramp-compat-decimal-to-octal' to new function name. (tramp-smb-tunnel-method): Make it a defconst. (tramp-smb-file-name-p): Make it a defsubst. (tramp-smb-method, tramp-smb-file-name-handler) (tramp-smb-file-name-p): Set tramp-autoload cookie. * net/tramp-uu.el (top) Add to `tramp-unload-hook'. (tramp-uuencode-region): Set tramp-autoload cookie. * net/trampver.el (top) Add to `tramp-unload-hook'. (tramp-version, tramp-bug-report-address): Set tramp-autoload cookie. Update release number.
2010-09-08 16:42:54 +02:00
;;;###tramp-autoload
(defcustom tramp-gvfs-methods
'("afp" "dav" "davs" "gdrive" "mtp" "nextcloud" "sftp")
"List of methods for remote files, accessed with GVFS."
2009-06-22 21:04:49 +00:00
:group 'tramp
:version "28.1"
:type '(repeat (choice (const "afp")
(const "dav")
2009-06-22 21:04:49 +00:00
(const "davs")
(const "ftp")
(const "gdrive")
(const "http")
(const "https")
(const "mtp")
(const "nextcloud")
2009-06-22 21:04:49 +00:00
(const "sftp")
(const "smb"))))
2009-06-22 21:04:49 +00:00
;;;###tramp-autoload
(defconst tramp-goa-methods '("gdrive" "nextcloud")
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
"List of methods which require registration at GNOME Online Accounts.")
;; Remove GNOME Online Accounts methods if not supported.
(unless (and tramp-gvfs-enabled
(member tramp-goa-service (dbus-list-known-names :session)))
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
(dolist (method tramp-goa-methods)
(setq tramp-gvfs-methods (delete method tramp-gvfs-methods))))
;;;###tramp-autoload
(defvar tramp-media-methods '("afc" "gphoto2" "mtp")
"List of GVFS methods which are covered by the \"mtp\" method.
They are checked during start up via
`tramp-gvfs-interface-remotevolumemonitor'.")
(defsubst tramp-gvfs-service-volumemonitor (method)
"Return the well known name of the volume monitor responsible for METHOD."
(symbol-value
(intern-soft (format "tramp-gvfs-service-%s-volumemonitor" method))))
;; Remove media methods if not supported.
(when tramp-gvfs-enabled
(dolist (method tramp-media-methods)
(unless (member (tramp-gvfs-service-volumemonitor method)
(dbus-list-known-names :session))
(setq tramp-media-methods (delete method tramp-media-methods)))))
;;;###tramp-autoload
2009-06-22 21:04:49 +00:00
(defcustom tramp-gvfs-zeroconf-domain "local"
"Zeroconf domain to be used for discovering services, like host names."
2009-06-22 21:04:49 +00:00
:group 'tramp
:version "23.2"
Fix Bug#31558 * 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-host-regexp, 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-ignored-file-name-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-ignored-file-name-regexp): Use type regexp.
2018-05-24 14:32:12 +02:00
:type 'string)
2009-06-22 21:04:49 +00:00
;; Add the methods to `tramp-methods', in order to allow minibuffer
;; completion. Add defaults for `tramp-default-host-alist'.
Migrate to Tramp 2.2. Rearrange load dependencies. (Bug#1529, Bug#5448, Bug#5705) * Makefile.in (TRAMP_DIR, TRAMP_SRC): New variables. ($(TRAMP_DIR)/tramp-loaddefs.el): New target. (LOADDEFS): Add $(lisp)/net/tramp-loaddefs.el. * net/tramp.el (top): Remove all other tramp-* loads except tramp-compat.el. Remove all changes to tramp-unload-hook for other tramp-* packages. Rearrange defun order. Change calls of `tramp-compat-call-process', `tramp-compat-decimal-to-octal', `tramp-compat-octal-to-decimal' to new function names. (tramp-terminal-type, tramp-initial-end-of-output) (tramp-methods, tramp-foreign-file-name-handler-alist) (tramp-tramp-file-p, tramp-completion-mode-p) (tramp-send-command-and-check, tramp-get-remote-path) (tramp-get-remote-tmpdir, tramp-get-remote-ln) (tramp-shell-quote-argument): Set tramp-autoload cookie. (with-file-property, with-connection-property): Move to tramp-cache.el. (tramp-local-call-process, tramp-decimal-to-octal) (tramp-octal-to-decimal): Move to tramp-compat.el. (tramp-handle-shell-command): Do not require 'shell. (tramp-compute-multi-hops): No special handling for tramp-gw-* symbols. (tramp-unload-tramp): Do not call `tramp-unload-file-name-handlers'. * net/tramp-cache.el (top): Require 'tramp. Add to `tramp-unload-hook'. (tramp-cache-data, 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-flush-connection-property) (tramp-cache-print, tramp-list-connections): Set tramp-autoload cookie. (with-file-property, with-connection-property): New defuns, moved from tramp.el. (tramp-flush-file-function): Use `with-parsed-tramp-file-name' macro. * net/tramp-cmds.el (top): Add to `tramp-unload-hook'. (tramp-version): Set tramp-autoload cookie. * net/tramp-compat.el (top): Require 'tramp-loaddefs. Remove all changes to tramp-unload-hook for other tramp-* packages. Add to `tramp-unload-hook'. (tramp-compat-decimal-to-octal, tramp-compat-octal-to-decimal) (tramp-compat-call-process): New defuns, moved from tramp.el. * net/tramp-fish.el (top) Require just 'tramp. Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. Change call of `tramp-compat-decimal-to-octal' to new function name. (tramp-fish-method): Make it a defconst. (tramp-fish-file-name-p): Make it a defsubst. (tramp-fish-method, tramp-fish-file-name-handler) (tramp-fish-file-name-p): Set tramp-autoload cookie. * net/tramp-ftp.el (top) Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. (tramp-ftp-method): Make it a defconst. (tramp-ftp-file-name-p): Make it a defsubst. (tramp-ftp-method, tramp-ftp-file-name-handler) (tramp-ftp-file-name-p): Set tramp-autoload cookie. * net/tramp-gvfs.el (top) Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. Change checks, whether package can be loaded. (tramp-gvfs-file-name-p): Make it a defsubst. (tramp-gvfs-methods, tramp-gvfs-file-name-handler) (tramp-gvfs-file-name-p): Set tramp-autoload cookie. (tramp-gvfs-handle-file-directory-p): New defun. (tramp-gvfs-file-name-handler-alist): Use it. * net/tramp-gw.el (top) Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. (tramp-gw-tunnel-method, tramp-gw-default-tunnel-port) (tramp-gw-socks-method, tramp-gw-default-socks-port): Make it a defconst. (tramp-gw-tunnel-method, tramp-gw-socks-method) (tramp-gw-open-connection): Set tramp-autoload cookie. * net/tramp-imap.el (top) Require just 'tramp. Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. Change checks, whether package can be loaded. (tramp-imap-file-name-p): Make it a defsubst. (tramp-imap-method, tramp-imaps-method) (tramp-imap-file-name-handler) (tramp-imap-file-name-p): Set tramp-autoload cookie. * net/tramp-smb.el (top) Require just 'tramp. Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. Change checks, whether package can be loaded. Change call of `tramp-compat-decimal-to-octal' to new function name. (tramp-smb-tunnel-method): Make it a defconst. (tramp-smb-file-name-p): Make it a defsubst. (tramp-smb-method, tramp-smb-file-name-handler) (tramp-smb-file-name-p): Set tramp-autoload cookie. * net/tramp-uu.el (top) Add to `tramp-unload-hook'. (tramp-uuencode-region): Set tramp-autoload cookie. * net/trampver.el (top) Add to `tramp-unload-hook'. (tramp-version, tramp-bug-report-address): Set tramp-autoload cookie. Update release number.
2010-09-08 16:42:54 +02:00
;;;###tramp-autoload
(when (featurep 'dbusbind)
* lisp/net/tramp: Rework mutual dependencies Functionally split tramp-loaddefs.el into two parts: one part run while loading it at the very beginning of loading tramp.el (holding plain autoloads and declarations), and another run at the very end of loading tramp.el (holding setup code). This should reduce infinite-recursion problems while loading. * lisp/net/tramp.el: Require tramp-loaddefs at beginning. Run (new and internal) tramp--startup-hook at the end. Remove all tramp-autoloads. Prefer tramp--with-startup over eval-after-load. (tramp--with-startup): New macro. (tramp-set-syntax): Show the new value rather than the old value in the error message. (tramp-syntax-values): Explicitly return 'values'. (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-completion-file-name-regexp): Don't initialize in the declaration, since it's recomputed at the end anyway. (tramp-time-dont-know, tramp-time-doesnt-exist): Move before first use. * lisp/net/tramp-compat.el: Don't require tramp-loaddefs any more. (tramp-compat-tramp-syntax): Declare tramp-syntax. * lisp/net/tramp-smb.el: * lisp/net/tramp-rclone.el: * lisp/net/tramp-gvfs.el: * lisp/net/tramp-ftp.el: * lisp/net/tramp-adb.el: Wrap all autoloaded setup operations within tramp--with-startup. * lisp/net/tramp-sh.el: Wrap all autoloaded setup operations within tramp--with-startup. (tramp-display-escape-sequence-regexp) (tramp-device-escape-sequence-regexp): Don't tramp-autoload any more. (tramp-stat-marker): Use eval-and-compile rather than tramp-autoload. * lisp/net/tramp-sudoedit.el: Wrap all autoloaded setup operations within tramp--with-startup. Require tramp-sh at compile-time to precompute some regexps based on tramp-stat-marker.
2018-12-16 10:32:53 -05:00
(tramp--with-startup
(dolist (method tramp-gvfs-methods)
(unless (assoc method tramp-methods)
(add-to-list 'tramp-methods `(,method)))
(when (member method tramp-goa-methods)
(add-to-list 'tramp-default-host-alist `(,method nil ""))))))
2009-06-22 21:04:49 +00:00
(defconst tramp-gvfs-path-tramp (concat dbus-path-emacs "/Tramp")
2011-02-22 23:08:12 -08:00
"The preceding object path for own objects.")
2009-06-22 21:04:49 +00:00
(defconst tramp-gvfs-service-daemon "org.gtk.vfs.Daemon"
"The well known name of the GVFS daemon.")
(defconst tramp-gvfs-path-mounttracker "/org/gtk/vfs/mounttracker"
"The object path of the GVFS daemon.")
(defconst tramp-gvfs-interface-mounttracker "org.gtk.vfs.MountTracker"
"The mount tracking interface in the GVFS daemon.")
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
;; Introspection data exist since GVFS 1.14. If there are no such
;; data, we expect an earlier interface.
(defconst tramp-gvfs-methods-mounttracker
Backport Tramp changes from trunk. * net/tramp-adb.el (tramp-adb-sh-fix-ls-output): Use `bolp'. (tramp-adb-handle-write-region): Improve messages. (tramp-adb-maybe-open-connection): Don't set `tramp-current-*' variables. * net/tramp-cache.el (tramp-flush-file-function): Simplify check. Suppress debug messages. * net/tramp-ftp.el (top): Remove special handling for URL syntax. (tramp-ftp-file-name-handler): * net/tramp-gvfs.el (tramp-gvfs-methods) <sftp>: Add. (tramp-gvfs-methods-mounttracker) (tramp-gvfs-mountlocation-signature): Check `tramp-gvfs-enabled' during initialization. (tramp-gvfs-handle-delete-file): Flush file properties, not directory properties. (tramp-gvfs-handle-file-attributes): Use `string-to-number' when reading "unix::mode". (tramp-gvfs-handle-file-name-all-completions): Use "-h" option for "gvfs-ls". (tramp-gvfs-url-file-name): Apply `cons' where appropriate. `user' and `localname' could be nil. (tramp-gvfs-send-command): Simplify traces. * net/tramp-sh.el (vc-handled-backends, vc-bzr-program) (vc-git-program, vc-hg-program): Declare. (tramp-methods) <sftp>: Remove. It has never worked satisfactorily. (tramp-methods) <nc>: Add new method. (tramp-methods) <telnet>: Redirect stderr to "/dev/null". (tramp-methods) <plink, plinkx, pscp, psftp>: Improve `tramp-login-args'. (tramp-default-user-alist): Add "nc". (top): Remove completion function for "sftp". Add completion functions for "nc" and "psftp". (tramp-sh-handle-set-visited-file-modtime): (tramp-sh-handle-verify-visited-file-modtime): Use `point-at-eol'. (tramp-do-copy-or-rename-file-out-of-band): Use cached "remote-copy-args" value, if available. (Bug#18199) Tweak docstring. Implement support for "nc" method. (tramp-sh-handle-expand-file-name, tramp-local-coding-commands) (tramp-remote-coding-commands, tramp-call-local-coding-command): Tweak docstring. (tramp-sh-handle-start-file-process): Expand `default-directory'. (tramp-sh-handle-write-region): Tweak error message. (tramp-sh-handle-vc-registered): Remove backends when the remote binary does not exist. (tramp-open-connection-setup-interactive-shell): Prefer utf-8 coding. (Bug#17859) (tramp-find-inline-encoding): Do not raise an error. (tramp-make-copy-program-file-name): Tweak docstring. Handle also the "nc" case. Quote result also locally. (tramp-get-remote-id): Check also for "gid". (tramp-get-remote-python): * net/tramp-smb.el (tramp-smb-handle-copy-directory) (tramp-smb-handle-set-file-acl): Use `start-process'. (tramp-smb-handle-insert-directory): Use progress reporter. (tramp-smb-handle-rename-file): Flush also file properties of FILENAME. * net/tramp.el (tramp-methods): Tweak docstring. (tramp-file-name-handler): Apply `cons' where appropriate. (tramp-handle-file-accessible-directory-p): Check for `file-readable-p' instead of `file-executable-p'. (tramp-handle-shell-command): Use `display-buffer'. (Bug#18326) (tramp-handle-unhandled-file-name-directory): Return "/". (tramp-check-cached-permissions): Use `tramp-compat-file-attributes'. (tramp-call-process): Add new argument VEC. Adapt callees in all tramp*.el files. * net/trampver.el: Update release number.
2014-11-01 14:34:45 +01:00
(and tramp-gvfs-enabled
(dbus-introspect-get-method-names
:session tramp-gvfs-service-daemon tramp-gvfs-path-mounttracker
tramp-gvfs-interface-mounttracker))
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
"The list of supported methods of the mount tracking interface.")
(defconst tramp-gvfs-listmounts
(if (member "ListMounts" tramp-gvfs-methods-mounttracker)
"ListMounts"
"listMounts")
"The name of the \"listMounts\" method.
It has been changed in GVFS 1.14.")
(defconst tramp-gvfs-mountlocation
(if (member "MountLocation" tramp-gvfs-methods-mounttracker)
"MountLocation"
"mountLocation")
"The name of the \"mountLocation\" method.
It has been changed in GVFS 1.14.")
(defconst tramp-gvfs-mountlocation-signature
Backport Tramp changes from trunk. * net/tramp-adb.el (tramp-adb-sh-fix-ls-output): Use `bolp'. (tramp-adb-handle-write-region): Improve messages. (tramp-adb-maybe-open-connection): Don't set `tramp-current-*' variables. * net/tramp-cache.el (tramp-flush-file-function): Simplify check. Suppress debug messages. * net/tramp-ftp.el (top): Remove special handling for URL syntax. (tramp-ftp-file-name-handler): * net/tramp-gvfs.el (tramp-gvfs-methods) <sftp>: Add. (tramp-gvfs-methods-mounttracker) (tramp-gvfs-mountlocation-signature): Check `tramp-gvfs-enabled' during initialization. (tramp-gvfs-handle-delete-file): Flush file properties, not directory properties. (tramp-gvfs-handle-file-attributes): Use `string-to-number' when reading "unix::mode". (tramp-gvfs-handle-file-name-all-completions): Use "-h" option for "gvfs-ls". (tramp-gvfs-url-file-name): Apply `cons' where appropriate. `user' and `localname' could be nil. (tramp-gvfs-send-command): Simplify traces. * net/tramp-sh.el (vc-handled-backends, vc-bzr-program) (vc-git-program, vc-hg-program): Declare. (tramp-methods) <sftp>: Remove. It has never worked satisfactorily. (tramp-methods) <nc>: Add new method. (tramp-methods) <telnet>: Redirect stderr to "/dev/null". (tramp-methods) <plink, plinkx, pscp, psftp>: Improve `tramp-login-args'. (tramp-default-user-alist): Add "nc". (top): Remove completion function for "sftp". Add completion functions for "nc" and "psftp". (tramp-sh-handle-set-visited-file-modtime): (tramp-sh-handle-verify-visited-file-modtime): Use `point-at-eol'. (tramp-do-copy-or-rename-file-out-of-band): Use cached "remote-copy-args" value, if available. (Bug#18199) Tweak docstring. Implement support for "nc" method. (tramp-sh-handle-expand-file-name, tramp-local-coding-commands) (tramp-remote-coding-commands, tramp-call-local-coding-command): Tweak docstring. (tramp-sh-handle-start-file-process): Expand `default-directory'. (tramp-sh-handle-write-region): Tweak error message. (tramp-sh-handle-vc-registered): Remove backends when the remote binary does not exist. (tramp-open-connection-setup-interactive-shell): Prefer utf-8 coding. (Bug#17859) (tramp-find-inline-encoding): Do not raise an error. (tramp-make-copy-program-file-name): Tweak docstring. Handle also the "nc" case. Quote result also locally. (tramp-get-remote-id): Check also for "gid". (tramp-get-remote-python): * net/tramp-smb.el (tramp-smb-handle-copy-directory) (tramp-smb-handle-set-file-acl): Use `start-process'. (tramp-smb-handle-insert-directory): Use progress reporter. (tramp-smb-handle-rename-file): Flush also file properties of FILENAME. * net/tramp.el (tramp-methods): Tweak docstring. (tramp-file-name-handler): Apply `cons' where appropriate. (tramp-handle-file-accessible-directory-p): Check for `file-readable-p' instead of `file-executable-p'. (tramp-handle-shell-command): Use `display-buffer'. (Bug#18326) (tramp-handle-unhandled-file-name-directory): Return "/". (tramp-check-cached-permissions): Use `tramp-compat-file-attributes'. (tramp-call-process): Add new argument VEC. Adapt callees in all tramp*.el files. * net/trampver.el: Update release number.
2014-11-01 14:34:45 +01:00
(and tramp-gvfs-enabled
(dbus-introspect-get-signature
:session tramp-gvfs-service-daemon tramp-gvfs-path-mounttracker
tramp-gvfs-interface-mounttracker tramp-gvfs-mountlocation))
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
"The D-Bus signature of the \"mountLocation\" method.
It has been changed in GVFS 1.14.")
2009-06-22 21:04:49 +00:00
;; <interface name='org.gtk.vfs.MountTracker'>
;; <method name='listMounts'>
;; <arg name='mount_info_list'
;; type='a{sosssssbay{aya{say}}ay}'
2009-06-22 21:04:49 +00:00
;; direction='out'/>
;; </method>
;; <method name='mountLocation'>
;; <arg name='mount_spec' type='{aya{say}}' direction='in'/>
;; <arg name='dbus_id' type='s' direction='in'/>
;; <arg name='object_path' type='o' direction='in'/>
;; </method>
;; <signal name='mounted'>
;; <arg name='mount_info'
;; type='{sosssssbay{aya{say}}ay}'/>
2009-06-22 21:04:49 +00:00
;; </signal>
;; <signal name='unmounted'>
;; <arg name='mount_info'
;; type='{sosssssbay{aya{say}}ay}'/>
2009-06-22 21:04:49 +00:00
;; </signal>
;; </interface>
;;
;; STRUCT mount_info
;; STRING dbus_id
;; OBJECT_PATH object_path
;; STRING display_name
;; STRING stable_name
;; STRING x_content_types Since GVFS 1.0 only !!!
2009-06-22 21:04:49 +00:00
;; STRING icon
2011-12-05 00:55:25 -08:00
;; STRING preferred_filename_encoding
2009-06-22 21:04:49 +00:00
;; BOOLEAN user_visible
;; ARRAY BYTE fuse_mountpoint
;; STRUCT mount_spec
;; ARRAY BYTE mount_prefix
;; ARRAY
;; STRUCT mount_spec_item
;; STRING key (type, user, domain, host, server,
;; share, volume, port, ssl)
2009-06-22 21:04:49 +00:00
;; ARRAY BYTE value
;; ARRAY BYTE default_location Since GVFS 1.5 only !!!
2009-06-22 21:04:49 +00:00
(defconst tramp-gvfs-interface-mountoperation "org.gtk.vfs.MountOperation"
"Used by the dbus-proxying implementation of GMountOperation.")
;; <interface name='org.gtk.vfs.MountOperation'>
;; <method name='askPassword'>
;; <arg name='message' type='s' direction='in'/>
2009-06-22 21:04:49 +00:00
;; <arg name='default_user' type='s' direction='in'/>
;; <arg name='default_domain' type='s' direction='in'/>
;; <arg name='flags' type='u' direction='in'/>
;; <arg name='handled' type='b' direction='out'/>
;; <arg name='aborted' type='b' direction='out'/>
;; <arg name='password' type='s' direction='out'/>
;; <arg name='username' type='s' direction='out'/>
;; <arg name='domain' type='s' direction='out'/>
;; <arg name='anonymous' type='b' direction='out'/>
;; <arg name='password_save' type='u' direction='out'/>
;; </method>
;; <method name='askQuestion'>
;; <arg name='message' type='s' direction='in'/>
;; <arg name='choices' type='as' direction='in'/>
;; <arg name='handled' type='b' direction='out'/>
;; <arg name='aborted' type='b' direction='out'/>
;; <arg name='choice' type='u' direction='out'/>
;; </method>
;; </interface>
;; The following flags are used in "askPassword". They are defined in
;; /usr/include/glib-2.0/gio/gioenums.h.
(defconst tramp-gvfs-password-need-password 1
"Operation requires a password.")
(defconst tramp-gvfs-password-need-username 2
"Operation requires a username.")
(defconst tramp-gvfs-password-need-domain 4
"Operation requires a domain.")
(defconst tramp-gvfs-password-saving-supported 8
"Operation supports saving settings.")
(defconst tramp-gvfs-password-anonymous-supported 16
"Operation supports anonymous users.")
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
;; For the time being, we just need org.goa.Account and org.goa.Files
;; interfaces. We document the other ones, just in case.
;;;###tramp-autoload
(defconst tramp-goa-service "org.gnome.OnlineAccounts"
"The well known name of the GNOME Online Accounts service.")
(defconst tramp-goa-path "/org/gnome/OnlineAccounts"
"The object path of the GNOME Online Accounts.")
(defconst tramp-goa-path-accounts (concat tramp-goa-path "/Accounts")
"The object path of the GNOME Online Accounts accounts.")
(defconst tramp-goa-interface-documents "org.gnome.OnlineAccounts.Documents"
"The documents interface of the GNOME Online Accounts.")
;; <interface name='org.gnome.OnlineAccounts.Documents'>
;; </interface>
(defconst tramp-goa-interface-printers "org.gnome.OnlineAccounts.Printers"
"The printers interface of the GNOME Online Accounts.")
;; <interface name='org.gnome.OnlineAccounts.Printers'>
;; </interface>
(defconst tramp-goa-interface-files "org.gnome.OnlineAccounts.Files"
"The files interface of the GNOME Online Accounts.")
;; <interface name='org.gnome.OnlineAccounts.Files'>
;; <property type='b' name='AcceptSslErrors' access='read'/>
;; <property type='s' name='Uri' access='read'/>
;; </interface>
(defconst tramp-goa-interface-contacts "org.gnome.OnlineAccounts.Contacts"
"The contacts interface of the GNOME Online Accounts.")
;; <interface name='org.gnome.OnlineAccounts.Contacts'>
;; <property type='b' name='AcceptSslErrors' access='read'/>
;; <property type='s' name='Uri' access='read'/>
;; </interface>
(defconst tramp-goa-interface-calendar "org.gnome.OnlineAccounts.Calendar"
"The calendar interface of the GNOME Online Accounts.")
;; <interface name='org.gnome.OnlineAccounts.Calendar'>
;; <property type='b' name='AcceptSslErrors' access='read'/>
;; <property type='s' name='Uri' access='read'/>
;; </interface>
(defconst tramp-goa-interface-oauth2based "org.gnome.OnlineAccounts.OAuth2Based"
"The oauth2based interface of the GNOME Online Accounts.")
;; <interface name='org.gnome.OnlineAccounts.OAuth2Based'>
;; <method name='GetAccessToken'>
;; <arg type='s' name='access_token' direction='out'/>
;; <arg type='i' name='expires_in' direction='out'/>
;; </method>
;; <property type='s' name='ClientId' access='read'/>
;; <property type='s' name='ClientSecret' access='read'/>
;; </interface>
(defconst tramp-goa-interface-account "org.gnome.OnlineAccounts.Account"
"The account interface of the GNOME Online Accounts.")
;; <interface name='org.gnome.OnlineAccounts.Account'>
;; <method name='Remove'/>
;; <method name='EnsureCredentials'>
;; <arg type='i' name='expires_in' direction='out'/>
;; </method>
;; <property type='s' name='ProviderType' access='read'/>
;; <property type='s' name='ProviderName' access='read'/>
;; <property type='s' name='ProviderIcon' access='read'/>
;; <property type='s' name='Id' access='read'/>
;; <property type='b' name='IsLocked' access='read'/>
;; <property type='b' name='IsTemporary' access='readwrite'/>
;; <property type='b' name='AttentionNeeded' access='read'/>
;; <property type='s' name='Identity' access='read'/>
;; <property type='s' name='PresentationIdentity' access='read'/>
;; <property type='b' name='MailDisabled' access='readwrite'/>
;; <property type='b' name='CalendarDisabled' access='readwrite'/>
;; <property type='b' name='ContactsDisabled' access='readwrite'/>
;; <property type='b' name='ChatDisabled' access='readwrite'/>
;; <property type='b' name='DocumentsDisabled' access='readwrite'/>
;; <property type='b' name='MapsDisabled' access='readwrite'/>
;; <property type='b' name='MusicDisabled' access='readwrite'/>
;; <property type='b' name='PrintersDisabled' access='readwrite'/>
;; <property type='b' name='PhotosDisabled' access='readwrite'/>
;; <property type='b' name='FilesDisabled' access='readwrite'/>
;; <property type='b' name='TicketingDisabled' access='readwrite'/>
;; <property type='b' name='TodoDisabled' access='readwrite'/>
;; <property type='b' name='ReadLaterDisabled' access='readwrite'/>
;; </interface>
(defconst tramp-goa-identity-regexp
(concat "^" "\\(" tramp-user-regexp "\\)?"
"@" "\\(" tramp-host-regexp "\\)?"
"\\(?:" ":""\\(" tramp-port-regexp "\\)" "\\)?")
"Regexp matching GNOME Online Accounts \"PresentationIdentity\" property.")
(defconst tramp-goa-interface-mail "org.gnome.OnlineAccounts.Mail"
"The mail interface of the GNOME Online Accounts.")
;; <interface name='org.gnome.OnlineAccounts.Mail'>
;; <property type='s' name='EmailAddress' access='read'/>
;; <property type='s' name='Name' access='read'/>
;; <property type='b' name='ImapSupported' access='read'/>
;; <property type='b' name='ImapAcceptSslErrors' access='read'/>
;; <property type='s' name='ImapHost' access='read'/>
;; <property type='b' name='ImapUseSsl' access='read'/>
;; <property type='b' name='ImapUseTls' access='read'/>
;; <property type='s' name='ImapUserName' access='read'/>
;; <property type='b' name='SmtpSupported' access='read'/>
;; <property type='b' name='SmtpAcceptSslErrors' access='read'/>
;; <property type='s' name='SmtpHost' access='read'/>
;; <property type='b' name='SmtpUseAuth' access='read'/>
;; <property type='b' name='SmtpAuthLogin' access='read'/>
;; <property type='b' name='SmtpAuthPlain' access='read'/>
;; <property type='b' name='SmtpAuthXoauth2' access='read'/>
;; <property type='b' name='SmtpUseSsl' access='read'/>
;; <property type='b' name='SmtpUseTls' access='read'/>
;; <property type='s' name='SmtpUserName' access='read'/>
;; </interface>
(defconst tramp-goa-interface-chat "org.gnome.OnlineAccounts.Chat"
"The chat interface of the GNOME Online Accounts.")
;; <interface name='org.gnome.OnlineAccounts.Chat'>
;; </interface>
(defconst tramp-goa-interface-photos "org.gnome.OnlineAccounts.Photos"
"The photos interface of the GNOME Online Accounts.")
;; <interface name='org.gnome.OnlineAccounts.Photos'>
;; </interface>
(defconst tramp-goa-path-manager (concat tramp-goa-path "/Manager")
"The object path of the GNOME Online Accounts manager.")
(defconst tramp-goa-interface-documents "org.gnome.OnlineAccounts.Manager"
"The manager interface of the GNOME Online Accounts.")
;; <interface name='org.gnome.OnlineAccounts.Manager'>
;; <method name='AddAccount'>
;; <arg type='s' name='provider' direction='in'/>
;; <arg type='s' name='identity' direction='in'/>
;; <arg type='s' name='presentation_identity' direction='in'/>
;; <arg type='a{sv}' name='credentials' direction='in'/>
;; <arg type='a{ss}' name='details' direction='in'/>
;; <arg type='o' name='account_object_path' direction='out'/>
;; </method>
;; </interface>
;; The basic structure for GNOME Online Accounts. We use a list :type,
Sync with Tramp 2.5.0-pre * doc/misc/tramp.texi: Protext Tramp x.y and Emacs x.y by @w{}. (GVFS-based methods): Move "GNOME Online Accounts" index. (Customizing Methods, Android shell setup, File name completion) (Frequently Asked Questions): Fix typos. * doc/misc/trampver.texi: Change version to "2.5.0-pre". * lisp/net/trampver.el: Change version to "2.5.0-pre". (inhibit-message): Don't declare. * lisp/net/tramp.el: Bump version to 2.5.0-pre. Require Emacs 25.1. (tramp-debug-message): Simplify. (tramp-message): Don't use `tramp-message-show-message'. (tramp-with-demoted-errors, with-parsed-tramp-file-name) (with-tramp-file-property, with-tramp-connection-property): Adapt `declare' form. (with-tramp-progress-reporter): Suppress progress reporter when noninteractive. (tramp-completion-mode, tramp-completion-mode-p): Remove. * lisp/net/tramp-compat.el (tramp-compat-process-running-p) (format-message): Remove compatibility code. (tramp-compat-directory-name-p) (tramp-compat-tramp-file-name-slots): Remove. * lisp/net/tramp.el (tramp-debug-message, tramp-message) (tramp-backtrace, tramp-error, tramp-error-with-buffer) (tramp-user-error, tramp-with-demoted-errors) (tramp-signal-hook-function): * lisp/net/tramp-compat.el (tramp-compat-funcall) * lisp/net/tramp-gvfs.el (tramp-dbus-function): Add `tramp-suppress-trace' property. * lisp/net/tramp.el (tramp-get-method-parameter) (tramp-dissect-file-name, tramp-error, tramp-error-with-buffer) (tramp-user-error, with-parsed-tramp-file-name) (with-tramp-progress-reporter, tramp-file-name-handler) (tramp-completion-file-name-handler, tramp-autoload-file-name-handler) (tramp-register-file-name-handlers, tramp-connectable-p) (tramp-handle-file-modes, tramp-handle-file-regular-p) (tramp-handle-file-truename, tramp-handle-insert-directory) (tramp-handle-load, tramp-set-file-uid-gid): * lisp/net/tramp-adb.el (tramp-adb-file-name-handler) (tramp-adb-handle-file-truename, tramp-adb-handle-copy-file) (tramp-adb-handle-rename-file): * lisp/net/tramp-archive.el (with-parsed-tramp-archive-file-name): * lisp/net/tramp-cache.el (tramp-get-file-property, tramp-cache-print): * lisp/net/tramp-compat.el (tramp-compat-process-running-p) (tramp-compat-exec-path): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler) (tramp-gvfs-dbus-byte-array-to-string) (tramp-gvfs-do-copy-or-rename-file): * lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler) (tramp-rclone-do-copy-or-rename-file): * lisp/net/tramp-sh.el (tramp-sh-handle-file-truename) (tramp-sh-handle-copy-directory, tramp-do-copy-or-rename-file) (tramp-sh-handle-insert-directory, tramp-sh-file-name-handler) (tramp-maybe-open-connection): * lisp/net/tramp-smb.el (tramp-smb-file-name-handler) (tramp-smb-handle-copy-file, tramp-smb-handle-copy-directory) (tramp-smb-handle-copy-file, tramp-smb-handle-insert-directory) (tramp-smb-handle-rename-file, tramp-smb-maybe-open-connection): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler) (tramp-sudoedit-do-copy-or-rename-file) (tramp-sudoedit-handle-file-truename): Use `if-let', `when-let', `directory-name-p', `inhibit-message', `non-essential and `cl-struct-slot-info'. Don't use `seconds-to-time'. * test/lisp/net/tramp-archive-tests.el (tramp-message-show-message): Don't set. * test/lisp/net/tramp-tests.el (inhibit-message): Don't declare. (tramp-message-show-message): Don't set. (tramp-test06-directory-file-name): Use `non-essential'. (tramp-test10-write-region): Use `inhibit-message'. (tramp-test36-vc-registered): No special handling for old Emacsen. (tramp--test-emacs25-p): Remove. (tramp-test45-unload): Special case of `tramp-completion-mode'.
2020-01-19 14:11:07 +01:00
;; in order to be compatible with Emacs 25.
(cl-defstruct (tramp-goa-account (:type list) :named) method user host port)
;;;###tramp-autoload
(defconst tramp-gvfs-service-afc-volumemonitor "org.gtk.vfs.AfcVolumeMonitor"
"The well known name of the AFC volume monitor.")
;; This one is not needed yet.
(defconst tramp-gvfs-service-goa-volumemonitor "org.gtk.vfs.GoaVolumeMonitor"
"The well known name of the GOA volume monitor.")
;;;###tramp-autoload
(defconst tramp-gvfs-service-gphoto2-volumemonitor
"org.gtk.vfs.GPhoto2VolumeMonitor"
"The well known name of the GPhoto2 volume monitor.")
;;;###tramp-autoload
(defconst tramp-gvfs-service-mtp-volumemonitor "org.gtk.vfs.MTPVolumeMonitor"
"The well known name of the MTP volume monitor.")
(defconst tramp-gvfs-path-remotevolumemonitor
"/org/gtk/Private/RemoteVolumeMonitor"
"The object path of the remote volume monitor.")
(defconst tramp-gvfs-interface-remotevolumemonitor
"org.gtk.Private.RemoteVolumeMonitor"
"The volume monitor interface.")
;; <interface name='org.gtk.Private.RemoteVolumeMonitor'>
;; <method name="IsSupported">
;; <arg type='b' name='is_supported' direction='out'/>
;; </method>
;; <method name="List">
;; <arg type='a(ssssbbbbbbbbuasa{ss}sa{sv})' name='drives' direction='out'/>
;; <arg type='a(ssssssbbssa{ss}sa{sv})' name='volumes' direction='out'/>
;; <arg type='a(ssssssbsassa{sv})' name='mounts' direction='out'/>
;; </method>
;; <method name="CancelOperation">
;; <arg type='s' name='cancellation_id' direction='in'/>
;; <arg type='b' name='was_cancelled' direction='out'/>
;; </method>
;; <method name="MountUnmount">
;; <arg type='s' name='id' direction='in'/>
;; <arg type='s' name='cancellation_id' direction='in'/>
;; <arg type='u' name='unmount_flags' direction='in'/>
;; <arg type='s' name='mount_op_id' direction='in'/>
;; </method>
;; <method name="VolumeMount">
;; <arg type='s' name='id' direction='in'/>
;; <arg type='s' name='cancellation_id' direction='in'/>
;; <arg type='u' name='mount_flags' direction='in'/>
;; <arg type='s' name='mount_op_id' direction='in'/>
;; </method>
;; <method name="DriveEject">
;; <arg type='s' name='id' direction='in'/>
;; <arg type='s' name='cancellation_id' direction='in'/>
;; <arg type='u' name='unmount_flags' direction='in'/>
;; <arg type='s' name='mount_op_id' direction='in'/>
;; </method>
;; <method name="DrivePollForMedia">
;; <arg type='s' name='id' direction='in'/>
;; <arg type='s' name='cancellation_id' direction='in'/>
;; </method>
;; <method name="DriveStart">
;; <arg type='s' name='id' direction='in'/>
;; <arg type='s' name='cancellation_id' direction='in'/>
;; <arg type='u' name='flags' direction='in'/>
;; <arg type='s' name='mount_op_id' direction='in'/>
;; </method>
;; <method name="DriveStop">
;; <arg type='s' name='id' direction='in'/>
;; <arg type='s' name='cancellation_id' direction='in'/>
;; <arg type='u' name='unmount_flags' direction='in'/>
;; <arg type='s' name='mount_op_id' direction='in'/>
;; </method>
;; <method name="MountOpReply">
;; <arg type='s' name='mount_op_id' direction='in'/>
;; <arg type='i' name='result' direction='in'/>
;; <arg type='s' name='user_name' direction='in'/>
;; <arg type='s' name='domain' direction='in'/>
;; <arg type='s' name='encoded_password' direction='in'/>
;; <arg type='i' name='password_save' direction='in'/>
;; <arg type='i' name='choice' direction='in'/>
;; <arg type='b' name='anonymous' direction='in'/>
;; </method>
;; <signal name="DriveChanged">
;; <arg type='s' name='dbus_name'/>
;; <arg type='s' name='id'/>
;; <arg type='(ssssbbbbbbbbuasa{ss}sa{sv})' name='drive'/>
;; </signal>
;; <signal name="DriveConnected">
;; <arg type='s' name='dbus_name'/>
;; <arg type='s' name='id'/>
;; <arg type='(ssssbbbbbbbbuasa{ss}sa{sv})' name='drive'/>
;; </signal>
;; <signal name="DriveDisconnected">
;; <arg type='s' name='dbus_name'/>
;; <arg type='s' name='id'/>
;; <arg type='(ssssbbbbbbbbuasa{ss}sa{sv})' name='drive'/>
;; </signal>
;; <signal name="DriveEjectButton">
;; <arg type='s' name='dbus_name'/>
;; <arg type='s' name='id'/>
;; <arg type='(ssssbbbbbbbbuasa{ss}sa{sv})' name='drive'/>
;; </signal>
;; <signal name="DriveStopButton">
;; <arg type='s' name='dbus_name'/>
;; <arg type='s' name='id'/>
;; <arg type='(ssssbbbbbbbbuasa{ss}sa{sv})' name='drive'/>
;; </signal>
;; <signal name="VolumeChanged">
;; <arg type='s' name='dbus_name'/>
;; <arg type='s' name='id'/>
;; <arg type='(ssssssbbssa{ss}sa{sv})' name='volume'/>
;; </signal>
;; <signal name="VolumeAdded">
;; <arg type='s' name='dbus_name'/>
;; <arg type='s' name='id'/>
;; <arg type='(ssssssbbssa{ss}sa{sv})' name='volume'/>
;; </signal>
;; <signal name="VolumeRemoved">
;; <arg type='s' name='dbus_name'/>
;; <arg type='s' name='id'/>
;; <arg type='(ssssssbbssa{ss}sa{sv})' name='volume'/>
;; </signal>
;; <signal name="MountChanged">
;; <arg type='s' name='dbus_name'/>
;; <arg type='s' name='id'/>
;; <arg type='(ssssssbsassa{sv})' name='mount'/>
;; </signal>
;; <signal name="MountAdded">
;; <arg type='s' name='dbus_name'/>
;; <arg type='s' name='id'/>
;; <arg type='(ssssssbsassa{sv})' name='mount'/>
;; </signal>
;; <signal name="MountPreUnmount">
;; <arg type='s' name='dbus_name'/>
;; <arg type='s' name='id'/>
;; <arg type='(ssssssbsassa{sv})' name='mount'/>
;; </signal>
;; <signal name="MountRemoved">
;; <arg type='s' name='dbus_name'/>
;; <arg type='s' name='id'/>
;; <arg type='(ssssssbsassa{sv})' name='mount'/>
;; </signal>
;; <signal name="MountOpAskPassword">
;; <arg type='s' name='dbus_name'/>
;; <arg type='s' name='id'/>
;; <arg type='s' name='message_to_show'/>
;; <arg type='s' name='default_user'/>
;; <arg type='s' name='default_domain'/>
;; <arg type='u' name='flags'/>
;; </signal>
;; <signal name="MountOpAskQuestion">
;; <arg type='s' name='dbus_name'/>
;; <arg type='s' name='id'/>
;; <arg type='s' name='message_to_show'/>
;; <arg type='as' name='choices'/>
;; </signal>
;; <signal name="MountOpShowProcesses">
;; <arg type='s' name='dbus_name'/>
;; <arg type='s' name='id'/>
;; <arg type='s' name='message_to_show'/>
;; <arg type='ai' name='pid'/>
;; <arg type='as' name='choices'/>
;; </signal>
;; <signal name="MountOpShowUnmountProgress">
;; <arg type='s' name='dbus_name'/>
;; <arg type='s' name='id'/>
;; <arg type='s' name='message_to_show'/>
;; <arg type='x' name='time_left'/>
;; <arg type='x' name='bytes_left'/>
;; </signal>
;; <signal name="MountOpAborted">
;; <arg type='s' name='dbus_name'/>
;; <arg type='s' name='id'/>
;; </signal>
;; </interface>
;; STRUCT volume
;; STRING id
;; STRING name
;; STRING gicon_data
;; STRING symbolic_gicon_data
;; STRING uuid
;; STRING activation_uri
;; BOOLEAN can-mount
;; BOOLEAN should-automount
;; STRING drive-id
;; STRING mount-id
;; ARRAY identifiers
;; DICT
;; STRING key (unix-device, class, uuid, ...)
;; STRING value
;; STRING sort_key
;; ARRAY expansion
;; DICT
;; STRING key (always-call-mount, is-removable, ...)
;; VARIANT value (boolean?)
;; The basic structure for media devices. We use a list :type, in
;; order to be compatible with Emacs 25.
(cl-defstruct (tramp-media-device (:type list) :named) method host port)
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
;; "gvfs-<command>" utilities have been deprecated in GVFS 1.31.1. We
;; must use "gio <command>" tool instead.
(defconst tramp-gvfs-gio-mapping
'(("gvfs-copy" . "copy")
("gvfs-info" . "info")
("gvfs-ls" . "list")
("gvfs-mkdir" . "mkdir")
("gvfs-monitor-file" . "monitor")
("gvfs-mount" . "mount")
("gvfs-move" . "move")
("gvfs-rm" . "remove")
("gvfs-set-attribute" . "set"))
"List of cons cells, mapping \"gvfs-<command>\" to \"gio <command>\".")
Sync with Tramp 2.4.0-pre * doc/misc/trampver.texi: * lisp/net/trampver.el: Change version to "2.4.0-pre". * lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist): Use `tramp-handle-file-directory-p'. (tramp-adb-parse-device-names) (tramp-adb-handle-expand-file-name) (tramp-adb-handle-file-truename, tramp-adb-handle-process-file): Adapt `tramp-make-tramp-file-name' call. (tramp-adb-handle-file-directory-p): Remove. (tramp-adb-maybe-open-connection): Do not set tramp-current-*. * lisp/net/tramp-cache.el (tramp-get-hash-table): Adapt `tramp-make-tramp-file-name' call. * lisp/net/tramp-cmds.el (tramp-cleanup-connection): Do not set tramp-current-*. * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Use `tramp-handle-file-directory-p'. (tramp-gvfs-dbus-event-error): Trace with verbosity 6. (tramp-gvfs-do-copy-or-rename-file): Use `file-truename'. (tramp-gvfs-handle-file-directory-p): Remove. (tramp-gvfs-handler-askpassword): Do not set tramp-current-*. * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band) (tramp-sh-handle-start-file-process) (tramp-maybe-open-connection, tramp-get-remote-path): Do not set tramp-current-*. (tramp-maybe-open-connection): Set "password-vector" property. * lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist): Use `tramp-handle-file-accessible-directory-p' and `tramp-handle-file-directory-p'. (tramp-smb-handle-copy-directory, tramp-smb-handle-file-acl) (tramp-smb-handle-set-file-acl) (tramp-smb-maybe-open-connection): Do not set tramp-current-*. (tramp-smb-handle-file-directory-p): Remove. (tramp-smb-handle-make-symbolic-link): Use `tramp-get-connection-buffer' rather than `buffer-name'. * lisp/net/tramp.el (tramp-current-method, tramp-current-user) (tramp-current-domain, tramp-current-host) (tramp-current-port): Remove. (tramp-dissect-file-name): No special handling of localname anymore. (tramp-make-tramp-file-name): Reimplemnt with new signature. (tramp-completion-make-tramp-file-name): Fix docstring. (tramp-get-buffer, tramp-handle-file-name-as-directory) (tramp-handle-file-name-directory) (tramp-check-cached-permissions, tramp-local-host-p) (tramp-get-remote-tmpdir, tramp-clear-passwd): Adapt `tramp-make-tramp-file-name' call. (tramp-completion-handle-file-name-all-completions) (tramp-action-login, tramp-read-passwd): Do not set tramp-current-*. (tramp-handle-file-directory-p): New defun. (tramp-handle-verify-visited-file-modtime): Remove superfluous `with-parsed-tramp-file-name'. (tramp-process-actions, tramp-read-passwd): Use "password-vector" property. (tramp-call-process, tramp-call-process-region): No special setting of vec. (tramp-read-passwd): Handle "login-as" property. * test/lisp/net/tramp-tests.el (tramp-test21-file-links): Special code for "smb".
2017-12-09 13:22:52 +01:00
;; <http://www.pygtk.org/docs/pygobject/gio-constants.html>
Tramp code cleanup * lisp/net/tramp.el (tramp-shell-prompt-pattern) (tramp-wrong-passwd-regexp, tramp-method-regexp-alist) (tramp-domain-regexp, tramp-host-regexp, tramp-ipv6-regexp) (tramp-port-regexp, tramp-debug-outline-regexp) (tramp-drop-volume-letter, tramp-parse-shostkeys) (tramp-handle-file-name-case-insensitive-p): * lisp/net/tramp-adb.el (tramp-adb-send-command-and-check): * lisp/net/tramp-ftp.el (tramp-ftp-enable-ange-ftp): * lisp/net/tramp-gvfs.el (tramp-gvfs-monitor-process-filter): * lisp/net/tramp-sh.el (tramp-display-escape-sequence-regexp) (tramp-device-escape-sequence-regexp): * lisp/net/tramp-smb.el (tramp-smb-do-file-attributes-with-stat) (tramp-smb-handle-set-file-acl, tramp-smb-read-file-entry): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-file-selinux-context): Use character classes in regexp. * lisp/net/tramp-adb.el (tramp-adb-ls-date-year-regexp) (tramp-adb-ls-date-time-regexp): New defconst. (tramp-adb-ls-date-regexp, tramp-adb-ls-toolbox-regexp) (tramp-adb-sh-fix-ls-output): Use them. (tramp-adb-handle-set-file-times, tramp-adb-maybe-open-connection): Apply `eval-when-compile' on constant concat data. (tramp-do-parse-file-attributes-with-ls): Suppress `signal-hook-function'. (tramp-adb--gnu-switches-to-ash): Remove unused function. (tramp-adb-handle-set-file-modes): Qhote argument. (tramp-adb-maybe-open-connection): Set file property rather than flush. * lisp/net/tramp-cmds.el (tramp-rename-these-files): Apply `eval-when-compile' on constant concat data. * lisp/net/tramp-gvfs.el (tramp-gvfs-file-attributes) (tramp-gvfs-file-attributes-with-gvfs-ls-regexp): Embed them in `eval-and-compile'. (tramp-gvfs-get-directory-attributes): Apply `eval-when-compile' on constant concat data.
2020-07-10 10:45:14 +02:00
(eval-and-compile
(defconst tramp-gvfs-file-attributes
'("name"
"type"
"standard::display-name"
"standard::symlink-target"
"standard::is-volatile"
"unix::nlink"
"unix::uid"
"owner::user"
"unix::gid"
"owner::group"
"time::access"
"time::modified"
"time::changed"
"standard::size"
"unix::mode"
"access::can-read"
"access::can-write"
"access::can-execute"
"unix::inode"
"unix::device")
"GVFS file attributes."))
(eval-and-compile
(defconst tramp-gvfs-file-attributes-with-gvfs-ls-regexp
(concat "[[:blank:]]" (regexp-opt tramp-gvfs-file-attributes t) "=\\(.+?\\)")
"Regexp to parse GVFS file attributes with `gvfs-ls'."))
Sync with Tramp repository. * lisp/net/tramp-adb.el (tramp-adb-handle-start-file-process): * lisp/net/tramp-sh.el (tramp-sh-handle-start-file-process) * lisp/net/tramp-smb.el (tramp-smb-handle-start-file-process): Create BUFFER if it doesn't exist. Reported by Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com>. * lisp/net/tramp-gvfs.el (tramp-gvfs-file-attributes) (tramp-gvfs-file-attributes-with-gvfs-ls-regexp) (tramp-gvfs-file-attributes-with-gvfs-info-regexp): New defconst. (tramp-gvfs-get-directory-attributes) (tramp-gvfs-get-root-attributes) (tramp-gvfs-get-file-attributes): New defun. (tramp-gvfs-handle-file-attributes) (tramp-gvfs-handle-file-name-all-completions): Use them. (tramp-gvfs-handle-file-directory-p): Use `file-truename'. (tramp-gvfs-maybe-open-connection): Set :noquery flag for process. (tramp-gvfs-send-command): Add locale settings to `process-environment'. (top): Suppress D-Bus error messages during zeroconf initialization. * lisp/net/tramp.el (tramp-unknown-id-string) (tramp-unknown-id-integer): New defconst. (tramp-check-cached-permissions) * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-attributes) * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls) (tramp-convert-file-attributes, tramp-get-remote-uid) (tramp-get-remote-gid): Use them. * lisp/net/tramp-sh.el (tramp-display-escape-sequence-regexp): Rename from `tramp-color-escape-sequence-regexp'. (tramp-sh-handle-insert-directory) (tramp-convert-file-attributes): Adapt callees. (tramp-device-escape-sequence-regexp): New defconst. (tramp-wait-for-output): Use it. Reported by Matthías Páll Gissurarson <icetritlo@gmail.com>. * lisp/net/tramp-smb.el (tramp-smb-handle-file-name-all-completions): Simplify. * test/lisp/net/tramp-tests.el (tramp-test26-process-file) (tramp-test28-shell-command): Use `tramp-display-escape-sequence-regexp'.
2016-05-28 12:14:58 +02:00
(defconst tramp-gvfs-file-attributes-with-gvfs-info-regexp
(concat "^[[:blank:]]*"
(regexp-opt tramp-gvfs-file-attributes t)
":[[:blank:]]+\\(.*\\)$")
"Regexp to parse GVFS file attributes with `gvfs-info'.")
(defconst tramp-gvfs-file-system-attributes
'("filesystem::free"
"filesystem::size"
"filesystem::used")
"GVFS file system attributes.")
(defconst tramp-gvfs-file-system-attributes-regexp
(concat "^[[:blank:]]*"
(regexp-opt tramp-gvfs-file-system-attributes t)
":[[:blank:]]+\\(.*\\)$")
"Regexp to parse GVFS file system attributes with `gvfs-info'.")
(defconst tramp-gvfs-nextcloud-default-prefix "/remote.php/webdav"
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
"Default prefix for owncloud / nextcloud methods.")
(defconst tramp-gvfs-nextcloud-default-prefix-regexp
(concat (regexp-quote tramp-gvfs-nextcloud-default-prefix) "$")
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
"Regexp of default prefix for owncloud / nextcloud methods.")
2009-06-22 21:04:49 +00:00
;; New handlers should be added here.
;;;###tramp-autoload
2009-06-22 21:04:49 +00:00
(defconst tramp-gvfs-file-name-handler-alist
'((access-file . tramp-handle-access-file)
(add-name-to-file . tramp-handle-add-name-to-file)
;; `byte-compiler-base-file-name' performed by default handler.
(copy-directory . tramp-handle-copy-directory)
2009-06-22 21:04:49 +00:00
(copy-file . tramp-gvfs-handle-copy-file)
(delete-directory . tramp-gvfs-handle-delete-directory)
(delete-file . tramp-gvfs-handle-delete-file)
;; `diff-latest-backup-file' performed by default handler.
2009-06-22 21:04:49 +00:00
(directory-file-name . tramp-handle-directory-file-name)
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(directory-files . tramp-handle-directory-files)
2009-06-22 21:04:49 +00:00
(directory-files-and-attributes
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
. tramp-handle-directory-files-and-attributes)
2009-06-22 21:04:49 +00:00
(dired-compress-file . ignore)
(dired-uncache . tramp-handle-dired-uncache)
Implement command completion in remote shells. (Bug#31704) * doc/lispref/files.texi (Locating Files): Describe optional argument REMOTE of `executable-find'. (Magic File Names): Add `exec-path'. * doc/lispref/processes.texi (Subprocess Creation): Describe function `exec-path'. * doc/misc/tramp.texi (Remote programs): Explain refresh of search paths by `tramp-cleanup-this-connection'. * etc/NEWS: Mention 'exec-path' and 'executable-find'. * lisp/files.el (exec-path): New defun. (executable-find): Add optional argument REMOTE. * lisp/shell.el (shell-completion-vars): Set `comint-file-name-prefix'. (shell--command-completion-data): Use `(exec-path)'. (Bug#31704) * lisp/net/ange-ftp.el (exec-path): * lisp/net/tramp.el (tramp-file-name-for-operation): * 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-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) <exec-path>: Add handler. * lisp/net/tramp-adb.el (tramp-adb-handle-exec-path): New defun. (tramp-adb-maybe-open-connection): Do not set "remote-path" connection property. * lisp/net/tramp-compat.el (tramp-compat-exec-path): New defun. * lisp/net/tramp-sh.el (tramp-sh-handle-exec-path): New defun. * lisp/net/tramp.el (tramp-eshell-directory-change): Use it. * test/lisp/net/tramp-archive-tests.el (tramp-archive-test38-make-nearby-temp-file) (tramp-archive-test41-file-system-info) (tramp-archive-test43-auto-load) (tramp-archive-test43-delay-load): Rename. * test/lisp/net/tramp-tests.el (tramp-test34-exec-path): New test. (tramp-test36-make-auto-save-file-name) (tramp-test37-find-backup-file-name) (tramp-test38-make-nearby-temp-file) (tramp-test39-special-characters) (tramp-test39-special-characters-with-stat) (tramp-test39-special-characters-with-perl) (tramp-test39-special-characters-with-ls, tramp-test40-utf8) (tramp-test40-utf8-with-stat, tramp-test40-utf8-with-perl) (tramp-test40-utf8-with-ls, tramp-test41-file-system-info) (tramp-test42-asynchronous-requests, tramp-test43-auto-load) (tramp-test43-delay-load, tramp-test43-recursive-load) (tramp-test43-remote-load-path, tramp-test44-unload): Rename.
2018-06-20 12:13:56 +02:00
(exec-path . ignore)
2009-06-22 21:04:49 +00:00
(expand-file-name . tramp-gvfs-handle-expand-file-name)
(file-accessible-directory-p . tramp-handle-file-accessible-directory-p)
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(file-acl . ignore)
2009-06-22 21:04:49 +00:00
(file-attributes . tramp-gvfs-handle-file-attributes)
Sync with Tramp 2.4.0-pre * doc/misc/trampver.texi: * lisp/net/trampver.el: Change version to "2.4.0-pre". * lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist): Use `tramp-handle-file-directory-p'. (tramp-adb-parse-device-names) (tramp-adb-handle-expand-file-name) (tramp-adb-handle-file-truename, tramp-adb-handle-process-file): Adapt `tramp-make-tramp-file-name' call. (tramp-adb-handle-file-directory-p): Remove. (tramp-adb-maybe-open-connection): Do not set tramp-current-*. * lisp/net/tramp-cache.el (tramp-get-hash-table): Adapt `tramp-make-tramp-file-name' call. * lisp/net/tramp-cmds.el (tramp-cleanup-connection): Do not set tramp-current-*. * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Use `tramp-handle-file-directory-p'. (tramp-gvfs-dbus-event-error): Trace with verbosity 6. (tramp-gvfs-do-copy-or-rename-file): Use `file-truename'. (tramp-gvfs-handle-file-directory-p): Remove. (tramp-gvfs-handler-askpassword): Do not set tramp-current-*. * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band) (tramp-sh-handle-start-file-process) (tramp-maybe-open-connection, tramp-get-remote-path): Do not set tramp-current-*. (tramp-maybe-open-connection): Set "password-vector" property. * lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist): Use `tramp-handle-file-accessible-directory-p' and `tramp-handle-file-directory-p'. (tramp-smb-handle-copy-directory, tramp-smb-handle-file-acl) (tramp-smb-handle-set-file-acl) (tramp-smb-maybe-open-connection): Do not set tramp-current-*. (tramp-smb-handle-file-directory-p): Remove. (tramp-smb-handle-make-symbolic-link): Use `tramp-get-connection-buffer' rather than `buffer-name'. * lisp/net/tramp.el (tramp-current-method, tramp-current-user) (tramp-current-domain, tramp-current-host) (tramp-current-port): Remove. (tramp-dissect-file-name): No special handling of localname anymore. (tramp-make-tramp-file-name): Reimplemnt with new signature. (tramp-completion-make-tramp-file-name): Fix docstring. (tramp-get-buffer, tramp-handle-file-name-as-directory) (tramp-handle-file-name-directory) (tramp-check-cached-permissions, tramp-local-host-p) (tramp-get-remote-tmpdir, tramp-clear-passwd): Adapt `tramp-make-tramp-file-name' call. (tramp-completion-handle-file-name-all-completions) (tramp-action-login, tramp-read-passwd): Do not set tramp-current-*. (tramp-handle-file-directory-p): New defun. (tramp-handle-verify-visited-file-modtime): Remove superfluous `with-parsed-tramp-file-name'. (tramp-process-actions, tramp-read-passwd): Use "password-vector" property. (tramp-call-process, tramp-call-process-region): No special setting of vec. (tramp-read-passwd): Handle "login-as" property. * test/lisp/net/tramp-tests.el (tramp-test21-file-links): Special code for "smb".
2017-12-09 13:22:52 +01:00
(file-directory-p . tramp-handle-file-directory-p)
(file-equal-p . tramp-handle-file-equal-p)
2009-06-22 21:04:49 +00:00
(file-executable-p . tramp-gvfs-handle-file-executable-p)
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(file-exists-p . tramp-handle-file-exists-p)
(file-in-directory-p . tramp-handle-file-in-directory-p)
Refactor some Tramp functions * lisp/net/tramp-compat.el (tramp-compat-file-local-name): New defsubst. (tramp-compat-file-name-quoted-p, tramp-compat-file-name-quote) (tramp-compat-file-name-unquote): * lisp/net/tramp.el (tramp-handle-file-name-case-insensitive-p) (tramp-handle-file-truename, tramp-get-remote-tmpdir): * lisp/net/tramp-adb.el (tramp-adb-handle-copy-file) (tramp-adb-handle-rename-file, tramp-adb-handle-exec-path): * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-directly) (tramp-sh-handle-exec-path, tramp-find-inline-encoding) (tramp-get-remote-touch): Use it. * lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist): Use `tramp-handle-expand-file-name'. (tramp-adb-handle-expand-file-name): Move to tramp.el. (tramp-adb-handle-file-writable-p): Adapt docstring. * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Use `tramp-handle-file-local-copy', `tramp-handle-file-writable-p' and `tramp-handle-write-region'. (tramp-gvfs-handle-file-local-copy) (tramp-gvfs-handle-file-writable-p) (tramp-gvfs-handle-write-region): Move to tramp.el. * lisp/net/tramp-rclone.el: Dont't require `tramp-adb' and `tramp-gvfs' anymore. (tramp-rclone-file-name-handler-alist): Use `tramp-handle-expand-file-name', `tramp-handle-file-local-copy', `tramp-handle-file-writable-p' and `tramp-handle-write-region'. (tramp-rclone-handle-directory-files): Simplify. * lisp/net/tramp.el (tramp-methods): Extend docstring. (tramp-parse-netrc): Require `netrc'. (tramp-handle-expand-file-name, tramp-handle-file-local-copy) (tramp-handle-file-writable-p, tramp-handle-write-region): New defuns.
2018-12-07 17:21:03 +01:00
(file-local-copy . tramp-handle-file-local-copy)
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(file-modes . tramp-handle-file-modes)
2009-06-22 21:04:49 +00:00
(file-name-all-completions . tramp-gvfs-handle-file-name-all-completions)
(file-name-as-directory . tramp-handle-file-name-as-directory)
(file-name-case-insensitive-p . tramp-handle-file-name-case-insensitive-p)
2009-06-22 21:04:49 +00:00
(file-name-completion . tramp-handle-file-name-completion)
(file-name-directory . tramp-handle-file-name-directory)
(file-name-nondirectory . tramp-handle-file-name-nondirectory)
;; `file-name-sans-versions' performed by default handler.
2009-06-22 21:04:49 +00:00
(file-newer-than-file-p . tramp-handle-file-newer-than-file-p)
Complete file name handlers. * net/tramp.el (tramp-handle-set-visited-file-modtime) (tramp-handle-verify-visited-file-modtime) (tramp-handle-file-notify-rm-watch): New functions. (tramp-call-process): Do not bind `default-directory'. * net/tramp-adb.el (tramp-adb-file-name-handler-alist): Order alphabetically. [access-file, add-name-to-file, dired-call-process]: [dired-compress-file, file-acl, file-notify-rm-watch]: [file-ownership-preserved-p, file-selinux-context]: [make-directory-internal, make-symbolic-link, set-file-acl]: [set-file-selinux-context, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (tramp-adb-handle-write-region): Apply `set-visited-file-modtime'. * net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) [file-notify-add-watch, file-notify-rm-watch]: [set-file-times, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (with-tramp-gvfs-error-message) (tramp-gvfs-handle-set-visited-file-modtime) (tramp-gvfs-fuse-file-name): Remove. (tramp-gvfs-handle-file-notify-add-watch) (tramp-gvfs-file-gvfs-monitor-file-process-filter): New defuns. (tramp-gvfs-handle-write-region): Fix error in moving tmpfile. * net/tramp-sh.el (tramp-sh-file-name-handler-alist): Order alphabetically. [file-notify-rm-watch ]: Use default Tramp handler. [executable-find]: Remove private handler. (tramp-do-copy-or-rename-file-out-of-band): Do not bind `default-directory'. (tramp-sh-handle-executable-find) (tramp-sh-handle-file-notify-rm-watch): Remove functions. (tramp-sh-file-gvfs-monitor-dir-process-filter) (tramp-sh-file-inotifywait-process-filter, tramp-set-remote-path): Do not use `format' in `tramp-message'. * net/tramp-smb.el (tramp-smb-file-name-handler-alist) [file-notify-rm-watch, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (tramp-smb-call-winexe): Do not bind `default-directory'.
2013-08-01 13:10:31 +02:00
(file-notify-add-watch . tramp-gvfs-handle-file-notify-add-watch)
(file-notify-rm-watch . tramp-handle-file-notify-rm-watch)
(file-notify-valid-p . tramp-handle-file-notify-valid-p)
2009-06-22 21:04:49 +00:00
(file-ownership-preserved-p . ignore)
(file-readable-p . tramp-gvfs-handle-file-readable-p)
(file-regular-p . tramp-handle-file-regular-p)
(file-remote-p . tramp-handle-file-remote-p)
(file-selinux-context . tramp-handle-file-selinux-context)
2009-06-22 21:04:49 +00:00
(file-symlink-p . tramp-handle-file-symlink-p)
(file-system-info . tramp-gvfs-handle-file-system-info)
(file-truename . tramp-handle-file-truename)
Refactor some Tramp functions * lisp/net/tramp-compat.el (tramp-compat-file-local-name): New defsubst. (tramp-compat-file-name-quoted-p, tramp-compat-file-name-quote) (tramp-compat-file-name-unquote): * lisp/net/tramp.el (tramp-handle-file-name-case-insensitive-p) (tramp-handle-file-truename, tramp-get-remote-tmpdir): * lisp/net/tramp-adb.el (tramp-adb-handle-copy-file) (tramp-adb-handle-rename-file, tramp-adb-handle-exec-path): * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-directly) (tramp-sh-handle-exec-path, tramp-find-inline-encoding) (tramp-get-remote-touch): Use it. * lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist): Use `tramp-handle-expand-file-name'. (tramp-adb-handle-expand-file-name): Move to tramp.el. (tramp-adb-handle-file-writable-p): Adapt docstring. * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Use `tramp-handle-file-local-copy', `tramp-handle-file-writable-p' and `tramp-handle-write-region'. (tramp-gvfs-handle-file-local-copy) (tramp-gvfs-handle-file-writable-p) (tramp-gvfs-handle-write-region): Move to tramp.el. * lisp/net/tramp-rclone.el: Dont't require `tramp-adb' and `tramp-gvfs' anymore. (tramp-rclone-file-name-handler-alist): Use `tramp-handle-expand-file-name', `tramp-handle-file-local-copy', `tramp-handle-file-writable-p' and `tramp-handle-write-region'. (tramp-rclone-handle-directory-files): Simplify. * lisp/net/tramp.el (tramp-methods): Extend docstring. (tramp-parse-netrc): Require `netrc'. (tramp-handle-expand-file-name, tramp-handle-file-local-copy) (tramp-handle-file-writable-p, tramp-handle-write-region): New defuns.
2018-12-07 17:21:03 +01:00
(file-writable-p . tramp-handle-file-writable-p)
2009-06-22 21:04:49 +00:00
(find-backup-file-name . tramp-handle-find-backup-file-name)
;; `get-file-buffer' performed by default handler.
(insert-directory . tramp-handle-insert-directory)
(insert-file-contents . tramp-handle-insert-file-contents)
2009-06-22 21:04:49 +00:00
(load . tramp-handle-load)
Improve compatibility with older Emacsen, and XEmacs. * 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.
2013-09-08 17:04:10 +02:00
(make-auto-save-file-name . tramp-handle-make-auto-save-file-name)
2009-06-22 21:04:49 +00:00
(make-directory . tramp-gvfs-handle-make-directory)
(make-directory-internal . ignore)
Add `make-nearby-temp-file' and `temporary-file-directory' * doc/lispref/files.texi (Unique File Names): Introduce `make-nearby-temp-file' and `temporary-file-directory'. (Magic File Names): Mention `make-nearby-temp-file' and `temporary-file-directory'. * etc/NEWS (provided): Mention `make-nearby-temp-file' and `temporary-file-directory'. * lisp/files.el (mounted-file-systems): New defcustom. (temporary-file-directory, make-nearby-temp-file): New defuns. (normal-backup-enable-predicate): Fix docstring. * 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): <make-nearby-temp-file, temporary-file-directory>: Add handler. * lisp/net/tramp.el (tramp-file-name-for-operation): Add `make-nearby-temp-file' and `temporary-file-directory'. (tramp-get-remote-tmpdir): Remove compatibility code. (tramp-handle-temporary-file-directory) (tramp-handle-make-nearby-temp-file): New defuns. * lisp/org/ob-core.el (org-babel-local-file-name): * lisp/progmodes/gud.el (gud-common-init): * lisp/vc/vc-hooks.el (vc-user-login-name): Use `file-remote-p'. * lisp/vc/vc-git.el (vc-git-checkin): Handle remote log message. * test/lisp/net/tramp-tests.el (tramp-test06-directory-file-name): Check `tramp--test-enabled'. (tramp-test18-file-attributes): Add tests for `file-ownership-preserved-p'. (tramp-test27-start-file-process, tramp-test28-shell-command): Reduce timeouts in `accept-process-output'. (tramp-test--shell-command-to-string-asynchronously): Add timeout. (tramp-test29-environment-variables): Remove additional sleep calls. (tramp-test32-make-nearby-temp-file): New test. (tramp--test-special-characters, tramp--test-utf8): Adapt docstring. (tramp-test33-special-characters) (tramp-test33-special-characters-with-stat) (tramp-test33-special-characters-with-perl) (tramp-test33-special-characters-with-ls, tramp-test34-utf8) (tramp-test34-utf8-with-stat, tramp-test34-utf8-with-perl) (tramp-test34-utf8-with-ls) (tramp-test35-asynchronous-requests) (tramp-test36-recursive-load, tramp-test37-unload): Rename. (tramp--test-ftp-p): Simplify check. (tramp--test-sh-p): New defun. (tramp-test20-file-modes, tramp-test22-file-times) (tramp-test26-process-file, tramp-test27-start-file-process) (tramp-test28-shell-command) (tramp-test29-environment-variables) (tramp-test30-vc-registered) (tramp-test33-special-characters-with-stat) (tramp-test33-special-characters-with-perl) (tramp-test33-special-characters-with-ls) (tramp-test34-utf8-with-stat, tramp-test34-utf8-with-perl) (tramp-test34-utf8-with-ls) (tramp-test35-asynchronous-requests): Use it.
2016-08-07 13:57:23 +02:00
(make-nearby-temp-file . tramp-handle-make-nearby-temp-file)
(make-process . ignore)
(make-symbolic-link . tramp-handle-make-symbolic-link)
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(process-file . ignore)
2009-06-22 21:04:49 +00:00
(rename-file . tramp-gvfs-handle-rename-file)
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(set-file-acl . ignore)
(set-file-modes . tramp-gvfs-handle-set-file-modes)
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(set-file-selinux-context . ignore)
(set-file-times . tramp-gvfs-handle-set-file-times)
Complete file name handlers. * net/tramp.el (tramp-handle-set-visited-file-modtime) (tramp-handle-verify-visited-file-modtime) (tramp-handle-file-notify-rm-watch): New functions. (tramp-call-process): Do not bind `default-directory'. * net/tramp-adb.el (tramp-adb-file-name-handler-alist): Order alphabetically. [access-file, add-name-to-file, dired-call-process]: [dired-compress-file, file-acl, file-notify-rm-watch]: [file-ownership-preserved-p, file-selinux-context]: [make-directory-internal, make-symbolic-link, set-file-acl]: [set-file-selinux-context, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (tramp-adb-handle-write-region): Apply `set-visited-file-modtime'. * net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) [file-notify-add-watch, file-notify-rm-watch]: [set-file-times, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (with-tramp-gvfs-error-message) (tramp-gvfs-handle-set-visited-file-modtime) (tramp-gvfs-fuse-file-name): Remove. (tramp-gvfs-handle-file-notify-add-watch) (tramp-gvfs-file-gvfs-monitor-file-process-filter): New defuns. (tramp-gvfs-handle-write-region): Fix error in moving tmpfile. * net/tramp-sh.el (tramp-sh-file-name-handler-alist): Order alphabetically. [file-notify-rm-watch ]: Use default Tramp handler. [executable-find]: Remove private handler. (tramp-do-copy-or-rename-file-out-of-band): Do not bind `default-directory'. (tramp-sh-handle-executable-find) (tramp-sh-handle-file-notify-rm-watch): Remove functions. (tramp-sh-file-gvfs-monitor-dir-process-filter) (tramp-sh-file-inotifywait-process-filter, tramp-set-remote-path): Do not use `format' in `tramp-message'. * net/tramp-smb.el (tramp-smb-file-name-handler-alist) [file-notify-rm-watch, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (tramp-smb-call-winexe): Do not bind `default-directory'.
2013-08-01 13:10:31 +02:00
(set-visited-file-modtime . tramp-handle-set-visited-file-modtime)
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(shell-command . ignore)
(start-file-process . ignore)
2009-06-22 21:04:49 +00:00
(substitute-in-file-name . tramp-handle-substitute-in-file-name)
Add `make-nearby-temp-file' and `temporary-file-directory' * doc/lispref/files.texi (Unique File Names): Introduce `make-nearby-temp-file' and `temporary-file-directory'. (Magic File Names): Mention `make-nearby-temp-file' and `temporary-file-directory'. * etc/NEWS (provided): Mention `make-nearby-temp-file' and `temporary-file-directory'. * lisp/files.el (mounted-file-systems): New defcustom. (temporary-file-directory, make-nearby-temp-file): New defuns. (normal-backup-enable-predicate): Fix docstring. * 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): <make-nearby-temp-file, temporary-file-directory>: Add handler. * lisp/net/tramp.el (tramp-file-name-for-operation): Add `make-nearby-temp-file' and `temporary-file-directory'. (tramp-get-remote-tmpdir): Remove compatibility code. (tramp-handle-temporary-file-directory) (tramp-handle-make-nearby-temp-file): New defuns. * lisp/org/ob-core.el (org-babel-local-file-name): * lisp/progmodes/gud.el (gud-common-init): * lisp/vc/vc-hooks.el (vc-user-login-name): Use `file-remote-p'. * lisp/vc/vc-git.el (vc-git-checkin): Handle remote log message. * test/lisp/net/tramp-tests.el (tramp-test06-directory-file-name): Check `tramp--test-enabled'. (tramp-test18-file-attributes): Add tests for `file-ownership-preserved-p'. (tramp-test27-start-file-process, tramp-test28-shell-command): Reduce timeouts in `accept-process-output'. (tramp-test--shell-command-to-string-asynchronously): Add timeout. (tramp-test29-environment-variables): Remove additional sleep calls. (tramp-test32-make-nearby-temp-file): New test. (tramp--test-special-characters, tramp--test-utf8): Adapt docstring. (tramp-test33-special-characters) (tramp-test33-special-characters-with-stat) (tramp-test33-special-characters-with-perl) (tramp-test33-special-characters-with-ls, tramp-test34-utf8) (tramp-test34-utf8-with-stat, tramp-test34-utf8-with-perl) (tramp-test34-utf8-with-ls) (tramp-test35-asynchronous-requests) (tramp-test36-recursive-load, tramp-test37-unload): Rename. (tramp--test-ftp-p): Simplify check. (tramp--test-sh-p): New defun. (tramp-test20-file-modes, tramp-test22-file-times) (tramp-test26-process-file, tramp-test27-start-file-process) (tramp-test28-shell-command) (tramp-test29-environment-variables) (tramp-test30-vc-registered) (tramp-test33-special-characters-with-stat) (tramp-test33-special-characters-with-perl) (tramp-test33-special-characters-with-ls) (tramp-test34-utf8-with-stat, tramp-test34-utf8-with-perl) (tramp-test34-utf8-with-ls) (tramp-test35-asynchronous-requests): Use it.
2016-08-07 13:57:23 +02:00
(temporary-file-directory . tramp-handle-temporary-file-directory)
Rearrange detecting remote uid and gid in Tramp * 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-rclone.el (tramp-rclone-file-name-handler-alist): * lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist): Add `tramp-get-remote-gid' and 'tramp-get-remote-uid'. * lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler-alist): Add `file-ownership-preserved-p'. (tramp-crypt-add-directory): Check, that NAME is not quoted. (tramp-crypt-handle-file-ownership-preserved-p): New defun. (tramp-crypt-handle-insert-directory): Fix docstring. * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add `tramp-get-remote-gid' and 'tramp-get-remote-uid'. (tramp-gvfs-handle-file-readable-p): Call `tramp-get-remote-uid'. (tramp-gvfs-handle-get-remote-uid) (tramp-gvfs-handle-get-remote-gid): Rename from `tramp-gvfs-get-remote-{uid,gid}'. Do not cache result. (tramp-gvfs-maybe-open-connection): No special handling for remote uid and gid. * lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist): Add `tramp-get-remote-gid' and 'tramp-get-remote-uid'. (tramp-sh-handle-get-remote-uid, tramp-sh-handle-get-remote-gid): Rename from `tramp-get-remote-{uid,gid}'. Do not cache result. (tramp-sh-handle-file-ownership-preserved-p): Distinguish by GROUP when caching. * lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler-alist): Add `tramp-get-remote-gid' and 'tramp-get-remote-uid'. (tramp-sudoedit-handle-get-remote-uid) (tramp-sudoedit-handle-get-remote-gid): Rename from `tramp-sudoedit-get-remote-{uid,gid}'. Do not cache result. (tramp-sudoedit-handle-set-file-uid-gid) (tramp-sudoedit-handle-write-region): Call `tramp-get-remote-uid' and `tramp-get-remote-gid'. (tramp-sudoedit-maybe-open-connection): No special handling for remote uid and gid. * lisp/net/tramp.el (tramp-file-name-for-operation): Add `tramp-get-remote-gid' and 'tramp-get-remote-uid'. (tramp-handle-write-region, tramp-check-cached-permissions): Call `tramp-get-remote-uid' and `tramp-get-remote-gid'. (tramp-get-remote-uid, tramp-get-remote-gid): New defuns. (tramp-local-host-p): Simplify `tramp-get-remote-uid' call. * test/lisp/net/tramp-tests.el (tramp-test17-dired-with-wildcards) Skip if needed.
2020-06-14 15:31:17 +02:00
(tramp-get-remote-gid . tramp-gvfs-handle-get-remote-gid)
(tramp-get-remote-uid . tramp-gvfs-handle-get-remote-uid)
(tramp-set-file-uid-gid . tramp-gvfs-handle-set-file-uid-gid)
Remove XEmacs compatibility in Tramp * doc/misc/tramp.texi: Replace flags by their hard coded name. Remove unused flags and the enclosed alternative text for XEmacs. * doc/misc/trampver.texi: Use "Tramp" CamelCase. Rename "emacs" and "xemacs" flags to "unified" and "separate". Remove flags "emacsgw", "emacsname", "emacsdir", "ftppackagename", "emacsothername", "emacsotherdir" and "emacsotherfilename". (trampver): * lisp/net/trampver.el (tramp-version): Set to "2.3.0-pre". * lisp/net/tramp.el (bkup-backup-directory-info) (directory-sep-char, ls-lisp-use-insert-directory-program) (outline-regexp, tramp-backup-directory-alist) (tramp-default-method, tramp-shell-prompt-pattern, tramp-syntax) (tramp-file-name-regexp-unified) (tramp-file-name-regexp-separate) (tramp-completion-file-name-regexp-unified) (tramp-completion-file-name-regexp-separate, tramp-chunksize) (tramp-get-method-parameter, tramp-find-method, tramp-find-user) (tramp-debug-message, tramp-progress-reporter-update) (with-tramp-progress-reporter) (tramp-rfn-eshadow-setup-minibuffer) (rfn-eshadow-setup-minibuffer-hook, tramp-unload-hook) (tramp-rfn-eshadow-update-overlay) (rfn-eshadow-update-overlay-hook, tramp-default-file-modes) (tramp-file-name-for-operation) (tramp-completion-file-name-handler) (tramp-autoload-file-name-handler, tramp-completion-mode-p) (tramp-handle-directory-files) (tramp-handle-directory-files-and-attributes) (tramp-handle-dired-uncache, tramp-handle-find-backup-file-name) (tramp-handle-insert-file-contents, tramp-handle-load) (tramp-handle-shell-command) (tramp-handle-verify-visited-file-modtime) (tramp-handle-file-notify-valid-p, tramp-accept-process-output) (tramp-check-for-regexp, tramp-wait-for-regexp) (tramp-send-string, tramp-mode-string-to-int) (tramp-get-local-gid, tramp-check-cached-permissions) (tramp-get-remote-tmpdir, tramp-make-tramp-temp-file) (auto-save-file-name-transforms) (tramp-handle-make-auto-save-file-name, tramp-read-passwd) (tramp-clear-passwd, tramp-time-diff): * lisp/net/tramp-adb.el (directory-listing-before-filename-regexp) (directory-sep-char, tramp-adb-file-name-handler-alist) (tramp-adb-parse-device-names) (tramp-adb-handle-expand-file-name) (tramp-adb-handle-file-truename, tramp-adb--gnu-switches-to-ash) (tramp-adb-handle-file-local-copy) (tramp-adb-handle-write-region, tramp-adb-handle-set-file-modes) (tramp-adb-handle-rename-file, tramp-adb-handle-process-file) (tramp-adb-handle-shell-command) (tramp-adb-handle-start-file-process, tramp-adb-get-device) (tramp-adb-maybe-open-connection): * lisp/net/tramp-cache.el (tramp-persistency-file-name) (tramp-cache-print): * lisp/net/tramp-cmds.el (tramp-cleanup-all-connections) (tramp-bug, tramp-reporter-dump-variable) (tramp-load-report-modules, tramp-append-tramp-buffers): * lisp/net/tramp-compat.el (tramp-compat-funcall) (tramp-advice-file-expand-wildcards) (tramp-compat-temporary-file-directory) (tramp-compat-make-temp-file, tramp-compat-copy-file) (tramp-compat-delete-directory, ) (tramp-compat-process-running-p): * lisp/net/tramp-ftp.el (tramp-methods) <ftp>: (tramp-default-method-alist, tramp-foreign-file-name-handler-alist): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) (tramp-gvfs-do-copy-or-rename-file, tramp-gvfs-handle-copy-file) (tramp-gvfs-handle-file-local-copy) (tramp-gvfs-handle-file-name-all-completions) (tramp-gvfs-handle-file-notify-add-watch) (tramp-gvfs-monitor-file-process-filter) (tramp-gvfs-handle-file-readable-p) (tramp-gvfs-handle-rename-file, tramp-gvfs-handle-write-region) (tramp-gvfs-file-name, tramp-gvfs-handler-askquestion) (tramp-gvfs-maybe-open-connection) (tramp-gvfs-parse-device-names): * lisp/net/tramp-gw.el (tramp-gw-aux-proc-sentinel) (tramp-gw-open-connection, tramp-gw-open-network-stream): * lisp/net/tramp-sh.el (directory-sep-char) (tramp-sh-file-name-handler-alist) (tramp-sh-handle-file-truename) (tramp-sh-handle-set-visited-file-modtime) (tramp-sh-handle-verify-visited-file-modtime) (tramp-sh-handle-set-file-modes, tramp-sh-handle-set-file-times) (tramp-sh-handle-file-acl) (tramp-sh-handle-file-name-all-completions) (tramp-sh-handle-copy-file, tramp-sh-handle-rename-file) (tramp-do-copy-or-rename-file-directly) (tramp-do-copy-or-rename-file-out-of-band) (dired-compress-file-suffixes, dired-remove-file) (tramp-sh-handle-dired-compress-file) (tramp-sh-handle-insert-directory) (tramp-sh-handle-expand-file-name) (tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-sh-handle-file-local-copy) (tramp-sh-handle-write-region, tramp-sh-handle-vc-registered) (tramp-sh-handle-file-notify-add-watch) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter, tramp-maybe-send-script) (tramp-find-executable) (tramp-open-connection-setup-interactive-shell) (tramp-find-inline-encoding, tramp-compute-multi-hops) (tramp-maybe-open-connection, tramp-convert-file-attributes) (tramp-get-remote-path, tramp-get-remote-touch): * lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist) (tramp-smb-handle-copy-directory, tramp-smb-handle-copy-file) (tramp-smb-handle-delete-directory) (tramp-smb-handle-directory-files, tramp-smb-handle-file-acl) (tramp-smb-handle-make-directory-internal) (tramp-smb-handle-process-file, tramp-smb-handle-rename-file) (tramp-smb-handle-set-file-acl, tramp-smb-handle-set-file-modes) (tramp-smb-handle-write-region, tramp-smb-get-file-entries) (tramp-smb-get-cifs-capabilities) (tramp-smb-maybe-open-connection): * lisp/net/trampver.el (tramp-repository-get-version): Remove XEmacs compat code. * lisp/net/tramp-cmds.el (mml-mode, mml-insert-empty-tag) (reporter-dump-variable): Declare functions. * lisp/net/tramp.el (tramp-bkup-backup-directory-info) (tramp-advice-minibuffer-electric-separator) (tramp-advice-minibuffer-electric-tilde) (tramp-handle-unhandled-file-name-directory): * lisp/net/tramp-compat.el (tramp-compat-with-temp-message) (tramp-compat-font-lock-add-keywords) (tramp-compat-load, tramp-compat-number-sequence) (tramp-compat-split-string, tramp-compat-delete-dups): * lisp/net/tramp-sh.el (tramp-sh-handle-insert-file-contents-literally): Remove. * lisp/net/tramp-sh.el (tramp-methods) <psftp>: This does not work recursively.
2016-01-14 14:12:17 +01:00
(unhandled-file-name-directory . ignore)
2009-06-22 21:04:49 +00:00
(vc-registered . ignore)
Complete file name handlers. * net/tramp.el (tramp-handle-set-visited-file-modtime) (tramp-handle-verify-visited-file-modtime) (tramp-handle-file-notify-rm-watch): New functions. (tramp-call-process): Do not bind `default-directory'. * net/tramp-adb.el (tramp-adb-file-name-handler-alist): Order alphabetically. [access-file, add-name-to-file, dired-call-process]: [dired-compress-file, file-acl, file-notify-rm-watch]: [file-ownership-preserved-p, file-selinux-context]: [make-directory-internal, make-symbolic-link, set-file-acl]: [set-file-selinux-context, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (tramp-adb-handle-write-region): Apply `set-visited-file-modtime'. * net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) [file-notify-add-watch, file-notify-rm-watch]: [set-file-times, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (with-tramp-gvfs-error-message) (tramp-gvfs-handle-set-visited-file-modtime) (tramp-gvfs-fuse-file-name): Remove. (tramp-gvfs-handle-file-notify-add-watch) (tramp-gvfs-file-gvfs-monitor-file-process-filter): New defuns. (tramp-gvfs-handle-write-region): Fix error in moving tmpfile. * net/tramp-sh.el (tramp-sh-file-name-handler-alist): Order alphabetically. [file-notify-rm-watch ]: Use default Tramp handler. [executable-find]: Remove private handler. (tramp-do-copy-or-rename-file-out-of-band): Do not bind `default-directory'. (tramp-sh-handle-executable-find) (tramp-sh-handle-file-notify-rm-watch): Remove functions. (tramp-sh-file-gvfs-monitor-dir-process-filter) (tramp-sh-file-inotifywait-process-filter, tramp-set-remote-path): Do not use `format' in `tramp-message'. * net/tramp-smb.el (tramp-smb-file-name-handler-alist) [file-notify-rm-watch, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (tramp-smb-call-winexe): Do not bind `default-directory'.
2013-08-01 13:10:31 +02:00
(verify-visited-file-modtime . tramp-handle-verify-visited-file-modtime)
Refactor some Tramp functions * lisp/net/tramp-compat.el (tramp-compat-file-local-name): New defsubst. (tramp-compat-file-name-quoted-p, tramp-compat-file-name-quote) (tramp-compat-file-name-unquote): * lisp/net/tramp.el (tramp-handle-file-name-case-insensitive-p) (tramp-handle-file-truename, tramp-get-remote-tmpdir): * lisp/net/tramp-adb.el (tramp-adb-handle-copy-file) (tramp-adb-handle-rename-file, tramp-adb-handle-exec-path): * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-directly) (tramp-sh-handle-exec-path, tramp-find-inline-encoding) (tramp-get-remote-touch): Use it. * lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist): Use `tramp-handle-expand-file-name'. (tramp-adb-handle-expand-file-name): Move to tramp.el. (tramp-adb-handle-file-writable-p): Adapt docstring. * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Use `tramp-handle-file-local-copy', `tramp-handle-file-writable-p' and `tramp-handle-write-region'. (tramp-gvfs-handle-file-local-copy) (tramp-gvfs-handle-file-writable-p) (tramp-gvfs-handle-write-region): Move to tramp.el. * lisp/net/tramp-rclone.el: Dont't require `tramp-adb' and `tramp-gvfs' anymore. (tramp-rclone-file-name-handler-alist): Use `tramp-handle-expand-file-name', `tramp-handle-file-local-copy', `tramp-handle-file-writable-p' and `tramp-handle-write-region'. (tramp-rclone-handle-directory-files): Simplify. * lisp/net/tramp.el (tramp-methods): Extend docstring. (tramp-parse-netrc): Require `netrc'. (tramp-handle-expand-file-name, tramp-handle-file-local-copy) (tramp-handle-file-writable-p, tramp-handle-write-region): New defuns.
2018-12-07 17:21:03 +01:00
(write-region . tramp-handle-write-region))
2009-06-22 21:04:49 +00:00
"Alist of handler functions for Tramp GVFS method.
Operations not mentioned here will be handled by the default Emacs primitives.")
;; It must be a `defsubst' in order to push the whole code into
;; tramp-loaddefs.el. Otherwise, there would be recursive autoloading.
Migrate to Tramp 2.2. Rearrange load dependencies. (Bug#1529, Bug#5448, Bug#5705) * Makefile.in (TRAMP_DIR, TRAMP_SRC): New variables. ($(TRAMP_DIR)/tramp-loaddefs.el): New target. (LOADDEFS): Add $(lisp)/net/tramp-loaddefs.el. * net/tramp.el (top): Remove all other tramp-* loads except tramp-compat.el. Remove all changes to tramp-unload-hook for other tramp-* packages. Rearrange defun order. Change calls of `tramp-compat-call-process', `tramp-compat-decimal-to-octal', `tramp-compat-octal-to-decimal' to new function names. (tramp-terminal-type, tramp-initial-end-of-output) (tramp-methods, tramp-foreign-file-name-handler-alist) (tramp-tramp-file-p, tramp-completion-mode-p) (tramp-send-command-and-check, tramp-get-remote-path) (tramp-get-remote-tmpdir, tramp-get-remote-ln) (tramp-shell-quote-argument): Set tramp-autoload cookie. (with-file-property, with-connection-property): Move to tramp-cache.el. (tramp-local-call-process, tramp-decimal-to-octal) (tramp-octal-to-decimal): Move to tramp-compat.el. (tramp-handle-shell-command): Do not require 'shell. (tramp-compute-multi-hops): No special handling for tramp-gw-* symbols. (tramp-unload-tramp): Do not call `tramp-unload-file-name-handlers'. * net/tramp-cache.el (top): Require 'tramp. Add to `tramp-unload-hook'. (tramp-cache-data, 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-flush-connection-property) (tramp-cache-print, tramp-list-connections): Set tramp-autoload cookie. (with-file-property, with-connection-property): New defuns, moved from tramp.el. (tramp-flush-file-function): Use `with-parsed-tramp-file-name' macro. * net/tramp-cmds.el (top): Add to `tramp-unload-hook'. (tramp-version): Set tramp-autoload cookie. * net/tramp-compat.el (top): Require 'tramp-loaddefs. Remove all changes to tramp-unload-hook for other tramp-* packages. Add to `tramp-unload-hook'. (tramp-compat-decimal-to-octal, tramp-compat-octal-to-decimal) (tramp-compat-call-process): New defuns, moved from tramp.el. * net/tramp-fish.el (top) Require just 'tramp. Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. Change call of `tramp-compat-decimal-to-octal' to new function name. (tramp-fish-method): Make it a defconst. (tramp-fish-file-name-p): Make it a defsubst. (tramp-fish-method, tramp-fish-file-name-handler) (tramp-fish-file-name-p): Set tramp-autoload cookie. * net/tramp-ftp.el (top) Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. (tramp-ftp-method): Make it a defconst. (tramp-ftp-file-name-p): Make it a defsubst. (tramp-ftp-method, tramp-ftp-file-name-handler) (tramp-ftp-file-name-p): Set tramp-autoload cookie. * net/tramp-gvfs.el (top) Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. Change checks, whether package can be loaded. (tramp-gvfs-file-name-p): Make it a defsubst. (tramp-gvfs-methods, tramp-gvfs-file-name-handler) (tramp-gvfs-file-name-p): Set tramp-autoload cookie. (tramp-gvfs-handle-file-directory-p): New defun. (tramp-gvfs-file-name-handler-alist): Use it. * net/tramp-gw.el (top) Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. (tramp-gw-tunnel-method, tramp-gw-default-tunnel-port) (tramp-gw-socks-method, tramp-gw-default-socks-port): Make it a defconst. (tramp-gw-tunnel-method, tramp-gw-socks-method) (tramp-gw-open-connection): Set tramp-autoload cookie. * net/tramp-imap.el (top) Require just 'tramp. Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. Change checks, whether package can be loaded. (tramp-imap-file-name-p): Make it a defsubst. (tramp-imap-method, tramp-imaps-method) (tramp-imap-file-name-handler) (tramp-imap-file-name-p): Set tramp-autoload cookie. * net/tramp-smb.el (top) Require just 'tramp. Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. Change checks, whether package can be loaded. Change call of `tramp-compat-decimal-to-octal' to new function name. (tramp-smb-tunnel-method): Make it a defconst. (tramp-smb-file-name-p): Make it a defsubst. (tramp-smb-method, tramp-smb-file-name-handler) (tramp-smb-file-name-p): Set tramp-autoload cookie. * net/tramp-uu.el (top) Add to `tramp-unload-hook'. (tramp-uuencode-region): Set tramp-autoload cookie. * net/trampver.el (top) Add to `tramp-unload-hook'. (tramp-version, tramp-bug-report-address): Set tramp-autoload cookie. Update release number.
2010-09-08 16:42:54 +02:00
;;;###tramp-autoload
(defsubst tramp-gvfs-file-name-p (filename)
Adapt Tramp docstrings according to checkdoc * lisp/net/tramp.el (tramp-backup-directory-alist) (tramp-echoed-echo-mark-regexp, tramp-syntax-values) (tramp-lookup-syntax, 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-unknown-id-string) (tramp-unknown-id-integer, tramp-build-file-name-regexp) (tramp-build-completion-file-name-regexp, tramp-chunksize) (tramp-find-method, tramp-find-user, tramp-find-host) (tramp-dissect-file-name, tramp-get-buffer) (tramp-get-connection-buffer, tramp-debug-message, tramp-error) (with-tramp-connection-property, tramp-run-real-handler) (tramp-file-name-for-operation, tramp-file-name-handler) (tramp-completion-file-name-handler) (tramp-completion-handle-file-name-completion) (tramp-completion-dissect-file-name) (tramp-completion-dissect-file-name1) (tramp-handle-file-name-as-directory) (tramp-handle-file-name-directory) (tramp-handle-file-name-nondirectory, tramp-mode-string-to-int) (tramp-file-mode-from-int): * lisp/net/tramp-adb.el (tramp-adb-file-name-p): * lisp/net/tramp-archive.el (tramp-archive-run-real-handler) (tramp-archive-file-name-handler) (tramp-archive-dissect-file-name) (with-parsed-tramp-archive-file-name) (tramp-archive-gvfs-file-name, tramp-archive-handle-access-file): * lisp/net/tramp-cmds.el (tramp-list-remote-buffers): * lisp/net/tramp-compat.el (tramp-unload-file-name-handlers) (tramp-compat-funcall, tramp-compat-tramp-file-name-slots): * lisp/net/tramp-ftp.el (tramp-ftp-file-name-handler) (tramp-ftp-file-name-p): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-p) (tramp-gvfs-file-name-handler) (tramp-gvfs-stringify-dbus-message) (tramp-gvfs-monitor-process-filter) (tramp-gvfs-handler-mounted-unmounted): * lisp/net/tramp-integration.el (tramp-rfn-eshadow-update-overlay-regexp): * lisp/net/tramp-rclone.el (tramp-rclone-file-name-p) (tramp-rclone-file-name-handler, tramp-rclone-send-command): * lisp/net/tramp-sh.el (tramp-sh--quoting-style-options) (tramp-sh-gio-monitor-process-filter) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter, tramp-find-executable) (tramp-set-remote-path, tramp-open-shell, tramp-find-shell) (tramp-send-command-and-check, tramp-shell-case-fold) (tramp-get-remote-path): * lisp/net/tramp-smb.el (tramp-smb-file-name-p) (tramp-smb-file-name-handler) (tramp-smb-do-file-attributes-with-stat) (tramp-smb-handle-substitute-in-file-name) (tramp-smb-get-stat-capability, tramp-smb-shell-quote-argument): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-p) (tramp-sudoedit-file-name-handler) (tramp-sudoedit-send-command-string): * test/lisp/net/tramp-archive-tests.el (tramp-archive-test-all): * test/lisp/net/tramp-tests.el (tramp--test-gvfs-p) (tramp--test-with-proper-process-name-and-buffer) (tramp-test-all): Adapt docstrings according to `checkdoc'.
2019-11-13 13:10:58 +01:00
"Check if it's a FILENAME handled by the GVFS daemon."
2009-06-22 21:04:49 +00:00
(and (tramp-tramp-file-p filename)
(let ((method
(tramp-file-name-method (tramp-dissect-file-name filename))))
(and (stringp method) (member method tramp-gvfs-methods)))))
Migrate to Tramp 2.2. Rearrange load dependencies. (Bug#1529, Bug#5448, Bug#5705) * Makefile.in (TRAMP_DIR, TRAMP_SRC): New variables. ($(TRAMP_DIR)/tramp-loaddefs.el): New target. (LOADDEFS): Add $(lisp)/net/tramp-loaddefs.el. * net/tramp.el (top): Remove all other tramp-* loads except tramp-compat.el. Remove all changes to tramp-unload-hook for other tramp-* packages. Rearrange defun order. Change calls of `tramp-compat-call-process', `tramp-compat-decimal-to-octal', `tramp-compat-octal-to-decimal' to new function names. (tramp-terminal-type, tramp-initial-end-of-output) (tramp-methods, tramp-foreign-file-name-handler-alist) (tramp-tramp-file-p, tramp-completion-mode-p) (tramp-send-command-and-check, tramp-get-remote-path) (tramp-get-remote-tmpdir, tramp-get-remote-ln) (tramp-shell-quote-argument): Set tramp-autoload cookie. (with-file-property, with-connection-property): Move to tramp-cache.el. (tramp-local-call-process, tramp-decimal-to-octal) (tramp-octal-to-decimal): Move to tramp-compat.el. (tramp-handle-shell-command): Do not require 'shell. (tramp-compute-multi-hops): No special handling for tramp-gw-* symbols. (tramp-unload-tramp): Do not call `tramp-unload-file-name-handlers'. * net/tramp-cache.el (top): Require 'tramp. Add to `tramp-unload-hook'. (tramp-cache-data, 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-flush-connection-property) (tramp-cache-print, tramp-list-connections): Set tramp-autoload cookie. (with-file-property, with-connection-property): New defuns, moved from tramp.el. (tramp-flush-file-function): Use `with-parsed-tramp-file-name' macro. * net/tramp-cmds.el (top): Add to `tramp-unload-hook'. (tramp-version): Set tramp-autoload cookie. * net/tramp-compat.el (top): Require 'tramp-loaddefs. Remove all changes to tramp-unload-hook for other tramp-* packages. Add to `tramp-unload-hook'. (tramp-compat-decimal-to-octal, tramp-compat-octal-to-decimal) (tramp-compat-call-process): New defuns, moved from tramp.el. * net/tramp-fish.el (top) Require just 'tramp. Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. Change call of `tramp-compat-decimal-to-octal' to new function name. (tramp-fish-method): Make it a defconst. (tramp-fish-file-name-p): Make it a defsubst. (tramp-fish-method, tramp-fish-file-name-handler) (tramp-fish-file-name-p): Set tramp-autoload cookie. * net/tramp-ftp.el (top) Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. (tramp-ftp-method): Make it a defconst. (tramp-ftp-file-name-p): Make it a defsubst. (tramp-ftp-method, tramp-ftp-file-name-handler) (tramp-ftp-file-name-p): Set tramp-autoload cookie. * net/tramp-gvfs.el (top) Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. Change checks, whether package can be loaded. (tramp-gvfs-file-name-p): Make it a defsubst. (tramp-gvfs-methods, tramp-gvfs-file-name-handler) (tramp-gvfs-file-name-p): Set tramp-autoload cookie. (tramp-gvfs-handle-file-directory-p): New defun. (tramp-gvfs-file-name-handler-alist): Use it. * net/tramp-gw.el (top) Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. (tramp-gw-tunnel-method, tramp-gw-default-tunnel-port) (tramp-gw-socks-method, tramp-gw-default-socks-port): Make it a defconst. (tramp-gw-tunnel-method, tramp-gw-socks-method) (tramp-gw-open-connection): Set tramp-autoload cookie. * net/tramp-imap.el (top) Require just 'tramp. Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. Change checks, whether package can be loaded. (tramp-imap-file-name-p): Make it a defsubst. (tramp-imap-method, tramp-imaps-method) (tramp-imap-file-name-handler) (tramp-imap-file-name-p): Set tramp-autoload cookie. * net/tramp-smb.el (top) Require just 'tramp. Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. Change checks, whether package can be loaded. Change call of `tramp-compat-decimal-to-octal' to new function name. (tramp-smb-tunnel-method): Make it a defconst. (tramp-smb-file-name-p): Make it a defsubst. (tramp-smb-method, tramp-smb-file-name-handler) (tramp-smb-file-name-p): Set tramp-autoload cookie. * net/tramp-uu.el (top) Add to `tramp-unload-hook'. (tramp-uuencode-region): Set tramp-autoload cookie. * net/trampver.el (top) Add to `tramp-unload-hook'. (tramp-version, tramp-bug-report-address): Set tramp-autoload cookie. Update release number.
2010-09-08 16:42:54 +02:00
;;;###tramp-autoload
2009-06-22 21:04:49 +00:00
(defun tramp-gvfs-file-name-handler (operation &rest args)
Adapt Tramp docstrings according to checkdoc * lisp/net/tramp.el (tramp-backup-directory-alist) (tramp-echoed-echo-mark-regexp, tramp-syntax-values) (tramp-lookup-syntax, 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-unknown-id-string) (tramp-unknown-id-integer, tramp-build-file-name-regexp) (tramp-build-completion-file-name-regexp, tramp-chunksize) (tramp-find-method, tramp-find-user, tramp-find-host) (tramp-dissect-file-name, tramp-get-buffer) (tramp-get-connection-buffer, tramp-debug-message, tramp-error) (with-tramp-connection-property, tramp-run-real-handler) (tramp-file-name-for-operation, tramp-file-name-handler) (tramp-completion-file-name-handler) (tramp-completion-handle-file-name-completion) (tramp-completion-dissect-file-name) (tramp-completion-dissect-file-name1) (tramp-handle-file-name-as-directory) (tramp-handle-file-name-directory) (tramp-handle-file-name-nondirectory, tramp-mode-string-to-int) (tramp-file-mode-from-int): * lisp/net/tramp-adb.el (tramp-adb-file-name-p): * lisp/net/tramp-archive.el (tramp-archive-run-real-handler) (tramp-archive-file-name-handler) (tramp-archive-dissect-file-name) (with-parsed-tramp-archive-file-name) (tramp-archive-gvfs-file-name, tramp-archive-handle-access-file): * lisp/net/tramp-cmds.el (tramp-list-remote-buffers): * lisp/net/tramp-compat.el (tramp-unload-file-name-handlers) (tramp-compat-funcall, tramp-compat-tramp-file-name-slots): * lisp/net/tramp-ftp.el (tramp-ftp-file-name-handler) (tramp-ftp-file-name-p): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-p) (tramp-gvfs-file-name-handler) (tramp-gvfs-stringify-dbus-message) (tramp-gvfs-monitor-process-filter) (tramp-gvfs-handler-mounted-unmounted): * lisp/net/tramp-integration.el (tramp-rfn-eshadow-update-overlay-regexp): * lisp/net/tramp-rclone.el (tramp-rclone-file-name-p) (tramp-rclone-file-name-handler, tramp-rclone-send-command): * lisp/net/tramp-sh.el (tramp-sh--quoting-style-options) (tramp-sh-gio-monitor-process-filter) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter, tramp-find-executable) (tramp-set-remote-path, tramp-open-shell, tramp-find-shell) (tramp-send-command-and-check, tramp-shell-case-fold) (tramp-get-remote-path): * lisp/net/tramp-smb.el (tramp-smb-file-name-p) (tramp-smb-file-name-handler) (tramp-smb-do-file-attributes-with-stat) (tramp-smb-handle-substitute-in-file-name) (tramp-smb-get-stat-capability, tramp-smb-shell-quote-argument): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-p) (tramp-sudoedit-file-name-handler) (tramp-sudoedit-send-command-string): * test/lisp/net/tramp-archive-tests.el (tramp-archive-test-all): * test/lisp/net/tramp-tests.el (tramp--test-gvfs-p) (tramp--test-with-proper-process-name-and-buffer) (tramp-test-all): Adapt docstrings according to `checkdoc'.
2019-11-13 13:10:58 +01:00
"Invoke the GVFS related OPERATION and ARGS.
2009-06-22 21:04:49 +00:00
First arg specifies the OPERATION, second arg is a list of arguments to
pass to the OPERATION."
(unless tramp-gvfs-enabled
(tramp-user-error nil "Package `tramp-gvfs' not supported"))
Sync with Tramp 2.5.0-pre * doc/misc/tramp.texi: Protext Tramp x.y and Emacs x.y by @w{}. (GVFS-based methods): Move "GNOME Online Accounts" index. (Customizing Methods, Android shell setup, File name completion) (Frequently Asked Questions): Fix typos. * doc/misc/trampver.texi: Change version to "2.5.0-pre". * lisp/net/trampver.el: Change version to "2.5.0-pre". (inhibit-message): Don't declare. * lisp/net/tramp.el: Bump version to 2.5.0-pre. Require Emacs 25.1. (tramp-debug-message): Simplify. (tramp-message): Don't use `tramp-message-show-message'. (tramp-with-demoted-errors, with-parsed-tramp-file-name) (with-tramp-file-property, with-tramp-connection-property): Adapt `declare' form. (with-tramp-progress-reporter): Suppress progress reporter when noninteractive. (tramp-completion-mode, tramp-completion-mode-p): Remove. * lisp/net/tramp-compat.el (tramp-compat-process-running-p) (format-message): Remove compatibility code. (tramp-compat-directory-name-p) (tramp-compat-tramp-file-name-slots): Remove. * lisp/net/tramp.el (tramp-debug-message, tramp-message) (tramp-backtrace, tramp-error, tramp-error-with-buffer) (tramp-user-error, tramp-with-demoted-errors) (tramp-signal-hook-function): * lisp/net/tramp-compat.el (tramp-compat-funcall) * lisp/net/tramp-gvfs.el (tramp-dbus-function): Add `tramp-suppress-trace' property. * lisp/net/tramp.el (tramp-get-method-parameter) (tramp-dissect-file-name, tramp-error, tramp-error-with-buffer) (tramp-user-error, with-parsed-tramp-file-name) (with-tramp-progress-reporter, tramp-file-name-handler) (tramp-completion-file-name-handler, tramp-autoload-file-name-handler) (tramp-register-file-name-handlers, tramp-connectable-p) (tramp-handle-file-modes, tramp-handle-file-regular-p) (tramp-handle-file-truename, tramp-handle-insert-directory) (tramp-handle-load, tramp-set-file-uid-gid): * lisp/net/tramp-adb.el (tramp-adb-file-name-handler) (tramp-adb-handle-file-truename, tramp-adb-handle-copy-file) (tramp-adb-handle-rename-file): * lisp/net/tramp-archive.el (with-parsed-tramp-archive-file-name): * lisp/net/tramp-cache.el (tramp-get-file-property, tramp-cache-print): * lisp/net/tramp-compat.el (tramp-compat-process-running-p) (tramp-compat-exec-path): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler) (tramp-gvfs-dbus-byte-array-to-string) (tramp-gvfs-do-copy-or-rename-file): * lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler) (tramp-rclone-do-copy-or-rename-file): * lisp/net/tramp-sh.el (tramp-sh-handle-file-truename) (tramp-sh-handle-copy-directory, tramp-do-copy-or-rename-file) (tramp-sh-handle-insert-directory, tramp-sh-file-name-handler) (tramp-maybe-open-connection): * lisp/net/tramp-smb.el (tramp-smb-file-name-handler) (tramp-smb-handle-copy-file, tramp-smb-handle-copy-directory) (tramp-smb-handle-copy-file, tramp-smb-handle-insert-directory) (tramp-smb-handle-rename-file, tramp-smb-maybe-open-connection): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler) (tramp-sudoedit-do-copy-or-rename-file) (tramp-sudoedit-handle-file-truename): Use `if-let', `when-let', `directory-name-p', `inhibit-message', `non-essential and `cl-struct-slot-info'. Don't use `seconds-to-time'. * test/lisp/net/tramp-archive-tests.el (tramp-message-show-message): Don't set. * test/lisp/net/tramp-tests.el (inhibit-message): Don't declare. (tramp-message-show-message): Don't set. (tramp-test06-directory-file-name): Use `non-essential'. (tramp-test10-write-region): Use `inhibit-message'. (tramp-test36-vc-registered): No special handling for old Emacsen. (tramp--test-emacs25-p): Remove. (tramp-test45-unload): Special case of `tramp-completion-mode'.
2020-01-19 14:11:07 +01:00
(if-let ((fn (assoc operation tramp-gvfs-file-name-handler-alist)))
(save-match-data (apply (cdr fn) args))
(tramp-run-real-handler operation args)))
2009-06-22 21:04:49 +00:00
Migrate to Tramp 2.2. Rearrange load dependencies. (Bug#1529, Bug#5448, Bug#5705) * Makefile.in (TRAMP_DIR, TRAMP_SRC): New variables. ($(TRAMP_DIR)/tramp-loaddefs.el): New target. (LOADDEFS): Add $(lisp)/net/tramp-loaddefs.el. * net/tramp.el (top): Remove all other tramp-* loads except tramp-compat.el. Remove all changes to tramp-unload-hook for other tramp-* packages. Rearrange defun order. Change calls of `tramp-compat-call-process', `tramp-compat-decimal-to-octal', `tramp-compat-octal-to-decimal' to new function names. (tramp-terminal-type, tramp-initial-end-of-output) (tramp-methods, tramp-foreign-file-name-handler-alist) (tramp-tramp-file-p, tramp-completion-mode-p) (tramp-send-command-and-check, tramp-get-remote-path) (tramp-get-remote-tmpdir, tramp-get-remote-ln) (tramp-shell-quote-argument): Set tramp-autoload cookie. (with-file-property, with-connection-property): Move to tramp-cache.el. (tramp-local-call-process, tramp-decimal-to-octal) (tramp-octal-to-decimal): Move to tramp-compat.el. (tramp-handle-shell-command): Do not require 'shell. (tramp-compute-multi-hops): No special handling for tramp-gw-* symbols. (tramp-unload-tramp): Do not call `tramp-unload-file-name-handlers'. * net/tramp-cache.el (top): Require 'tramp. Add to `tramp-unload-hook'. (tramp-cache-data, 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-flush-connection-property) (tramp-cache-print, tramp-list-connections): Set tramp-autoload cookie. (with-file-property, with-connection-property): New defuns, moved from tramp.el. (tramp-flush-file-function): Use `with-parsed-tramp-file-name' macro. * net/tramp-cmds.el (top): Add to `tramp-unload-hook'. (tramp-version): Set tramp-autoload cookie. * net/tramp-compat.el (top): Require 'tramp-loaddefs. Remove all changes to tramp-unload-hook for other tramp-* packages. Add to `tramp-unload-hook'. (tramp-compat-decimal-to-octal, tramp-compat-octal-to-decimal) (tramp-compat-call-process): New defuns, moved from tramp.el. * net/tramp-fish.el (top) Require just 'tramp. Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. Change call of `tramp-compat-decimal-to-octal' to new function name. (tramp-fish-method): Make it a defconst. (tramp-fish-file-name-p): Make it a defsubst. (tramp-fish-method, tramp-fish-file-name-handler) (tramp-fish-file-name-p): Set tramp-autoload cookie. * net/tramp-ftp.el (top) Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. (tramp-ftp-method): Make it a defconst. (tramp-ftp-file-name-p): Make it a defsubst. (tramp-ftp-method, tramp-ftp-file-name-handler) (tramp-ftp-file-name-p): Set tramp-autoload cookie. * net/tramp-gvfs.el (top) Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. Change checks, whether package can be loaded. (tramp-gvfs-file-name-p): Make it a defsubst. (tramp-gvfs-methods, tramp-gvfs-file-name-handler) (tramp-gvfs-file-name-p): Set tramp-autoload cookie. (tramp-gvfs-handle-file-directory-p): New defun. (tramp-gvfs-file-name-handler-alist): Use it. * net/tramp-gw.el (top) Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. (tramp-gw-tunnel-method, tramp-gw-default-tunnel-port) (tramp-gw-socks-method, tramp-gw-default-socks-port): Make it a defconst. (tramp-gw-tunnel-method, tramp-gw-socks-method) (tramp-gw-open-connection): Set tramp-autoload cookie. * net/tramp-imap.el (top) Require just 'tramp. Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. Change checks, whether package can be loaded. (tramp-imap-file-name-p): Make it a defsubst. (tramp-imap-method, tramp-imaps-method) (tramp-imap-file-name-handler) (tramp-imap-file-name-p): Set tramp-autoload cookie. * net/tramp-smb.el (top) Require just 'tramp. Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. Change checks, whether package can be loaded. Change call of `tramp-compat-decimal-to-octal' to new function name. (tramp-smb-tunnel-method): Make it a defconst. (tramp-smb-file-name-p): Make it a defsubst. (tramp-smb-method, tramp-smb-file-name-handler) (tramp-smb-file-name-p): Set tramp-autoload cookie. * net/tramp-uu.el (top) Add to `tramp-unload-hook'. (tramp-uuencode-region): Set tramp-autoload cookie. * net/trampver.el (top) Add to `tramp-unload-hook'. (tramp-version, tramp-bug-report-address): Set tramp-autoload cookie. Update release number.
2010-09-08 16:42:54 +02:00
;;;###tramp-autoload
(when (featurep 'dbusbind)
* lisp/net/tramp: Rework mutual dependencies Functionally split tramp-loaddefs.el into two parts: one part run while loading it at the very beginning of loading tramp.el (holding plain autoloads and declarations), and another run at the very end of loading tramp.el (holding setup code). This should reduce infinite-recursion problems while loading. * lisp/net/tramp.el: Require tramp-loaddefs at beginning. Run (new and internal) tramp--startup-hook at the end. Remove all tramp-autoloads. Prefer tramp--with-startup over eval-after-load. (tramp--with-startup): New macro. (tramp-set-syntax): Show the new value rather than the old value in the error message. (tramp-syntax-values): Explicitly return 'values'. (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-completion-file-name-regexp): Don't initialize in the declaration, since it's recomputed at the end anyway. (tramp-time-dont-know, tramp-time-doesnt-exist): Move before first use. * lisp/net/tramp-compat.el: Don't require tramp-loaddefs any more. (tramp-compat-tramp-syntax): Declare tramp-syntax. * lisp/net/tramp-smb.el: * lisp/net/tramp-rclone.el: * lisp/net/tramp-gvfs.el: * lisp/net/tramp-ftp.el: * lisp/net/tramp-adb.el: Wrap all autoloaded setup operations within tramp--with-startup. * lisp/net/tramp-sh.el: Wrap all autoloaded setup operations within tramp--with-startup. (tramp-display-escape-sequence-regexp) (tramp-device-escape-sequence-regexp): Don't tramp-autoload any more. (tramp-stat-marker): Use eval-and-compile rather than tramp-autoload. * lisp/net/tramp-sudoedit.el: Wrap all autoloaded setup operations within tramp--with-startup. Require tramp-sh at compile-time to precompute some regexps based on tramp-stat-marker.
2018-12-16 10:32:53 -05:00
(tramp--with-startup
(tramp-register-foreign-file-name-handler
#'tramp-gvfs-file-name-p #'tramp-gvfs-file-name-handler)))
2009-06-22 21:04:49 +00:00
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
;; D-Bus helper function.
(defun tramp-gvfs-dbus-string-to-byte-array (string)
"Like `dbus-string-to-byte-array' but add trailing \\0 if needed."
(dbus-string-to-byte-array
(if (string-match-p "^(aya{sv})" tramp-gvfs-mountlocation-signature)
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(concat string (string 0)) string)))
(defun tramp-gvfs-dbus-byte-array-to-string (byte-array)
"Like `dbus-byte-array-to-string' but remove trailing \\0 if exists.
Return nil for null BYTE-ARRAY."
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
;; The byte array could be a variant. Take care.
Sync with Tramp 2.5.0-pre * doc/misc/tramp.texi: Protext Tramp x.y and Emacs x.y by @w{}. (GVFS-based methods): Move "GNOME Online Accounts" index. (Customizing Methods, Android shell setup, File name completion) (Frequently Asked Questions): Fix typos. * doc/misc/trampver.texi: Change version to "2.5.0-pre". * lisp/net/trampver.el: Change version to "2.5.0-pre". (inhibit-message): Don't declare. * lisp/net/tramp.el: Bump version to 2.5.0-pre. Require Emacs 25.1. (tramp-debug-message): Simplify. (tramp-message): Don't use `tramp-message-show-message'. (tramp-with-demoted-errors, with-parsed-tramp-file-name) (with-tramp-file-property, with-tramp-connection-property): Adapt `declare' form. (with-tramp-progress-reporter): Suppress progress reporter when noninteractive. (tramp-completion-mode, tramp-completion-mode-p): Remove. * lisp/net/tramp-compat.el (tramp-compat-process-running-p) (format-message): Remove compatibility code. (tramp-compat-directory-name-p) (tramp-compat-tramp-file-name-slots): Remove. * lisp/net/tramp.el (tramp-debug-message, tramp-message) (tramp-backtrace, tramp-error, tramp-error-with-buffer) (tramp-user-error, tramp-with-demoted-errors) (tramp-signal-hook-function): * lisp/net/tramp-compat.el (tramp-compat-funcall) * lisp/net/tramp-gvfs.el (tramp-dbus-function): Add `tramp-suppress-trace' property. * lisp/net/tramp.el (tramp-get-method-parameter) (tramp-dissect-file-name, tramp-error, tramp-error-with-buffer) (tramp-user-error, with-parsed-tramp-file-name) (with-tramp-progress-reporter, tramp-file-name-handler) (tramp-completion-file-name-handler, tramp-autoload-file-name-handler) (tramp-register-file-name-handlers, tramp-connectable-p) (tramp-handle-file-modes, tramp-handle-file-regular-p) (tramp-handle-file-truename, tramp-handle-insert-directory) (tramp-handle-load, tramp-set-file-uid-gid): * lisp/net/tramp-adb.el (tramp-adb-file-name-handler) (tramp-adb-handle-file-truename, tramp-adb-handle-copy-file) (tramp-adb-handle-rename-file): * lisp/net/tramp-archive.el (with-parsed-tramp-archive-file-name): * lisp/net/tramp-cache.el (tramp-get-file-property, tramp-cache-print): * lisp/net/tramp-compat.el (tramp-compat-process-running-p) (tramp-compat-exec-path): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler) (tramp-gvfs-dbus-byte-array-to-string) (tramp-gvfs-do-copy-or-rename-file): * lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler) (tramp-rclone-do-copy-or-rename-file): * lisp/net/tramp-sh.el (tramp-sh-handle-file-truename) (tramp-sh-handle-copy-directory, tramp-do-copy-or-rename-file) (tramp-sh-handle-insert-directory, tramp-sh-file-name-handler) (tramp-maybe-open-connection): * lisp/net/tramp-smb.el (tramp-smb-file-name-handler) (tramp-smb-handle-copy-file, tramp-smb-handle-copy-directory) (tramp-smb-handle-copy-file, tramp-smb-handle-insert-directory) (tramp-smb-handle-rename-file, tramp-smb-maybe-open-connection): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler) (tramp-sudoedit-do-copy-or-rename-file) (tramp-sudoedit-handle-file-truename): Use `if-let', `when-let', `directory-name-p', `inhibit-message', `non-essential and `cl-struct-slot-info'. Don't use `seconds-to-time'. * test/lisp/net/tramp-archive-tests.el (tramp-message-show-message): Don't set. * test/lisp/net/tramp-tests.el (inhibit-message): Don't declare. (tramp-message-show-message): Don't set. (tramp-test06-directory-file-name): Use `non-essential'. (tramp-test10-write-region): Use `inhibit-message'. (tramp-test36-vc-registered): No special handling for old Emacsen. (tramp--test-emacs25-p): Remove. (tramp-test45-unload): Special case of `tramp-completion-mode'.
2020-01-19 14:11:07 +01:00
(when-let ((byte-array
(if (and (consp byte-array) (atom (car byte-array)))
byte-array (car byte-array))))
(dbus-byte-array-to-string
(if (and (consp byte-array) (zerop (car (last byte-array))))
(butlast byte-array) byte-array))))
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(defun tramp-gvfs-stringify-dbus-message (message)
Adapt Tramp docstrings according to checkdoc * lisp/net/tramp.el (tramp-backup-directory-alist) (tramp-echoed-echo-mark-regexp, tramp-syntax-values) (tramp-lookup-syntax, 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-unknown-id-string) (tramp-unknown-id-integer, tramp-build-file-name-regexp) (tramp-build-completion-file-name-regexp, tramp-chunksize) (tramp-find-method, tramp-find-user, tramp-find-host) (tramp-dissect-file-name, tramp-get-buffer) (tramp-get-connection-buffer, tramp-debug-message, tramp-error) (with-tramp-connection-property, tramp-run-real-handler) (tramp-file-name-for-operation, tramp-file-name-handler) (tramp-completion-file-name-handler) (tramp-completion-handle-file-name-completion) (tramp-completion-dissect-file-name) (tramp-completion-dissect-file-name1) (tramp-handle-file-name-as-directory) (tramp-handle-file-name-directory) (tramp-handle-file-name-nondirectory, tramp-mode-string-to-int) (tramp-file-mode-from-int): * lisp/net/tramp-adb.el (tramp-adb-file-name-p): * lisp/net/tramp-archive.el (tramp-archive-run-real-handler) (tramp-archive-file-name-handler) (tramp-archive-dissect-file-name) (with-parsed-tramp-archive-file-name) (tramp-archive-gvfs-file-name, tramp-archive-handle-access-file): * lisp/net/tramp-cmds.el (tramp-list-remote-buffers): * lisp/net/tramp-compat.el (tramp-unload-file-name-handlers) (tramp-compat-funcall, tramp-compat-tramp-file-name-slots): * lisp/net/tramp-ftp.el (tramp-ftp-file-name-handler) (tramp-ftp-file-name-p): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-p) (tramp-gvfs-file-name-handler) (tramp-gvfs-stringify-dbus-message) (tramp-gvfs-monitor-process-filter) (tramp-gvfs-handler-mounted-unmounted): * lisp/net/tramp-integration.el (tramp-rfn-eshadow-update-overlay-regexp): * lisp/net/tramp-rclone.el (tramp-rclone-file-name-p) (tramp-rclone-file-name-handler, tramp-rclone-send-command): * lisp/net/tramp-sh.el (tramp-sh--quoting-style-options) (tramp-sh-gio-monitor-process-filter) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter, tramp-find-executable) (tramp-set-remote-path, tramp-open-shell, tramp-find-shell) (tramp-send-command-and-check, tramp-shell-case-fold) (tramp-get-remote-path): * lisp/net/tramp-smb.el (tramp-smb-file-name-p) (tramp-smb-file-name-handler) (tramp-smb-do-file-attributes-with-stat) (tramp-smb-handle-substitute-in-file-name) (tramp-smb-get-stat-capability, tramp-smb-shell-quote-argument): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-p) (tramp-sudoedit-file-name-handler) (tramp-sudoedit-send-command-string): * test/lisp/net/tramp-archive-tests.el (tramp-archive-test-all): * test/lisp/net/tramp-tests.el (tramp--test-gvfs-p) (tramp--test-with-proper-process-name-and-buffer) (tramp-test-all): Adapt docstrings according to `checkdoc'.
2019-11-13 13:10:58 +01:00
"Convert a D-Bus MESSAGE into readable UTF8 strings, used for traces."
(cond
((and (consp message) (characterp (car message)))
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(format "%S" (tramp-gvfs-dbus-byte-array-to-string message)))
((and (consp message) (atom (cdr message)))
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
(cons (tramp-gvfs-stringify-dbus-message (car message))
(tramp-gvfs-stringify-dbus-message (cdr message))))
((consp message)
(mapcar #'tramp-gvfs-stringify-dbus-message message))
((stringp message)
(format "%S" message))
(t message)))
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
(defun tramp-dbus-function (vec func args)
"Apply a D-Bus function FUNC from dbus.el.
The call will be traced by Tramp with trace level 6."
(let (result)
(tramp-message vec 6 "%s" (cons func args))
(setq result (apply func args))
(tramp-message vec 6 "%s" result(tramp-gvfs-stringify-dbus-message result))
result))
Sync with Tramp 2.5.0-pre * doc/misc/tramp.texi: Protext Tramp x.y and Emacs x.y by @w{}. (GVFS-based methods): Move "GNOME Online Accounts" index. (Customizing Methods, Android shell setup, File name completion) (Frequently Asked Questions): Fix typos. * doc/misc/trampver.texi: Change version to "2.5.0-pre". * lisp/net/trampver.el: Change version to "2.5.0-pre". (inhibit-message): Don't declare. * lisp/net/tramp.el: Bump version to 2.5.0-pre. Require Emacs 25.1. (tramp-debug-message): Simplify. (tramp-message): Don't use `tramp-message-show-message'. (tramp-with-demoted-errors, with-parsed-tramp-file-name) (with-tramp-file-property, with-tramp-connection-property): Adapt `declare' form. (with-tramp-progress-reporter): Suppress progress reporter when noninteractive. (tramp-completion-mode, tramp-completion-mode-p): Remove. * lisp/net/tramp-compat.el (tramp-compat-process-running-p) (format-message): Remove compatibility code. (tramp-compat-directory-name-p) (tramp-compat-tramp-file-name-slots): Remove. * lisp/net/tramp.el (tramp-debug-message, tramp-message) (tramp-backtrace, tramp-error, tramp-error-with-buffer) (tramp-user-error, tramp-with-demoted-errors) (tramp-signal-hook-function): * lisp/net/tramp-compat.el (tramp-compat-funcall) * lisp/net/tramp-gvfs.el (tramp-dbus-function): Add `tramp-suppress-trace' property. * lisp/net/tramp.el (tramp-get-method-parameter) (tramp-dissect-file-name, tramp-error, tramp-error-with-buffer) (tramp-user-error, with-parsed-tramp-file-name) (with-tramp-progress-reporter, tramp-file-name-handler) (tramp-completion-file-name-handler, tramp-autoload-file-name-handler) (tramp-register-file-name-handlers, tramp-connectable-p) (tramp-handle-file-modes, tramp-handle-file-regular-p) (tramp-handle-file-truename, tramp-handle-insert-directory) (tramp-handle-load, tramp-set-file-uid-gid): * lisp/net/tramp-adb.el (tramp-adb-file-name-handler) (tramp-adb-handle-file-truename, tramp-adb-handle-copy-file) (tramp-adb-handle-rename-file): * lisp/net/tramp-archive.el (with-parsed-tramp-archive-file-name): * lisp/net/tramp-cache.el (tramp-get-file-property, tramp-cache-print): * lisp/net/tramp-compat.el (tramp-compat-process-running-p) (tramp-compat-exec-path): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler) (tramp-gvfs-dbus-byte-array-to-string) (tramp-gvfs-do-copy-or-rename-file): * lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler) (tramp-rclone-do-copy-or-rename-file): * lisp/net/tramp-sh.el (tramp-sh-handle-file-truename) (tramp-sh-handle-copy-directory, tramp-do-copy-or-rename-file) (tramp-sh-handle-insert-directory, tramp-sh-file-name-handler) (tramp-maybe-open-connection): * lisp/net/tramp-smb.el (tramp-smb-file-name-handler) (tramp-smb-handle-copy-file, tramp-smb-handle-copy-directory) (tramp-smb-handle-copy-file, tramp-smb-handle-insert-directory) (tramp-smb-handle-rename-file, tramp-smb-maybe-open-connection): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler) (tramp-sudoedit-do-copy-or-rename-file) (tramp-sudoedit-handle-file-truename): Use `if-let', `when-let', `directory-name-p', `inhibit-message', `non-essential and `cl-struct-slot-info'. Don't use `seconds-to-time'. * test/lisp/net/tramp-archive-tests.el (tramp-message-show-message): Don't set. * test/lisp/net/tramp-tests.el (inhibit-message): Don't declare. (tramp-message-show-message): Don't set. (tramp-test06-directory-file-name): Use `non-essential'. (tramp-test10-write-region): Use `inhibit-message'. (tramp-test36-vc-registered): No special handling for old Emacsen. (tramp--test-emacs25-p): Remove. (tramp-test45-unload): Special case of `tramp-completion-mode'.
2020-01-19 14:11:07 +01:00
(put #'tramp-dbus-function 'tramp-suppress-trace t)
2009-06-22 21:04:49 +00:00
(defmacro with-tramp-dbus-call-method
(vec synchronous bus service path interface method &rest args)
"Apply a D-Bus call on bus BUS.
If SYNCHRONOUS is non-nil, the call is synchronously. Otherwise,
it is an asynchronous call, with `ignore' as callback function.
The other arguments have the same meaning as with `dbus-call-method'
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
or `dbus-call-method-asynchronously'."
Sync with Tramp 2.5.0-pre * doc/misc/tramp.texi: Protext Tramp x.y and Emacs x.y by @w{}. (GVFS-based methods): Move "GNOME Online Accounts" index. (Customizing Methods, Android shell setup, File name completion) (Frequently Asked Questions): Fix typos. * doc/misc/trampver.texi: Change version to "2.5.0-pre". * lisp/net/trampver.el: Change version to "2.5.0-pre". (inhibit-message): Don't declare. * lisp/net/tramp.el: Bump version to 2.5.0-pre. Require Emacs 25.1. (tramp-debug-message): Simplify. (tramp-message): Don't use `tramp-message-show-message'. (tramp-with-demoted-errors, with-parsed-tramp-file-name) (with-tramp-file-property, with-tramp-connection-property): Adapt `declare' form. (with-tramp-progress-reporter): Suppress progress reporter when noninteractive. (tramp-completion-mode, tramp-completion-mode-p): Remove. * lisp/net/tramp-compat.el (tramp-compat-process-running-p) (format-message): Remove compatibility code. (tramp-compat-directory-name-p) (tramp-compat-tramp-file-name-slots): Remove. * lisp/net/tramp.el (tramp-debug-message, tramp-message) (tramp-backtrace, tramp-error, tramp-error-with-buffer) (tramp-user-error, tramp-with-demoted-errors) (tramp-signal-hook-function): * lisp/net/tramp-compat.el (tramp-compat-funcall) * lisp/net/tramp-gvfs.el (tramp-dbus-function): Add `tramp-suppress-trace' property. * lisp/net/tramp.el (tramp-get-method-parameter) (tramp-dissect-file-name, tramp-error, tramp-error-with-buffer) (tramp-user-error, with-parsed-tramp-file-name) (with-tramp-progress-reporter, tramp-file-name-handler) (tramp-completion-file-name-handler, tramp-autoload-file-name-handler) (tramp-register-file-name-handlers, tramp-connectable-p) (tramp-handle-file-modes, tramp-handle-file-regular-p) (tramp-handle-file-truename, tramp-handle-insert-directory) (tramp-handle-load, tramp-set-file-uid-gid): * lisp/net/tramp-adb.el (tramp-adb-file-name-handler) (tramp-adb-handle-file-truename, tramp-adb-handle-copy-file) (tramp-adb-handle-rename-file): * lisp/net/tramp-archive.el (with-parsed-tramp-archive-file-name): * lisp/net/tramp-cache.el (tramp-get-file-property, tramp-cache-print): * lisp/net/tramp-compat.el (tramp-compat-process-running-p) (tramp-compat-exec-path): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler) (tramp-gvfs-dbus-byte-array-to-string) (tramp-gvfs-do-copy-or-rename-file): * lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler) (tramp-rclone-do-copy-or-rename-file): * lisp/net/tramp-sh.el (tramp-sh-handle-file-truename) (tramp-sh-handle-copy-directory, tramp-do-copy-or-rename-file) (tramp-sh-handle-insert-directory, tramp-sh-file-name-handler) (tramp-maybe-open-connection): * lisp/net/tramp-smb.el (tramp-smb-file-name-handler) (tramp-smb-handle-copy-file, tramp-smb-handle-copy-directory) (tramp-smb-handle-copy-file, tramp-smb-handle-insert-directory) (tramp-smb-handle-rename-file, tramp-smb-maybe-open-connection): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler) (tramp-sudoedit-do-copy-or-rename-file) (tramp-sudoedit-handle-file-truename): Use `if-let', `when-let', `directory-name-p', `inhibit-message', `non-essential and `cl-struct-slot-info'. Don't use `seconds-to-time'. * test/lisp/net/tramp-archive-tests.el (tramp-message-show-message): Don't set. * test/lisp/net/tramp-tests.el (inhibit-message): Don't declare. (tramp-message-show-message): Don't set. (tramp-test06-directory-file-name): Use `non-essential'. (tramp-test10-write-region): Use `inhibit-message'. (tramp-test36-vc-registered): No special handling for old Emacsen. (tramp--test-emacs25-p): Remove. (tramp-test45-unload): Special case of `tramp-completion-mode'.
2020-01-19 14:11:07 +01:00
(declare (indent 2) (debug t))
2009-06-22 21:04:49 +00:00
`(let ((func (if ,synchronous
#'dbus-call-method #'dbus-call-method-asynchronously))
2009-06-22 21:04:49 +00:00
(args (append (list ,bus ,service ,path ,interface ,method)
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
(if ,synchronous (list ,@args) (list 'ignore ,@args)))))
;; We use `dbus-ignore-errors', because this macro is also called
;; when loading.
(dbus-ignore-errors (tramp-dbus-function ,vec func args))))
2009-06-22 21:04:49 +00:00
Remove XEmacs compatibility in Tramp * doc/misc/tramp.texi: Replace flags by their hard coded name. Remove unused flags and the enclosed alternative text for XEmacs. * doc/misc/trampver.texi: Use "Tramp" CamelCase. Rename "emacs" and "xemacs" flags to "unified" and "separate". Remove flags "emacsgw", "emacsname", "emacsdir", "ftppackagename", "emacsothername", "emacsotherdir" and "emacsotherfilename". (trampver): * lisp/net/trampver.el (tramp-version): Set to "2.3.0-pre". * lisp/net/tramp.el (bkup-backup-directory-info) (directory-sep-char, ls-lisp-use-insert-directory-program) (outline-regexp, tramp-backup-directory-alist) (tramp-default-method, tramp-shell-prompt-pattern, tramp-syntax) (tramp-file-name-regexp-unified) (tramp-file-name-regexp-separate) (tramp-completion-file-name-regexp-unified) (tramp-completion-file-name-regexp-separate, tramp-chunksize) (tramp-get-method-parameter, tramp-find-method, tramp-find-user) (tramp-debug-message, tramp-progress-reporter-update) (with-tramp-progress-reporter) (tramp-rfn-eshadow-setup-minibuffer) (rfn-eshadow-setup-minibuffer-hook, tramp-unload-hook) (tramp-rfn-eshadow-update-overlay) (rfn-eshadow-update-overlay-hook, tramp-default-file-modes) (tramp-file-name-for-operation) (tramp-completion-file-name-handler) (tramp-autoload-file-name-handler, tramp-completion-mode-p) (tramp-handle-directory-files) (tramp-handle-directory-files-and-attributes) (tramp-handle-dired-uncache, tramp-handle-find-backup-file-name) (tramp-handle-insert-file-contents, tramp-handle-load) (tramp-handle-shell-command) (tramp-handle-verify-visited-file-modtime) (tramp-handle-file-notify-valid-p, tramp-accept-process-output) (tramp-check-for-regexp, tramp-wait-for-regexp) (tramp-send-string, tramp-mode-string-to-int) (tramp-get-local-gid, tramp-check-cached-permissions) (tramp-get-remote-tmpdir, tramp-make-tramp-temp-file) (auto-save-file-name-transforms) (tramp-handle-make-auto-save-file-name, tramp-read-passwd) (tramp-clear-passwd, tramp-time-diff): * lisp/net/tramp-adb.el (directory-listing-before-filename-regexp) (directory-sep-char, tramp-adb-file-name-handler-alist) (tramp-adb-parse-device-names) (tramp-adb-handle-expand-file-name) (tramp-adb-handle-file-truename, tramp-adb--gnu-switches-to-ash) (tramp-adb-handle-file-local-copy) (tramp-adb-handle-write-region, tramp-adb-handle-set-file-modes) (tramp-adb-handle-rename-file, tramp-adb-handle-process-file) (tramp-adb-handle-shell-command) (tramp-adb-handle-start-file-process, tramp-adb-get-device) (tramp-adb-maybe-open-connection): * lisp/net/tramp-cache.el (tramp-persistency-file-name) (tramp-cache-print): * lisp/net/tramp-cmds.el (tramp-cleanup-all-connections) (tramp-bug, tramp-reporter-dump-variable) (tramp-load-report-modules, tramp-append-tramp-buffers): * lisp/net/tramp-compat.el (tramp-compat-funcall) (tramp-advice-file-expand-wildcards) (tramp-compat-temporary-file-directory) (tramp-compat-make-temp-file, tramp-compat-copy-file) (tramp-compat-delete-directory, ) (tramp-compat-process-running-p): * lisp/net/tramp-ftp.el (tramp-methods) <ftp>: (tramp-default-method-alist, tramp-foreign-file-name-handler-alist): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) (tramp-gvfs-do-copy-or-rename-file, tramp-gvfs-handle-copy-file) (tramp-gvfs-handle-file-local-copy) (tramp-gvfs-handle-file-name-all-completions) (tramp-gvfs-handle-file-notify-add-watch) (tramp-gvfs-monitor-file-process-filter) (tramp-gvfs-handle-file-readable-p) (tramp-gvfs-handle-rename-file, tramp-gvfs-handle-write-region) (tramp-gvfs-file-name, tramp-gvfs-handler-askquestion) (tramp-gvfs-maybe-open-connection) (tramp-gvfs-parse-device-names): * lisp/net/tramp-gw.el (tramp-gw-aux-proc-sentinel) (tramp-gw-open-connection, tramp-gw-open-network-stream): * lisp/net/tramp-sh.el (directory-sep-char) (tramp-sh-file-name-handler-alist) (tramp-sh-handle-file-truename) (tramp-sh-handle-set-visited-file-modtime) (tramp-sh-handle-verify-visited-file-modtime) (tramp-sh-handle-set-file-modes, tramp-sh-handle-set-file-times) (tramp-sh-handle-file-acl) (tramp-sh-handle-file-name-all-completions) (tramp-sh-handle-copy-file, tramp-sh-handle-rename-file) (tramp-do-copy-or-rename-file-directly) (tramp-do-copy-or-rename-file-out-of-band) (dired-compress-file-suffixes, dired-remove-file) (tramp-sh-handle-dired-compress-file) (tramp-sh-handle-insert-directory) (tramp-sh-handle-expand-file-name) (tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-sh-handle-file-local-copy) (tramp-sh-handle-write-region, tramp-sh-handle-vc-registered) (tramp-sh-handle-file-notify-add-watch) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter, tramp-maybe-send-script) (tramp-find-executable) (tramp-open-connection-setup-interactive-shell) (tramp-find-inline-encoding, tramp-compute-multi-hops) (tramp-maybe-open-connection, tramp-convert-file-attributes) (tramp-get-remote-path, tramp-get-remote-touch): * lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist) (tramp-smb-handle-copy-directory, tramp-smb-handle-copy-file) (tramp-smb-handle-delete-directory) (tramp-smb-handle-directory-files, tramp-smb-handle-file-acl) (tramp-smb-handle-make-directory-internal) (tramp-smb-handle-process-file, tramp-smb-handle-rename-file) (tramp-smb-handle-set-file-acl, tramp-smb-handle-set-file-modes) (tramp-smb-handle-write-region, tramp-smb-get-file-entries) (tramp-smb-get-cifs-capabilities) (tramp-smb-maybe-open-connection): * lisp/net/trampver.el (tramp-repository-get-version): Remove XEmacs compat code. * lisp/net/tramp-cmds.el (mml-mode, mml-insert-empty-tag) (reporter-dump-variable): Declare functions. * lisp/net/tramp.el (tramp-bkup-backup-directory-info) (tramp-advice-minibuffer-electric-separator) (tramp-advice-minibuffer-electric-tilde) (tramp-handle-unhandled-file-name-directory): * lisp/net/tramp-compat.el (tramp-compat-with-temp-message) (tramp-compat-font-lock-add-keywords) (tramp-compat-load, tramp-compat-number-sequence) (tramp-compat-split-string, tramp-compat-delete-dups): * lisp/net/tramp-sh.el (tramp-sh-handle-insert-file-contents-literally): Remove. * lisp/net/tramp-sh.el (tramp-methods) <psftp>: This does not work recursively.
2016-01-14 14:12:17 +01:00
(font-lock-add-keywords 'emacs-lisp-mode '("\\<with-tramp-dbus-call-method\\>"))
2009-06-22 21:04:49 +00:00
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
(defmacro with-tramp-dbus-get-all-properties
(vec bus service path interface)
"Return all properties of INTERFACE.
The call will be traced by Tramp with trace level 6."
;; Check, that interface exists at object path. Retrieve properties.
Sync with Tramp 2.5.0-pre * doc/misc/tramp.texi: Protext Tramp x.y and Emacs x.y by @w{}. (GVFS-based methods): Move "GNOME Online Accounts" index. (Customizing Methods, Android shell setup, File name completion) (Frequently Asked Questions): Fix typos. * doc/misc/trampver.texi: Change version to "2.5.0-pre". * lisp/net/trampver.el: Change version to "2.5.0-pre". (inhibit-message): Don't declare. * lisp/net/tramp.el: Bump version to 2.5.0-pre. Require Emacs 25.1. (tramp-debug-message): Simplify. (tramp-message): Don't use `tramp-message-show-message'. (tramp-with-demoted-errors, with-parsed-tramp-file-name) (with-tramp-file-property, with-tramp-connection-property): Adapt `declare' form. (with-tramp-progress-reporter): Suppress progress reporter when noninteractive. (tramp-completion-mode, tramp-completion-mode-p): Remove. * lisp/net/tramp-compat.el (tramp-compat-process-running-p) (format-message): Remove compatibility code. (tramp-compat-directory-name-p) (tramp-compat-tramp-file-name-slots): Remove. * lisp/net/tramp.el (tramp-debug-message, tramp-message) (tramp-backtrace, tramp-error, tramp-error-with-buffer) (tramp-user-error, tramp-with-demoted-errors) (tramp-signal-hook-function): * lisp/net/tramp-compat.el (tramp-compat-funcall) * lisp/net/tramp-gvfs.el (tramp-dbus-function): Add `tramp-suppress-trace' property. * lisp/net/tramp.el (tramp-get-method-parameter) (tramp-dissect-file-name, tramp-error, tramp-error-with-buffer) (tramp-user-error, with-parsed-tramp-file-name) (with-tramp-progress-reporter, tramp-file-name-handler) (tramp-completion-file-name-handler, tramp-autoload-file-name-handler) (tramp-register-file-name-handlers, tramp-connectable-p) (tramp-handle-file-modes, tramp-handle-file-regular-p) (tramp-handle-file-truename, tramp-handle-insert-directory) (tramp-handle-load, tramp-set-file-uid-gid): * lisp/net/tramp-adb.el (tramp-adb-file-name-handler) (tramp-adb-handle-file-truename, tramp-adb-handle-copy-file) (tramp-adb-handle-rename-file): * lisp/net/tramp-archive.el (with-parsed-tramp-archive-file-name): * lisp/net/tramp-cache.el (tramp-get-file-property, tramp-cache-print): * lisp/net/tramp-compat.el (tramp-compat-process-running-p) (tramp-compat-exec-path): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler) (tramp-gvfs-dbus-byte-array-to-string) (tramp-gvfs-do-copy-or-rename-file): * lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler) (tramp-rclone-do-copy-or-rename-file): * lisp/net/tramp-sh.el (tramp-sh-handle-file-truename) (tramp-sh-handle-copy-directory, tramp-do-copy-or-rename-file) (tramp-sh-handle-insert-directory, tramp-sh-file-name-handler) (tramp-maybe-open-connection): * lisp/net/tramp-smb.el (tramp-smb-file-name-handler) (tramp-smb-handle-copy-file, tramp-smb-handle-copy-directory) (tramp-smb-handle-copy-file, tramp-smb-handle-insert-directory) (tramp-smb-handle-rename-file, tramp-smb-maybe-open-connection): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler) (tramp-sudoedit-do-copy-or-rename-file) (tramp-sudoedit-handle-file-truename): Use `if-let', `when-let', `directory-name-p', `inhibit-message', `non-essential and `cl-struct-slot-info'. Don't use `seconds-to-time'. * test/lisp/net/tramp-archive-tests.el (tramp-message-show-message): Don't set. * test/lisp/net/tramp-tests.el (inhibit-message): Don't declare. (tramp-message-show-message): Don't set. (tramp-test06-directory-file-name): Use `non-essential'. (tramp-test10-write-region): Use `inhibit-message'. (tramp-test36-vc-registered): No special handling for old Emacsen. (tramp--test-emacs25-p): Remove. (tramp-test45-unload): Special case of `tramp-completion-mode'.
2020-01-19 14:11:07 +01:00
(declare (indent 1) (debug t))
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
`(when (member
,interface
(tramp-dbus-function
,vec #'dbus-introspect-get-interface-names
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
(list ,bus ,service ,path)))
(tramp-dbus-function
,vec #'dbus-get-all-properties (list ,bus ,service ,path ,interface))))
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
(font-lock-add-keywords 'emacs-lisp-mode '("\\<with-tramp-dbus-get-all-properties\\>"))
2009-06-22 21:04:49 +00:00
(defvar tramp-gvfs-dbus-event-vector nil
"Current Tramp file name to be used, as vector.
It is needed when D-Bus signals or errors arrive, because there
is no information where to trace the message.")
(defun tramp-gvfs-dbus-event-error (event err)
"Called when a D-Bus error message arrives, see `dbus-event-error-functions'."
(when tramp-gvfs-dbus-event-vector
Sync with Tramp 2.4.0-pre * doc/misc/trampver.texi: * lisp/net/trampver.el: Change version to "2.4.0-pre". * lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist): Use `tramp-handle-file-directory-p'. (tramp-adb-parse-device-names) (tramp-adb-handle-expand-file-name) (tramp-adb-handle-file-truename, tramp-adb-handle-process-file): Adapt `tramp-make-tramp-file-name' call. (tramp-adb-handle-file-directory-p): Remove. (tramp-adb-maybe-open-connection): Do not set tramp-current-*. * lisp/net/tramp-cache.el (tramp-get-hash-table): Adapt `tramp-make-tramp-file-name' call. * lisp/net/tramp-cmds.el (tramp-cleanup-connection): Do not set tramp-current-*. * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Use `tramp-handle-file-directory-p'. (tramp-gvfs-dbus-event-error): Trace with verbosity 6. (tramp-gvfs-do-copy-or-rename-file): Use `file-truename'. (tramp-gvfs-handle-file-directory-p): Remove. (tramp-gvfs-handler-askpassword): Do not set tramp-current-*. * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band) (tramp-sh-handle-start-file-process) (tramp-maybe-open-connection, tramp-get-remote-path): Do not set tramp-current-*. (tramp-maybe-open-connection): Set "password-vector" property. * lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist): Use `tramp-handle-file-accessible-directory-p' and `tramp-handle-file-directory-p'. (tramp-smb-handle-copy-directory, tramp-smb-handle-file-acl) (tramp-smb-handle-set-file-acl) (tramp-smb-maybe-open-connection): Do not set tramp-current-*. (tramp-smb-handle-file-directory-p): Remove. (tramp-smb-handle-make-symbolic-link): Use `tramp-get-connection-buffer' rather than `buffer-name'. * lisp/net/tramp.el (tramp-current-method, tramp-current-user) (tramp-current-domain, tramp-current-host) (tramp-current-port): Remove. (tramp-dissect-file-name): No special handling of localname anymore. (tramp-make-tramp-file-name): Reimplemnt with new signature. (tramp-completion-make-tramp-file-name): Fix docstring. (tramp-get-buffer, tramp-handle-file-name-as-directory) (tramp-handle-file-name-directory) (tramp-check-cached-permissions, tramp-local-host-p) (tramp-get-remote-tmpdir, tramp-clear-passwd): Adapt `tramp-make-tramp-file-name' call. (tramp-completion-handle-file-name-all-completions) (tramp-action-login, tramp-read-passwd): Do not set tramp-current-*. (tramp-handle-file-directory-p): New defun. (tramp-handle-verify-visited-file-modtime): Remove superfluous `with-parsed-tramp-file-name'. (tramp-process-actions, tramp-read-passwd): Use "password-vector" property. (tramp-call-process, tramp-call-process-region): No special setting of vec. (tramp-read-passwd): Handle "login-as" property. * test/lisp/net/tramp-tests.el (tramp-test21-file-links): Special code for "smb".
2017-12-09 13:22:52 +01:00
(tramp-message tramp-gvfs-dbus-event-vector 6 "%S" event)
(tramp-error tramp-gvfs-dbus-event-vector 'file-error "%s" (cadr err))))
2009-06-22 21:04:49 +00:00
Tramp requires Emacs 24.4 * doc/misc/tramp.texi (Frequently Asked Questions): Use `with-eval-after-load'. in example. * doc/misc/trampver.texi: Set variable emacsver. * lisp/net/tramp.el (tramp-send-string, tramp-call-process) (tramp-call-process-region, tramp-process-lines): * lisp/net/tramp-adb.el (tramp-adb-handle-file-truename) (tramp-adb-sh-fix-ls-output, tramp-adb-maybe-open-connection): * lisp/net/tramp-gvfs.el (tramp-gvfs-get-directory-attributes) (tramp-gvfs-handle-file-notify-add-watch) * lisp/net/tramp-sh.el (tramp-sh-handle-file-truename) (tramp-do-copy-or-rename-file-out-of-band) (tramp-sh-handle-file-notify-add-watch, tramp-find-executable) (tramp-set-remote-path) (tramp-open-connection-setup-interactive-shell) (tramp-maybe-open-connection, tramp-send-command): * 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) (tramp-smb-maybe-open-connection): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-set-file-acl): (tramp-sudoedit-send-command): Use `string-join' and `string-empty-p'. * lisp/net/tramp-adb.el: * lisp/net/tramp-archive.el: * lisp/net/tramp-integration.el: * lisp/net/tramp-ftp.el: Use `with-eval-after-load'. * lisp/net/tramp-cmds.el (tramp-cleanup-connection) (tramp-cleanup-all-connections): Cancel timer. * lisp/net/tramp-compat.el (subr-x): Require. (default-toplevel-value): Don't make it a defalias. * lisp/net/tramp-gvfs.el: Use `dbus-event-error-functions'. Do not special handle `split-string'. * lisp/net/tramp.el: Require Emacs 24.4. (tramp-password-prompt-regexp): Use `password-word-equivalents'. (tramp-user-error): Use `user-error'. (tramp-replace-environment-variables): Use `substitute-env-vars'. (tramp-wait-for-regexp): Rearrange `with-current-buffer' call. (tramp-get-local-gid): Use `group-gid'. * lisp/net/trampver.el: Check for Emacs 24.4. * test/lisp/net/tramp-tests.el (tramp-test02-file-name-dissect) (tramp-test02-file-name-dissect-simplified) (tramp-test02-file-name-dissect-separate) (tramp-test03-file-name-host-rules) (tramp-test03-file-name-method-rules): Don't check for `user-error'.
2019-06-28 16:32:12 +02:00
(add-hook 'dbus-event-error-functions #'tramp-gvfs-dbus-event-error)
(add-hook 'tramp-gvfs-unload-hook
(lambda ()
(remove-hook 'dbus-event-error-functions
#'tramp-gvfs-dbus-event-error)))
2009-06-22 21:04:49 +00:00
;; File name primitives.
Sync with Tramp repository * doc/misc/tramp.texi (Configuration): Note, that Tramp must be required prior changing its configuration. (Connection caching, Predefined connection information) (Remote shell setup): Fix typos. (Predefined connection information): Describe, how to overwrite parameters of `tramp-methods'. (Remote programs, Remote processes, Traces and Profiles): Simplify example. (Remote programs): Remove superfluous comment. * doc/misc/trampver.texi: Update release number. * lisp/net/tramp-cache.el (tramp-connection-properties): Adapt docstring. * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file): New defun. (tramp-gvfs-handle-copy-file, tramp-gvfs-handle-rename-file): Use it. (tramp-gvfs-handle-make-directory): Reimplement PARENTS handling, "gvfs-mkdir -p ..." does not work robust. (tramp-gvfs-maybe-open-connection): Adapt `tramp-get-method-parameter' call. * lisp/net/tramp-sh.el (tramp-methods): Add `tramp-remote-shell-login' parameter where it fits. (tramp-get-remote-path): Use it. (tramp-make-copy-program-file-name): Fix quoting for "psftp" method. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/tramp.el (tramp-methods): Adapt docstring. (tramp-get-method-parameter): Replace argument METHOD by VEC. Check also for hits in `tramp-connection-properties'. Adapt docstring. (tramp-get-remote-tmpdir): Cache only the local name of tmpdir. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/trampver.el Update release number. * test/automated/tramp-tests.el (tramp--instrument-test-case): Add "^make-symbolic-link not supported$" to `debug-ignored-errors'. (tramp-test13-make-directory, tramp--test-adb-p) (tramp--test-smb-or-windows-nt-p): Simplify. (tramp--test-ftp-p, tramp--test-gvfs-p): New defuns. (tramp--test-special-characters): Fix docstring. Add gvfs and ftp tests. (tramp--test-utf8): Fix docstring.
2015-07-21 14:59:18 +02:00
(defun tramp-gvfs-do-copy-or-rename-file
(op filename newname &optional ok-if-already-exists keep-date
preserve-uid-gid preserve-extended-attributes)
Sync with Tramp repository * doc/misc/tramp.texi (Configuration): Note, that Tramp must be required prior changing its configuration. (Connection caching, Predefined connection information) (Remote shell setup): Fix typos. (Predefined connection information): Describe, how to overwrite parameters of `tramp-methods'. (Remote programs, Remote processes, Traces and Profiles): Simplify example. (Remote programs): Remove superfluous comment. * doc/misc/trampver.texi: Update release number. * lisp/net/tramp-cache.el (tramp-connection-properties): Adapt docstring. * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file): New defun. (tramp-gvfs-handle-copy-file, tramp-gvfs-handle-rename-file): Use it. (tramp-gvfs-handle-make-directory): Reimplement PARENTS handling, "gvfs-mkdir -p ..." does not work robust. (tramp-gvfs-maybe-open-connection): Adapt `tramp-get-method-parameter' call. * lisp/net/tramp-sh.el (tramp-methods): Add `tramp-remote-shell-login' parameter where it fits. (tramp-get-remote-path): Use it. (tramp-make-copy-program-file-name): Fix quoting for "psftp" method. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/tramp.el (tramp-methods): Adapt docstring. (tramp-get-method-parameter): Replace argument METHOD by VEC. Check also for hits in `tramp-connection-properties'. Adapt docstring. (tramp-get-remote-tmpdir): Cache only the local name of tmpdir. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/trampver.el Update release number. * test/automated/tramp-tests.el (tramp--instrument-test-case): Add "^make-symbolic-link not supported$" to `debug-ignored-errors'. (tramp-test13-make-directory, tramp--test-adb-p) (tramp--test-smb-or-windows-nt-p): Simplify. (tramp--test-ftp-p, tramp--test-gvfs-p): New defuns. (tramp--test-special-characters): Fix docstring. Add gvfs and ftp tests. (tramp--test-utf8): Fix docstring.
2015-07-21 14:59:18 +02:00
"Copy or rename a remote file.
OP must be `copy' or `rename' and indicates the operation to perform.
FILENAME specifies the file to copy or rename, NEWNAME is the name of
the new file (for copy) or the new name of the file (for rename).
OK-IF-ALREADY-EXISTS means don't barf if NEWNAME exists already.
KEEP-DATE means to make sure that NEWNAME has the same timestamp
as FILENAME. PRESERVE-UID-GID, when non-nil, instructs to keep
the uid and gid if both files are on the same host.
PRESERVE-EXTENDED-ATTRIBUTES is ignored.
This function is invoked by `tramp-gvfs-handle-copy-file' and
`tramp-gvfs-handle-rename-file'. It is an error if OP is neither
of `copy' and `rename'. FILENAME and NEWNAME must be absolute
file names."
(unless (memq op '(copy rename))
(error "Unknown operation `%s', must be `copy' or `rename'" op))
Sync with Tramp repository * doc/misc/tramp.texi (Configuration): Note, that Tramp must be required prior changing its configuration. (Connection caching, Predefined connection information) (Remote shell setup): Fix typos. (Predefined connection information): Describe, how to overwrite parameters of `tramp-methods'. (Remote programs, Remote processes, Traces and Profiles): Simplify example. (Remote programs): Remove superfluous comment. * doc/misc/trampver.texi: Update release number. * lisp/net/tramp-cache.el (tramp-connection-properties): Adapt docstring. * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file): New defun. (tramp-gvfs-handle-copy-file, tramp-gvfs-handle-rename-file): Use it. (tramp-gvfs-handle-make-directory): Reimplement PARENTS handling, "gvfs-mkdir -p ..." does not work robust. (tramp-gvfs-maybe-open-connection): Adapt `tramp-get-method-parameter' call. * lisp/net/tramp-sh.el (tramp-methods): Add `tramp-remote-shell-login' parameter where it fits. (tramp-get-remote-path): Use it. (tramp-make-copy-program-file-name): Fix quoting for "psftp" method. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/tramp.el (tramp-methods): Adapt docstring. (tramp-get-method-parameter): Replace argument METHOD by VEC. Check also for hits in `tramp-connection-properties'. Adapt docstring. (tramp-get-remote-tmpdir): Cache only the local name of tmpdir. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/trampver.el Update release number. * test/automated/tramp-tests.el (tramp--instrument-test-case): Add "^make-symbolic-link not supported$" to `debug-ignored-errors'. (tramp-test13-make-directory, tramp--test-adb-p) (tramp--test-smb-or-windows-nt-p): Simplify. (tramp--test-ftp-p, tramp--test-gvfs-p): New defuns. (tramp--test-special-characters): Fix docstring. Add gvfs and ftp tests. (tramp--test-utf8): Fix docstring.
2015-07-21 14:59:18 +02:00
Sync with Tramp 2.4.0-pre * doc/misc/trampver.texi: * lisp/net/trampver.el: Change version to "2.4.0-pre". * lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist): Use `tramp-handle-file-directory-p'. (tramp-adb-parse-device-names) (tramp-adb-handle-expand-file-name) (tramp-adb-handle-file-truename, tramp-adb-handle-process-file): Adapt `tramp-make-tramp-file-name' call. (tramp-adb-handle-file-directory-p): Remove. (tramp-adb-maybe-open-connection): Do not set tramp-current-*. * lisp/net/tramp-cache.el (tramp-get-hash-table): Adapt `tramp-make-tramp-file-name' call. * lisp/net/tramp-cmds.el (tramp-cleanup-connection): Do not set tramp-current-*. * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Use `tramp-handle-file-directory-p'. (tramp-gvfs-dbus-event-error): Trace with verbosity 6. (tramp-gvfs-do-copy-or-rename-file): Use `file-truename'. (tramp-gvfs-handle-file-directory-p): Remove. (tramp-gvfs-handler-askpassword): Do not set tramp-current-*. * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band) (tramp-sh-handle-start-file-process) (tramp-maybe-open-connection, tramp-get-remote-path): Do not set tramp-current-*. (tramp-maybe-open-connection): Set "password-vector" property. * lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist): Use `tramp-handle-file-accessible-directory-p' and `tramp-handle-file-directory-p'. (tramp-smb-handle-copy-directory, tramp-smb-handle-file-acl) (tramp-smb-handle-set-file-acl) (tramp-smb-maybe-open-connection): Do not set tramp-current-*. (tramp-smb-handle-file-directory-p): Remove. (tramp-smb-handle-make-symbolic-link): Use `tramp-get-connection-buffer' rather than `buffer-name'. * lisp/net/tramp.el (tramp-current-method, tramp-current-user) (tramp-current-domain, tramp-current-host) (tramp-current-port): Remove. (tramp-dissect-file-name): No special handling of localname anymore. (tramp-make-tramp-file-name): Reimplemnt with new signature. (tramp-completion-make-tramp-file-name): Fix docstring. (tramp-get-buffer, tramp-handle-file-name-as-directory) (tramp-handle-file-name-directory) (tramp-check-cached-permissions, tramp-local-host-p) (tramp-get-remote-tmpdir, tramp-clear-passwd): Adapt `tramp-make-tramp-file-name' call. (tramp-completion-handle-file-name-all-completions) (tramp-action-login, tramp-read-passwd): Do not set tramp-current-*. (tramp-handle-file-directory-p): New defun. (tramp-handle-verify-visited-file-modtime): Remove superfluous `with-parsed-tramp-file-name'. (tramp-process-actions, tramp-read-passwd): Use "password-vector" property. (tramp-call-process, tramp-call-process-region): No special setting of vec. (tramp-read-passwd): Handle "login-as" property. * test/lisp/net/tramp-tests.el (tramp-test21-file-links): Special code for "smb".
2017-12-09 13:22:52 +01:00
(setq filename (file-truename filename))
(if (file-directory-p filename)
(progn
(copy-directory filename newname keep-date t)
(when (eq op 'rename) (delete-directory filename 'recursive)))
(let ((t1 (tramp-tramp-file-p filename))
(t2 (tramp-tramp-file-p newname))
(equal-remote (tramp-equal-remote filename newname))
;; "gvfs-rename" is not trustworthy.
(gvfs-operation (if (eq op 'copy) "gvfs-copy" "gvfs-move"))
(msg-operation (if (eq op 'copy) "Copying" "Renaming")))
Sync with Tramp repository * doc/misc/tramp.texi (Configuration): Note, that Tramp must be required prior changing its configuration. (Connection caching, Predefined connection information) (Remote shell setup): Fix typos. (Predefined connection information): Describe, how to overwrite parameters of `tramp-methods'. (Remote programs, Remote processes, Traces and Profiles): Simplify example. (Remote programs): Remove superfluous comment. * doc/misc/trampver.texi: Update release number. * lisp/net/tramp-cache.el (tramp-connection-properties): Adapt docstring. * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file): New defun. (tramp-gvfs-handle-copy-file, tramp-gvfs-handle-rename-file): Use it. (tramp-gvfs-handle-make-directory): Reimplement PARENTS handling, "gvfs-mkdir -p ..." does not work robust. (tramp-gvfs-maybe-open-connection): Adapt `tramp-get-method-parameter' call. * lisp/net/tramp-sh.el (tramp-methods): Add `tramp-remote-shell-login' parameter where it fits. (tramp-get-remote-path): Use it. (tramp-make-copy-program-file-name): Fix quoting for "psftp" method. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/tramp.el (tramp-methods): Adapt docstring. (tramp-get-method-parameter): Replace argument METHOD by VEC. Check also for hits in `tramp-connection-properties'. Adapt docstring. (tramp-get-remote-tmpdir): Cache only the local name of tmpdir. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/trampver.el Update release number. * test/automated/tramp-tests.el (tramp--instrument-test-case): Add "^make-symbolic-link not supported$" to `debug-ignored-errors'. (tramp-test13-make-directory, tramp--test-adb-p) (tramp--test-smb-or-windows-nt-p): Simplify. (tramp--test-ftp-p, tramp--test-gvfs-p): New defuns. (tramp--test-special-characters): Fix docstring. Add gvfs and ftp tests. (tramp--test-utf8): Fix docstring.
2015-07-21 14:59:18 +02:00
(with-parsed-tramp-file-name (if t1 filename newname) nil
(unless (file-exists-p filename)
(tramp-error
v tramp-file-missing
"%s file" msg-operation "No such file or directory" filename))
Sync with Tramp repository * doc/misc/tramp.texi (Configuration): Note, that Tramp must be required prior changing its configuration. (Connection caching, Predefined connection information) (Remote shell setup): Fix typos. (Predefined connection information): Describe, how to overwrite parameters of `tramp-methods'. (Remote programs, Remote processes, Traces and Profiles): Simplify example. (Remote programs): Remove superfluous comment. * doc/misc/trampver.texi: Update release number. * lisp/net/tramp-cache.el (tramp-connection-properties): Adapt docstring. * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file): New defun. (tramp-gvfs-handle-copy-file, tramp-gvfs-handle-rename-file): Use it. (tramp-gvfs-handle-make-directory): Reimplement PARENTS handling, "gvfs-mkdir -p ..." does not work robust. (tramp-gvfs-maybe-open-connection): Adapt `tramp-get-method-parameter' call. * lisp/net/tramp-sh.el (tramp-methods): Add `tramp-remote-shell-login' parameter where it fits. (tramp-get-remote-path): Use it. (tramp-make-copy-program-file-name): Fix quoting for "psftp" method. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/tramp.el (tramp-methods): Adapt docstring. (tramp-get-method-parameter): Replace argument METHOD by VEC. Check also for hits in `tramp-connection-properties'. Adapt docstring. (tramp-get-remote-tmpdir): Cache only the local name of tmpdir. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/trampver.el Update release number. * test/automated/tramp-tests.el (tramp--instrument-test-case): Add "^make-symbolic-link not supported$" to `debug-ignored-errors'. (tramp-test13-make-directory, tramp--test-adb-p) (tramp--test-smb-or-windows-nt-p): Simplify. (tramp--test-ftp-p, tramp--test-gvfs-p): New defuns. (tramp--test-special-characters): Fix docstring. Add gvfs and ftp tests. (tramp--test-utf8): Fix docstring.
2015-07-21 14:59:18 +02:00
(when (and (not ok-if-already-exists) (file-exists-p newname))
(tramp-error v 'file-already-exists newname))
(when (and (file-directory-p newname)
Sync with Tramp 2.5.0-pre * doc/misc/tramp.texi: Protext Tramp x.y and Emacs x.y by @w{}. (GVFS-based methods): Move "GNOME Online Accounts" index. (Customizing Methods, Android shell setup, File name completion) (Frequently Asked Questions): Fix typos. * doc/misc/trampver.texi: Change version to "2.5.0-pre". * lisp/net/trampver.el: Change version to "2.5.0-pre". (inhibit-message): Don't declare. * lisp/net/tramp.el: Bump version to 2.5.0-pre. Require Emacs 25.1. (tramp-debug-message): Simplify. (tramp-message): Don't use `tramp-message-show-message'. (tramp-with-demoted-errors, with-parsed-tramp-file-name) (with-tramp-file-property, with-tramp-connection-property): Adapt `declare' form. (with-tramp-progress-reporter): Suppress progress reporter when noninteractive. (tramp-completion-mode, tramp-completion-mode-p): Remove. * lisp/net/tramp-compat.el (tramp-compat-process-running-p) (format-message): Remove compatibility code. (tramp-compat-directory-name-p) (tramp-compat-tramp-file-name-slots): Remove. * lisp/net/tramp.el (tramp-debug-message, tramp-message) (tramp-backtrace, tramp-error, tramp-error-with-buffer) (tramp-user-error, tramp-with-demoted-errors) (tramp-signal-hook-function): * lisp/net/tramp-compat.el (tramp-compat-funcall) * lisp/net/tramp-gvfs.el (tramp-dbus-function): Add `tramp-suppress-trace' property. * lisp/net/tramp.el (tramp-get-method-parameter) (tramp-dissect-file-name, tramp-error, tramp-error-with-buffer) (tramp-user-error, with-parsed-tramp-file-name) (with-tramp-progress-reporter, tramp-file-name-handler) (tramp-completion-file-name-handler, tramp-autoload-file-name-handler) (tramp-register-file-name-handlers, tramp-connectable-p) (tramp-handle-file-modes, tramp-handle-file-regular-p) (tramp-handle-file-truename, tramp-handle-insert-directory) (tramp-handle-load, tramp-set-file-uid-gid): * lisp/net/tramp-adb.el (tramp-adb-file-name-handler) (tramp-adb-handle-file-truename, tramp-adb-handle-copy-file) (tramp-adb-handle-rename-file): * lisp/net/tramp-archive.el (with-parsed-tramp-archive-file-name): * lisp/net/tramp-cache.el (tramp-get-file-property, tramp-cache-print): * lisp/net/tramp-compat.el (tramp-compat-process-running-p) (tramp-compat-exec-path): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler) (tramp-gvfs-dbus-byte-array-to-string) (tramp-gvfs-do-copy-or-rename-file): * lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler) (tramp-rclone-do-copy-or-rename-file): * lisp/net/tramp-sh.el (tramp-sh-handle-file-truename) (tramp-sh-handle-copy-directory, tramp-do-copy-or-rename-file) (tramp-sh-handle-insert-directory, tramp-sh-file-name-handler) (tramp-maybe-open-connection): * lisp/net/tramp-smb.el (tramp-smb-file-name-handler) (tramp-smb-handle-copy-file, tramp-smb-handle-copy-directory) (tramp-smb-handle-copy-file, tramp-smb-handle-insert-directory) (tramp-smb-handle-rename-file, tramp-smb-maybe-open-connection): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler) (tramp-sudoedit-do-copy-or-rename-file) (tramp-sudoedit-handle-file-truename): Use `if-let', `when-let', `directory-name-p', `inhibit-message', `non-essential and `cl-struct-slot-info'. Don't use `seconds-to-time'. * test/lisp/net/tramp-archive-tests.el (tramp-message-show-message): Don't set. * test/lisp/net/tramp-tests.el (inhibit-message): Don't declare. (tramp-message-show-message): Don't set. (tramp-test06-directory-file-name): Use `non-essential'. (tramp-test10-write-region): Use `inhibit-message'. (tramp-test36-vc-registered): No special handling for old Emacsen. (tramp--test-emacs25-p): Remove. (tramp-test45-unload): Special case of `tramp-completion-mode'.
2020-01-19 14:11:07 +01:00
(not (directory-name-p newname)))
(tramp-error v 'file-error "File is a directory %s" newname))
Sync with Tramp repository * doc/misc/tramp.texi (Configuration): Note, that Tramp must be required prior changing its configuration. (Connection caching, Predefined connection information) (Remote shell setup): Fix typos. (Predefined connection information): Describe, how to overwrite parameters of `tramp-methods'. (Remote programs, Remote processes, Traces and Profiles): Simplify example. (Remote programs): Remove superfluous comment. * doc/misc/trampver.texi: Update release number. * lisp/net/tramp-cache.el (tramp-connection-properties): Adapt docstring. * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file): New defun. (tramp-gvfs-handle-copy-file, tramp-gvfs-handle-rename-file): Use it. (tramp-gvfs-handle-make-directory): Reimplement PARENTS handling, "gvfs-mkdir -p ..." does not work robust. (tramp-gvfs-maybe-open-connection): Adapt `tramp-get-method-parameter' call. * lisp/net/tramp-sh.el (tramp-methods): Add `tramp-remote-shell-login' parameter where it fits. (tramp-get-remote-path): Use it. (tramp-make-copy-program-file-name): Fix quoting for "psftp" method. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/tramp.el (tramp-methods): Adapt docstring. (tramp-get-method-parameter): Replace argument METHOD by VEC. Check also for hits in `tramp-connection-properties'. Adapt docstring. (tramp-get-remote-tmpdir): Cache only the local name of tmpdir. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/trampver.el Update release number. * test/automated/tramp-tests.el (tramp--instrument-test-case): Add "^make-symbolic-link not supported$" to `debug-ignored-errors'. (tramp-test13-make-directory, tramp--test-adb-p) (tramp--test-smb-or-windows-nt-p): Simplify. (tramp--test-ftp-p, tramp--test-gvfs-p): New defuns. (tramp--test-special-characters): Fix docstring. Add gvfs and ftp tests. (tramp--test-utf8): Fix docstring.
2015-07-21 14:59:18 +02:00
(if (or (and equal-remote
(tramp-get-connection-property v "direct-copy-failed" nil))
(and t1 (not (tramp-gvfs-file-name-p filename)))
(and t2 (not (tramp-gvfs-file-name-p newname))))
;; We cannot copy or rename directly.
(let ((tmpfile (tramp-compat-make-temp-file filename)))
(if (eq op 'copy)
(copy-file
filename tmpfile t keep-date preserve-uid-gid
preserve-extended-attributes)
(rename-file filename tmpfile t))
Sync with Tramp repository * doc/misc/tramp.texi (Configuration): Note, that Tramp must be required prior changing its configuration. (Connection caching, Predefined connection information) (Remote shell setup): Fix typos. (Predefined connection information): Describe, how to overwrite parameters of `tramp-methods'. (Remote programs, Remote processes, Traces and Profiles): Simplify example. (Remote programs): Remove superfluous comment. * doc/misc/trampver.texi: Update release number. * lisp/net/tramp-cache.el (tramp-connection-properties): Adapt docstring. * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file): New defun. (tramp-gvfs-handle-copy-file, tramp-gvfs-handle-rename-file): Use it. (tramp-gvfs-handle-make-directory): Reimplement PARENTS handling, "gvfs-mkdir -p ..." does not work robust. (tramp-gvfs-maybe-open-connection): Adapt `tramp-get-method-parameter' call. * lisp/net/tramp-sh.el (tramp-methods): Add `tramp-remote-shell-login' parameter where it fits. (tramp-get-remote-path): Use it. (tramp-make-copy-program-file-name): Fix quoting for "psftp" method. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/tramp.el (tramp-methods): Adapt docstring. (tramp-get-method-parameter): Replace argument METHOD by VEC. Check also for hits in `tramp-connection-properties'. Adapt docstring. (tramp-get-remote-tmpdir): Cache only the local name of tmpdir. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/trampver.el Update release number. * test/automated/tramp-tests.el (tramp--instrument-test-case): Add "^make-symbolic-link not supported$" to `debug-ignored-errors'. (tramp-test13-make-directory, tramp--test-adb-p) (tramp--test-smb-or-windows-nt-p): Simplify. (tramp--test-ftp-p, tramp--test-gvfs-p): New defuns. (tramp--test-special-characters): Fix docstring. Add gvfs and ftp tests. (tramp--test-utf8): Fix docstring.
2015-07-21 14:59:18 +02:00
(rename-file tmpfile newname ok-if-already-exists))
;; Direct action.
(with-tramp-progress-reporter
v 0 (format "%s %s to %s" msg-operation filename newname)
(unless
(and (apply
#'tramp-gvfs-send-command v gvfs-operation
(append
(and (eq op 'copy) (or keep-date preserve-uid-gid)
'("--preserve"))
(list
(tramp-gvfs-url-file-name filename)
(tramp-gvfs-url-file-name newname))))
;; Some backends do not return a proper error
;; code in case of direct copy/move. Apply sanity checks.
(or (not equal-remote)
(tramp-gvfs-send-command
v "gvfs-info" (tramp-gvfs-url-file-name newname))
(eq op 'copy)
(not (tramp-gvfs-send-command
v "gvfs-info"
(tramp-gvfs-url-file-name filename)))))
Sync with Tramp repository * doc/misc/tramp.texi (Configuration): Note, that Tramp must be required prior changing its configuration. (Connection caching, Predefined connection information) (Remote shell setup): Fix typos. (Predefined connection information): Describe, how to overwrite parameters of `tramp-methods'. (Remote programs, Remote processes, Traces and Profiles): Simplify example. (Remote programs): Remove superfluous comment. * doc/misc/trampver.texi: Update release number. * lisp/net/tramp-cache.el (tramp-connection-properties): Adapt docstring. * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file): New defun. (tramp-gvfs-handle-copy-file, tramp-gvfs-handle-rename-file): Use it. (tramp-gvfs-handle-make-directory): Reimplement PARENTS handling, "gvfs-mkdir -p ..." does not work robust. (tramp-gvfs-maybe-open-connection): Adapt `tramp-get-method-parameter' call. * lisp/net/tramp-sh.el (tramp-methods): Add `tramp-remote-shell-login' parameter where it fits. (tramp-get-remote-path): Use it. (tramp-make-copy-program-file-name): Fix quoting for "psftp" method. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/tramp.el (tramp-methods): Adapt docstring. (tramp-get-method-parameter): Replace argument METHOD by VEC. Check also for hits in `tramp-connection-properties'. Adapt docstring. (tramp-get-remote-tmpdir): Cache only the local name of tmpdir. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/trampver.el Update release number. * test/automated/tramp-tests.el (tramp--instrument-test-case): Add "^make-symbolic-link not supported$" to `debug-ignored-errors'. (tramp-test13-make-directory, tramp--test-adb-p) (tramp--test-smb-or-windows-nt-p): Simplify. (tramp--test-ftp-p, tramp--test-gvfs-p): New defuns. (tramp--test-special-characters): Fix docstring. Add gvfs and ftp tests. (tramp--test-utf8): Fix docstring.
2015-07-21 14:59:18 +02:00
(if (or (not equal-remote)
(and equal-remote
(tramp-get-connection-property
v "direct-copy-failed" nil)))
;; Propagate the error.
(with-current-buffer (tramp-get-connection-buffer v)
(goto-char (point-min))
(tramp-error-with-buffer
nil v 'file-error
"%s failed, see buffer `%s' for details."
Sync with Tramp repository * doc/misc/tramp.texi (Configuration): Note, that Tramp must be required prior changing its configuration. (Connection caching, Predefined connection information) (Remote shell setup): Fix typos. (Predefined connection information): Describe, how to overwrite parameters of `tramp-methods'. (Remote programs, Remote processes, Traces and Profiles): Simplify example. (Remote programs): Remove superfluous comment. * doc/misc/trampver.texi: Update release number. * lisp/net/tramp-cache.el (tramp-connection-properties): Adapt docstring. * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file): New defun. (tramp-gvfs-handle-copy-file, tramp-gvfs-handle-rename-file): Use it. (tramp-gvfs-handle-make-directory): Reimplement PARENTS handling, "gvfs-mkdir -p ..." does not work robust. (tramp-gvfs-maybe-open-connection): Adapt `tramp-get-method-parameter' call. * lisp/net/tramp-sh.el (tramp-methods): Add `tramp-remote-shell-login' parameter where it fits. (tramp-get-remote-path): Use it. (tramp-make-copy-program-file-name): Fix quoting for "psftp" method. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/tramp.el (tramp-methods): Adapt docstring. (tramp-get-method-parameter): Replace argument METHOD by VEC. Check also for hits in `tramp-connection-properties'. Adapt docstring. (tramp-get-remote-tmpdir): Cache only the local name of tmpdir. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/trampver.el Update release number. * test/automated/tramp-tests.el (tramp--instrument-test-case): Add "^make-symbolic-link not supported$" to `debug-ignored-errors'. (tramp-test13-make-directory, tramp--test-adb-p) (tramp--test-smb-or-windows-nt-p): Simplify. (tramp--test-ftp-p, tramp--test-gvfs-p): New defuns. (tramp--test-special-characters): Fix docstring. Add gvfs and ftp tests. (tramp--test-utf8): Fix docstring.
2015-07-21 14:59:18 +02:00
msg-operation (buffer-name)))
;; Some WebDAV server, like the one from QNAP, do not
;; support direct copy/move. Try a fallback.
(tramp-set-connection-property v "direct-copy-failed" t)
(tramp-gvfs-do-copy-or-rename-file
op filename newname ok-if-already-exists keep-date
preserve-uid-gid preserve-extended-attributes))))
(when (and t1 (eq op 'rename))
(with-parsed-tramp-file-name filename nil
Extend tramp-cache.el interface * lisp/net/tramp.el (tramp-handle-add-name-to-file) (tramp-handle-dired-uncache): * lisp/net/tramp-adb.el (tramp-adb-handle-make-directory) (tramp-adb-handle-delete-directory, tramp-adb-handle-delete-file) (tramp-adb-handle-write-region, tramp-adb-handle-set-file-modes) (tramp-adb-handle-set-file-times, tramp-adb-handle-copy-file) (tramp-adb-handle-rename-file, tramp-adb-handle-process-file) (tramp-adb-handle-start-file-process, tramp-adb-get-device) (tramp-adb-maybe-open-connection): * lisp/net/tramp-cache.el (tramp-flush-file-properties) (tramp-flush-directory-properties, tramp-flush-file-function): * lisp/net/tramp-cmds.el (tramp-cleanup-connection): * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file) (tramp-gvfs-handle-delete-directory, tramp-gvfs-handle-delete-file) (tramp-gvfs-handle-file-system-info, tramp-gvfs-handle-make-directory) (tramp-gvfs-handle-write-region, tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-send-command): * lisp/net/tramp-sh.el (tramp-sh-handle-make-symbolic-link) (tramp-sh-handle-set-file-modes, tramp-sh-handle-set-file-times) (tramp-sh-handle-set-file-selinux-context, tramp-sh-handle-set-file-acl) (tramp-sh-handle-add-name-to-file, tramp-sh-handle-copy-directory) (tramp-do-copy-or-rename-file, tramp-do-copy-or-rename-file-out-of-band) (tramp-sh-handle-make-directory, tramp-sh-handle-delete-directory) (tramp-sh-handle-delete-file, tramp-sh-handle-dired-compress-file) (tramp-process-sentinel, tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-sh-handle-write-region): * lisp/net/tramp-smb.el (tramp-smb-handle-add-name-to-file) (tramp-smb-handle-copy-directory, tramp-smb-handle-copy-file) (tramp-smb-handle-delete-directory, tramp-smb-handle-delete-file) (tramp-smb-handle-file-acl, tramp-smb-handle-make-directory-internal) (tramp-smb-handle-make-symbolic-link, tramp-smb-handle-process-file) (tramp-smb-handle-rename-file, tramp-smb-handle-set-file-acl) (tramp-smb-handle-set-file-modes, tramp-smb-handle-start-file-process) (tramp-smb-handle-write-region, tramp-smb-maybe-open-connection): Use them. * lisp/net/tramp-cache.el (tramp-flush-file-properties) (tramp-flush-directory-properties, tramp-flush-connection-properties): Rename from `tramp-flush-file-property',`tramp-flush-directory-property' and `tramp-flush-connection-property', respectively. (tramp-flush-file-property, tramp-flush-connection-property): New defuns.
2017-12-12 15:46:17 +01:00
(tramp-flush-file-properties v localname)))
Sync with Tramp repository * doc/misc/tramp.texi (Configuration): Note, that Tramp must be required prior changing its configuration. (Connection caching, Predefined connection information) (Remote shell setup): Fix typos. (Predefined connection information): Describe, how to overwrite parameters of `tramp-methods'. (Remote programs, Remote processes, Traces and Profiles): Simplify example. (Remote programs): Remove superfluous comment. * doc/misc/trampver.texi: Update release number. * lisp/net/tramp-cache.el (tramp-connection-properties): Adapt docstring. * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file): New defun. (tramp-gvfs-handle-copy-file, tramp-gvfs-handle-rename-file): Use it. (tramp-gvfs-handle-make-directory): Reimplement PARENTS handling, "gvfs-mkdir -p ..." does not work robust. (tramp-gvfs-maybe-open-connection): Adapt `tramp-get-method-parameter' call. * lisp/net/tramp-sh.el (tramp-methods): Add `tramp-remote-shell-login' parameter where it fits. (tramp-get-remote-path): Use it. (tramp-make-copy-program-file-name): Fix quoting for "psftp" method. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/tramp.el (tramp-methods): Adapt docstring. (tramp-get-method-parameter): Replace argument METHOD by VEC. Check also for hits in `tramp-connection-properties'. Adapt docstring. (tramp-get-remote-tmpdir): Cache only the local name of tmpdir. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/trampver.el Update release number. * test/automated/tramp-tests.el (tramp--instrument-test-case): Add "^make-symbolic-link not supported$" to `debug-ignored-errors'. (tramp-test13-make-directory, tramp--test-adb-p) (tramp--test-smb-or-windows-nt-p): Simplify. (tramp--test-ftp-p, tramp--test-gvfs-p): New defuns. (tramp--test-special-characters): Fix docstring. Add gvfs and ftp tests. (tramp--test-utf8): Fix docstring.
2015-07-21 14:59:18 +02:00
(when t2
(with-parsed-tramp-file-name newname nil
Extend tramp-cache.el interface * lisp/net/tramp.el (tramp-handle-add-name-to-file) (tramp-handle-dired-uncache): * lisp/net/tramp-adb.el (tramp-adb-handle-make-directory) (tramp-adb-handle-delete-directory, tramp-adb-handle-delete-file) (tramp-adb-handle-write-region, tramp-adb-handle-set-file-modes) (tramp-adb-handle-set-file-times, tramp-adb-handle-copy-file) (tramp-adb-handle-rename-file, tramp-adb-handle-process-file) (tramp-adb-handle-start-file-process, tramp-adb-get-device) (tramp-adb-maybe-open-connection): * lisp/net/tramp-cache.el (tramp-flush-file-properties) (tramp-flush-directory-properties, tramp-flush-file-function): * lisp/net/tramp-cmds.el (tramp-cleanup-connection): * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file) (tramp-gvfs-handle-delete-directory, tramp-gvfs-handle-delete-file) (tramp-gvfs-handle-file-system-info, tramp-gvfs-handle-make-directory) (tramp-gvfs-handle-write-region, tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-send-command): * lisp/net/tramp-sh.el (tramp-sh-handle-make-symbolic-link) (tramp-sh-handle-set-file-modes, tramp-sh-handle-set-file-times) (tramp-sh-handle-set-file-selinux-context, tramp-sh-handle-set-file-acl) (tramp-sh-handle-add-name-to-file, tramp-sh-handle-copy-directory) (tramp-do-copy-or-rename-file, tramp-do-copy-or-rename-file-out-of-band) (tramp-sh-handle-make-directory, tramp-sh-handle-delete-directory) (tramp-sh-handle-delete-file, tramp-sh-handle-dired-compress-file) (tramp-process-sentinel, tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-sh-handle-write-region): * lisp/net/tramp-smb.el (tramp-smb-handle-add-name-to-file) (tramp-smb-handle-copy-directory, tramp-smb-handle-copy-file) (tramp-smb-handle-delete-directory, tramp-smb-handle-delete-file) (tramp-smb-handle-file-acl, tramp-smb-handle-make-directory-internal) (tramp-smb-handle-make-symbolic-link, tramp-smb-handle-process-file) (tramp-smb-handle-rename-file, tramp-smb-handle-set-file-acl) (tramp-smb-handle-set-file-modes, tramp-smb-handle-start-file-process) (tramp-smb-handle-write-region, tramp-smb-maybe-open-connection): Use them. * lisp/net/tramp-cache.el (tramp-flush-file-properties) (tramp-flush-directory-properties, tramp-flush-connection-properties): Rename from `tramp-flush-file-property',`tramp-flush-directory-property' and `tramp-flush-connection-property', respectively. (tramp-flush-file-property, tramp-flush-connection-property): New defuns.
2017-12-12 15:46:17 +01:00
(tramp-flush-file-properties v localname))))))))
Sync with Tramp repository * doc/misc/tramp.texi (Configuration): Note, that Tramp must be required prior changing its configuration. (Connection caching, Predefined connection information) (Remote shell setup): Fix typos. (Predefined connection information): Describe, how to overwrite parameters of `tramp-methods'. (Remote programs, Remote processes, Traces and Profiles): Simplify example. (Remote programs): Remove superfluous comment. * doc/misc/trampver.texi: Update release number. * lisp/net/tramp-cache.el (tramp-connection-properties): Adapt docstring. * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file): New defun. (tramp-gvfs-handle-copy-file, tramp-gvfs-handle-rename-file): Use it. (tramp-gvfs-handle-make-directory): Reimplement PARENTS handling, "gvfs-mkdir -p ..." does not work robust. (tramp-gvfs-maybe-open-connection): Adapt `tramp-get-method-parameter' call. * lisp/net/tramp-sh.el (tramp-methods): Add `tramp-remote-shell-login' parameter where it fits. (tramp-get-remote-path): Use it. (tramp-make-copy-program-file-name): Fix quoting for "psftp" method. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/tramp.el (tramp-methods): Adapt docstring. (tramp-get-method-parameter): Replace argument METHOD by VEC. Check also for hits in `tramp-connection-properties'. Adapt docstring. (tramp-get-remote-tmpdir): Cache only the local name of tmpdir. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/trampver.el Update release number. * test/automated/tramp-tests.el (tramp--instrument-test-case): Add "^make-symbolic-link not supported$" to `debug-ignored-errors'. (tramp-test13-make-directory, tramp--test-adb-p) (tramp--test-smb-or-windows-nt-p): Simplify. (tramp--test-ftp-p, tramp--test-gvfs-p): New defuns. (tramp--test-special-characters): Fix docstring. Add gvfs and ftp tests. (tramp--test-utf8): Fix docstring.
2015-07-21 14:59:18 +02:00
2009-06-22 21:04:49 +00:00
(defun tramp-gvfs-handle-copy-file
(filename newname &optional ok-if-already-exists keep-date
preserve-uid-gid preserve-extended-attributes)
2009-06-22 21:04:49 +00:00
"Like `copy-file' for Tramp files."
(setq filename (expand-file-name filename)
newname (expand-file-name newname))
;; At least one file a Tramp file?
(if (or (tramp-tramp-file-p filename)
(tramp-tramp-file-p newname))
(tramp-gvfs-do-copy-or-rename-file
'copy filename newname ok-if-already-exists keep-date
preserve-uid-gid preserve-extended-attributes)
Sync with Tramp repository * doc/misc/tramp.texi (Configuration): Note, that Tramp must be required prior changing its configuration. (Connection caching, Predefined connection information) (Remote shell setup): Fix typos. (Predefined connection information): Describe, how to overwrite parameters of `tramp-methods'. (Remote programs, Remote processes, Traces and Profiles): Simplify example. (Remote programs): Remove superfluous comment. * doc/misc/trampver.texi: Update release number. * lisp/net/tramp-cache.el (tramp-connection-properties): Adapt docstring. * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file): New defun. (tramp-gvfs-handle-copy-file, tramp-gvfs-handle-rename-file): Use it. (tramp-gvfs-handle-make-directory): Reimplement PARENTS handling, "gvfs-mkdir -p ..." does not work robust. (tramp-gvfs-maybe-open-connection): Adapt `tramp-get-method-parameter' call. * lisp/net/tramp-sh.el (tramp-methods): Add `tramp-remote-shell-login' parameter where it fits. (tramp-get-remote-path): Use it. (tramp-make-copy-program-file-name): Fix quoting for "psftp" method. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/tramp.el (tramp-methods): Adapt docstring. (tramp-get-method-parameter): Replace argument METHOD by VEC. Check also for hits in `tramp-connection-properties'. Adapt docstring. (tramp-get-remote-tmpdir): Cache only the local name of tmpdir. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/trampver.el Update release number. * test/automated/tramp-tests.el (tramp--instrument-test-case): Add "^make-symbolic-link not supported$" to `debug-ignored-errors'. (tramp-test13-make-directory, tramp--test-adb-p) (tramp--test-smb-or-windows-nt-p): Simplify. (tramp--test-ftp-p, tramp--test-gvfs-p): New defuns. (tramp--test-special-characters): Fix docstring. Add gvfs and ftp tests. (tramp--test-utf8): Fix docstring.
2015-07-21 14:59:18 +02:00
(tramp-run-real-handler
'copy-file
(list filename newname ok-if-already-exists keep-date
preserve-uid-gid preserve-extended-attributes))))
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(defun tramp-gvfs-handle-delete-directory (directory &optional recursive trash)
2009-06-22 21:04:49 +00:00
"Like `delete-directory' for Tramp files."
(tramp-skeleton-delete-directory directory recursive trash
(if (and recursive (not (file-symlink-p directory)))
(mapc (lambda (file)
Use `file-attribute-*' in Tramp * lisp/net/tramp-compat.el (tramp-compat-file-attribute-type) (tramp-compat-file-attribute-link-number) (tramp-compat-file-attribute-user-id) (tramp-compat-file-attribute-group-id) (tramp-compat-file-attribute-modification-time) (tramp-compat-file-attribute-size) (tramp-compat-file-attribute-modes): New defaliases. * lisp/net/tramp.el (tramp-handle-file-modes) (tramp-handle-file-newer-than-file-p) (tramp-handle-file-regular-p, tramp-handle-file-symlink-p) (tramp-handle-set-visited-file-modtime) (tramp-handle-verify-visited-file-modtime) (tramp-get-local-gid, tramp-check-cached-permissions): * lisp/net/tramp-adb.el (tramp-adb-handle-file-directory-p) (tramp-adb-handle-file-truename, tramp-adb-handle-copy-file): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-delete-directory) (tramp-gvfs-handle-file-directory-p) (tramp-gvfs-handle-write-region, tramp-gvfs-get-remote-uid) (tramp-gvfs-get-remote-gid): * lisp/net/tramp-sh.el (tramp-sh-handle-file-truename) (tramp-sh-handle-set-visited-file-modtime) (tramp-sh-handle-verify-visited-file-modtime) (tramp-sh-handle-file-newer-than-file-p) (tramp-sh-handle-file-ownership-preserved-p) (tramp-do-copy-or-rename-file) (tramp-do-copy-or-rename-file-via-buffer) (tramp-do-copy-or-rename-file-directly) (tramp-do-copy-or-rename-file-out-of-band) (tramp-sh-handle-file-local-copy) (tramp-sh-handle-write-region): * lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory) (tramp-smb-handle-copy-file) (tramp-smb-handle-file-directory-p) (tramp-smb-handle-file-writable-p) (tramp-smb-handle-insert-directory): Use them.
2016-08-30 15:36:14 +02:00
(if (eq t (tramp-compat-file-attribute-type
(file-attributes file)))
(delete-directory file recursive)
(delete-file file)))
(directory-files
directory 'full directory-files-no-dot-files-regexp))
(unless (tramp-compat-directory-empty-p directory)
(tramp-error
v 'file-error "Couldn't delete non-empty %s" directory)))
(unless (tramp-gvfs-send-command
v "gvfs-rm" (tramp-gvfs-url-file-name directory))
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
;; Propagate the error.
(with-current-buffer (tramp-get-connection-buffer v)
(goto-char (point-min))
(tramp-error-with-buffer
nil v 'file-error "Couldn't delete %s" directory)))))
2009-06-22 21:04:49 +00:00
(defun tramp-gvfs-handle-delete-file (filename &optional trash)
2009-06-22 21:04:49 +00:00
"Like `delete-file' for Tramp files."
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(with-parsed-tramp-file-name filename nil
Extend tramp-cache.el interface * lisp/net/tramp.el (tramp-handle-add-name-to-file) (tramp-handle-dired-uncache): * lisp/net/tramp-adb.el (tramp-adb-handle-make-directory) (tramp-adb-handle-delete-directory, tramp-adb-handle-delete-file) (tramp-adb-handle-write-region, tramp-adb-handle-set-file-modes) (tramp-adb-handle-set-file-times, tramp-adb-handle-copy-file) (tramp-adb-handle-rename-file, tramp-adb-handle-process-file) (tramp-adb-handle-start-file-process, tramp-adb-get-device) (tramp-adb-maybe-open-connection): * lisp/net/tramp-cache.el (tramp-flush-file-properties) (tramp-flush-directory-properties, tramp-flush-file-function): * lisp/net/tramp-cmds.el (tramp-cleanup-connection): * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file) (tramp-gvfs-handle-delete-directory, tramp-gvfs-handle-delete-file) (tramp-gvfs-handle-file-system-info, tramp-gvfs-handle-make-directory) (tramp-gvfs-handle-write-region, tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-send-command): * lisp/net/tramp-sh.el (tramp-sh-handle-make-symbolic-link) (tramp-sh-handle-set-file-modes, tramp-sh-handle-set-file-times) (tramp-sh-handle-set-file-selinux-context, tramp-sh-handle-set-file-acl) (tramp-sh-handle-add-name-to-file, tramp-sh-handle-copy-directory) (tramp-do-copy-or-rename-file, tramp-do-copy-or-rename-file-out-of-band) (tramp-sh-handle-make-directory, tramp-sh-handle-delete-directory) (tramp-sh-handle-delete-file, tramp-sh-handle-dired-compress-file) (tramp-process-sentinel, tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-sh-handle-write-region): * lisp/net/tramp-smb.el (tramp-smb-handle-add-name-to-file) (tramp-smb-handle-copy-directory, tramp-smb-handle-copy-file) (tramp-smb-handle-delete-directory, tramp-smb-handle-delete-file) (tramp-smb-handle-file-acl, tramp-smb-handle-make-directory-internal) (tramp-smb-handle-make-symbolic-link, tramp-smb-handle-process-file) (tramp-smb-handle-rename-file, tramp-smb-handle-set-file-acl) (tramp-smb-handle-set-file-modes, tramp-smb-handle-start-file-process) (tramp-smb-handle-write-region, tramp-smb-maybe-open-connection): Use them. * lisp/net/tramp-cache.el (tramp-flush-file-properties) (tramp-flush-directory-properties, tramp-flush-connection-properties): Rename from `tramp-flush-file-property',`tramp-flush-directory-property' and `tramp-flush-connection-property', respectively. (tramp-flush-file-property, tramp-flush-connection-property): New defuns.
2017-12-12 15:46:17 +01:00
(tramp-flush-file-properties v localname)
(if (and delete-by-moving-to-trash trash)
(move-file-to-trash filename)
(unless (tramp-gvfs-send-command
v "gvfs-rm" (tramp-gvfs-url-file-name filename))
;; Propagate the error.
(with-current-buffer (tramp-get-connection-buffer v)
(goto-char (point-min))
(tramp-error-with-buffer
nil v 'file-error "Couldn't delete %s" filename))))))
2009-06-22 21:04:49 +00:00
(defun tramp-gvfs-handle-expand-file-name (name &optional dir)
"Like `expand-file-name' for Tramp files."
;; If DIR is not given, use DEFAULT-DIRECTORY or "/".
(setq dir (or dir default-directory "/"))
;; Handle empty NAME.
(when (zerop (length name)) (setq name "."))
2009-06-22 21:04:49 +00:00
;; Unless NAME is absolute, concat DIR and NAME.
(unless (file-name-absolute-p name)
(setq name (concat (file-name-as-directory dir) name)))
;; If NAME is not a Tramp file, run the real handler.
(if (not (tramp-tramp-file-p name))
(tramp-run-real-handler #'expand-file-name (list name nil))
2009-06-22 21:04:49 +00:00
;; Dissect NAME.
(with-parsed-tramp-file-name name nil
;; If there is a default location, expand tilde.
(when (string-match "\\`\\(~\\)\\(/\\|\\'\\)" localname)
(save-match-data
Introduce a defstruct `tramp-file-name' as central data structure. 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.
2017-05-24 16:16:53 +02:00
(tramp-gvfs-maybe-open-connection
(make-tramp-file-name
:method method :user user :domain domain
:host host :port port :localname "/" :hop hop)))
(setq localname
(replace-match
(tramp-get-connection-property v "default-location" "~")
nil t localname 1)))
2009-06-22 21:04:49 +00:00
;; Tilde expansion is not possible.
Rework Tramp wrt string-match-p, looking-at-p, save-match-data * lisp/net/tramp.el (tramp-find-method, tramp-find-user) (tramp-find-host, tramp-dissect-file-name, tramp-make-tramp-file-name) (tramp-completion-make-tramp-file-name, tramp-debug-message) (tramp-message, tramp-progress-reporter-update) (tramp-set-completion-function) (tramp-rfn-eshadow-update-overlay) (tramp-find-file-name-coding-system-alist) (tramp-file-name-for-operation) (tramp-use-absolute-autoload-file-names) (tramp-get-completion-methods, tramp-get-completion-user-host) (tramp-handle-directory-files) (tramp-handle-file-name-case-insensitive-p) (tramp-handle-file-name-completion, tramp-handle-file-truename) (tramp-handle-insert-directory, tramp-handle-load) (tramp-handle-shell-command, tramp-action-yesno) (tramp-action-yn, tramp-process-actions) (tramp-mode-string-to-int, tramp-get-local-locale) (tramp-local-host-p): * lisp/net/tramp-adb.el (tramp-adb-handle-file-system-info) (tramp-adb-handle-directory-files-and-attributes) (tramp-adb--gnu-switches-to-ash, tramp-adb-sh-fix-ls-output) (tramp-adb-handle-file-name-all-completions) (tramp-adb-handle-shell-command) (tramp-adb-handle-start-file-process): * lisp/net/tramp-archive.el (tramp-archive-dissect-file-name): * lisp/net/tramp-cache.el (tramp-get-hash-table) (tramp-flush-directory-properties, tramp-flush-file-function): * lisp/net/tramp-cmds.el (tramp-reporter-dump-variable) (tramp-append-tramp-buffers): * lisp/net/tramp-compat.el (tramp-compat-process-running-p): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name) (tramp-gvfs-get-file-attributes) (tramp-gvfs-handle-file-attributes) (tramp-gvfs-monitor-process-filter) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec-entry) (tramp-gvfs-mount-spec, tramp-gvfs-maybe-open-connection): * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls) (tramp-do-file-attributes-with-stat) (tramp-sh-handle-file-selinux-context) (tramp-sh-handle-directory-files-and-attributes) (tramp-do-directory-files-and-attributes-with-stat) (tramp-sh-handle-file-name-all-completions) (tramp-sh-handle-dired-compress-file) (tramp-sh-handle-insert-directory) (tramp-sh-handle-expand-file-name) (tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-sh-handle-write-region) (tramp-sh-handle-file-notify-add-watch) (tramp-sh-gio-monitor-process-filter) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter) (tramp-sh-handle-file-system-info, tramp-maybe-send-script) (tramp-find-executable, tramp-open-shell, tramp-find-shell) (tramp-open-connection-setup-interactive-shell) (tramp-find-inline-encoding, tramp-call-local-coding-command) (tramp-compute-multi-hops, tramp-maybe-open-connection) (tramp-convert-file-attributes) (tramp-make-copy-program-file-name, tramp-get-remote-locale) (tramp-get-test-nt-command, tramp-get-remote-stat) (tramp-get-inline-coding): * lisp/net/tramp-smb.el (tramp-smb-handle-directory-files) (tramp-smb-action-get-acl, tramp-smb-handle-file-attributes) (tramp-smb-handle-file-name-all-completions) (tramp-smb-handle-file-system-info) (tramp-smb-handle-file-writable-p) (tramp-smb-handle-insert-directory) (tramp-smb-handle-make-directory) (tramp-smb-handle-make-directory-internal) (tramp-smb-handle-start-file-process, tramp-smb-get-localname) (tramp-smb-read-file-entry): Use `string-match-p' and `looking-at-p'. Remove superfluous `save-match-data'. Apply `eval-when-compile' on constant concat data. * lisp/net/tramp-compat.el (tramp-compat-file-name-quoted-p-p): Use `string-prefix-p'. (tramp-compat-file-name-unquote): Do not use match data.
2018-12-06 16:00:05 +01:00
(when (string-match-p "\\`\\(~[^/]*\\)\\(.*\\)\\'" localname)
2009-06-22 21:04:49 +00:00
(tramp-error
v 'file-error
"Cannot expand tilde in file `%s'" name))
(unless (tramp-run-real-handler #'file-name-absolute-p (list localname))
2009-06-22 21:04:49 +00:00
(setq localname (concat "/" localname)))
;; We do not pass "/..".
Rework Tramp wrt string-match-p, looking-at-p, save-match-data * lisp/net/tramp.el (tramp-find-method, tramp-find-user) (tramp-find-host, tramp-dissect-file-name, tramp-make-tramp-file-name) (tramp-completion-make-tramp-file-name, tramp-debug-message) (tramp-message, tramp-progress-reporter-update) (tramp-set-completion-function) (tramp-rfn-eshadow-update-overlay) (tramp-find-file-name-coding-system-alist) (tramp-file-name-for-operation) (tramp-use-absolute-autoload-file-names) (tramp-get-completion-methods, tramp-get-completion-user-host) (tramp-handle-directory-files) (tramp-handle-file-name-case-insensitive-p) (tramp-handle-file-name-completion, tramp-handle-file-truename) (tramp-handle-insert-directory, tramp-handle-load) (tramp-handle-shell-command, tramp-action-yesno) (tramp-action-yn, tramp-process-actions) (tramp-mode-string-to-int, tramp-get-local-locale) (tramp-local-host-p): * lisp/net/tramp-adb.el (tramp-adb-handle-file-system-info) (tramp-adb-handle-directory-files-and-attributes) (tramp-adb--gnu-switches-to-ash, tramp-adb-sh-fix-ls-output) (tramp-adb-handle-file-name-all-completions) (tramp-adb-handle-shell-command) (tramp-adb-handle-start-file-process): * lisp/net/tramp-archive.el (tramp-archive-dissect-file-name): * lisp/net/tramp-cache.el (tramp-get-hash-table) (tramp-flush-directory-properties, tramp-flush-file-function): * lisp/net/tramp-cmds.el (tramp-reporter-dump-variable) (tramp-append-tramp-buffers): * lisp/net/tramp-compat.el (tramp-compat-process-running-p): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name) (tramp-gvfs-get-file-attributes) (tramp-gvfs-handle-file-attributes) (tramp-gvfs-monitor-process-filter) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec-entry) (tramp-gvfs-mount-spec, tramp-gvfs-maybe-open-connection): * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls) (tramp-do-file-attributes-with-stat) (tramp-sh-handle-file-selinux-context) (tramp-sh-handle-directory-files-and-attributes) (tramp-do-directory-files-and-attributes-with-stat) (tramp-sh-handle-file-name-all-completions) (tramp-sh-handle-dired-compress-file) (tramp-sh-handle-insert-directory) (tramp-sh-handle-expand-file-name) (tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-sh-handle-write-region) (tramp-sh-handle-file-notify-add-watch) (tramp-sh-gio-monitor-process-filter) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter) (tramp-sh-handle-file-system-info, tramp-maybe-send-script) (tramp-find-executable, tramp-open-shell, tramp-find-shell) (tramp-open-connection-setup-interactive-shell) (tramp-find-inline-encoding, tramp-call-local-coding-command) (tramp-compute-multi-hops, tramp-maybe-open-connection) (tramp-convert-file-attributes) (tramp-make-copy-program-file-name, tramp-get-remote-locale) (tramp-get-test-nt-command, tramp-get-remote-stat) (tramp-get-inline-coding): * lisp/net/tramp-smb.el (tramp-smb-handle-directory-files) (tramp-smb-action-get-acl, tramp-smb-handle-file-attributes) (tramp-smb-handle-file-name-all-completions) (tramp-smb-handle-file-system-info) (tramp-smb-handle-file-writable-p) (tramp-smb-handle-insert-directory) (tramp-smb-handle-make-directory) (tramp-smb-handle-make-directory-internal) (tramp-smb-handle-start-file-process, tramp-smb-get-localname) (tramp-smb-read-file-entry): Use `string-match-p' and `looking-at-p'. Remove superfluous `save-match-data'. Apply `eval-when-compile' on constant concat data. * lisp/net/tramp-compat.el (tramp-compat-file-name-quoted-p-p): Use `string-prefix-p'. (tramp-compat-file-name-unquote): Do not use match data.
2018-12-06 16:00:05 +01:00
(if (string-match-p "^\\(afp\\|davs?\\|smb\\)$" method)
2009-06-22 21:04:49 +00:00
(when (string-match "^/[^/]+\\(/\\.\\./?\\)" localname)
(setq localname (replace-match "/" t t localname 1)))
(when (string-match "^/\\.\\./?" localname)
(setq localname (replace-match "/" t t localname))))
;; There might be a double slash. Remove this.
(while (string-match "//" localname)
(setq localname (replace-match "/" t t localname)))
;; No tilde characters in file name, do normal
;; `expand-file-name' (this does "/./" and "/../").
(tramp-make-tramp-file-name
v (tramp-run-real-handler #'expand-file-name (list localname))))))
2009-06-22 21:04:49 +00:00
Sync with Tramp repository. * lisp/net/tramp-adb.el (tramp-adb-handle-start-file-process): * lisp/net/tramp-sh.el (tramp-sh-handle-start-file-process) * lisp/net/tramp-smb.el (tramp-smb-handle-start-file-process): Create BUFFER if it doesn't exist. Reported by Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com>. * lisp/net/tramp-gvfs.el (tramp-gvfs-file-attributes) (tramp-gvfs-file-attributes-with-gvfs-ls-regexp) (tramp-gvfs-file-attributes-with-gvfs-info-regexp): New defconst. (tramp-gvfs-get-directory-attributes) (tramp-gvfs-get-root-attributes) (tramp-gvfs-get-file-attributes): New defun. (tramp-gvfs-handle-file-attributes) (tramp-gvfs-handle-file-name-all-completions): Use them. (tramp-gvfs-handle-file-directory-p): Use `file-truename'. (tramp-gvfs-maybe-open-connection): Set :noquery flag for process. (tramp-gvfs-send-command): Add locale settings to `process-environment'. (top): Suppress D-Bus error messages during zeroconf initialization. * lisp/net/tramp.el (tramp-unknown-id-string) (tramp-unknown-id-integer): New defconst. (tramp-check-cached-permissions) * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-attributes) * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls) (tramp-convert-file-attributes, tramp-get-remote-uid) (tramp-get-remote-gid): Use them. * lisp/net/tramp-sh.el (tramp-display-escape-sequence-regexp): Rename from `tramp-color-escape-sequence-regexp'. (tramp-sh-handle-insert-directory) (tramp-convert-file-attributes): Adapt callees. (tramp-device-escape-sequence-regexp): New defconst. (tramp-wait-for-output): Use it. Reported by Matthías Páll Gissurarson <icetritlo@gmail.com>. * lisp/net/tramp-smb.el (tramp-smb-handle-file-name-all-completions): Simplify. * test/lisp/net/tramp-tests.el (tramp-test26-process-file) (tramp-test28-shell-command): Use `tramp-display-escape-sequence-regexp'.
2016-05-28 12:14:58 +02:00
(defun tramp-gvfs-get-directory-attributes (directory)
"Return GVFS attributes association list of all files in DIRECTORY."
;; Don't modify `last-coding-system-used' by accident.
(let ((last-coding-system-used last-coding-system-used)
result)
(with-parsed-tramp-file-name directory nil
(with-tramp-file-property v localname "directory-attributes"
(tramp-message v 5 "directory gvfs attributes: %s" localname)
;; Send command.
(tramp-gvfs-send-command
v "gvfs-ls" "-h"
(unless (string-equal (file-remote-p directory 'method) "gdrive") "-n")
"-a" (string-join tramp-gvfs-file-attributes ",")
(tramp-gvfs-url-file-name directory))
;; Parse output.
(with-current-buffer (tramp-get-connection-buffer v)
(goto-char (point-min))
(while (looking-at
Tramp code cleanup * lisp/net/tramp.el (tramp-shell-prompt-pattern) (tramp-wrong-passwd-regexp, tramp-method-regexp-alist) (tramp-domain-regexp, tramp-host-regexp, tramp-ipv6-regexp) (tramp-port-regexp, tramp-debug-outline-regexp) (tramp-drop-volume-letter, tramp-parse-shostkeys) (tramp-handle-file-name-case-insensitive-p): * lisp/net/tramp-adb.el (tramp-adb-send-command-and-check): * lisp/net/tramp-ftp.el (tramp-ftp-enable-ange-ftp): * lisp/net/tramp-gvfs.el (tramp-gvfs-monitor-process-filter): * lisp/net/tramp-sh.el (tramp-display-escape-sequence-regexp) (tramp-device-escape-sequence-regexp): * lisp/net/tramp-smb.el (tramp-smb-do-file-attributes-with-stat) (tramp-smb-handle-set-file-acl, tramp-smb-read-file-entry): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-file-selinux-context): Use character classes in regexp. * lisp/net/tramp-adb.el (tramp-adb-ls-date-year-regexp) (tramp-adb-ls-date-time-regexp): New defconst. (tramp-adb-ls-date-regexp, tramp-adb-ls-toolbox-regexp) (tramp-adb-sh-fix-ls-output): Use them. (tramp-adb-handle-set-file-times, tramp-adb-maybe-open-connection): Apply `eval-when-compile' on constant concat data. (tramp-do-parse-file-attributes-with-ls): Suppress `signal-hook-function'. (tramp-adb--gnu-switches-to-ash): Remove unused function. (tramp-adb-handle-set-file-modes): Qhote argument. (tramp-adb-maybe-open-connection): Set file property rather than flush. * lisp/net/tramp-cmds.el (tramp-rename-these-files): Apply `eval-when-compile' on constant concat data. * lisp/net/tramp-gvfs.el (tramp-gvfs-file-attributes) (tramp-gvfs-file-attributes-with-gvfs-ls-regexp): Embed them in `eval-and-compile'. (tramp-gvfs-get-directory-attributes): Apply `eval-when-compile' on constant concat data.
2020-07-10 10:45:14 +02:00
(eval-when-compile
(concat "^\\(.+\\)[[:blank:]]"
"\\([[:digit:]]+\\)[[:blank:]]"
"(\\(.+?\\))"
tramp-gvfs-file-attributes-with-gvfs-ls-regexp)))
(let ((item (list (cons "type" (match-string 3))
(cons "standard::size" (match-string 2))
(cons "name" (match-string 1)))))
(goto-char (1+ (match-end 3)))
(while (looking-at
(concat
tramp-gvfs-file-attributes-with-gvfs-ls-regexp
"\\(" tramp-gvfs-file-attributes-with-gvfs-ls-regexp
"\\|" "$" "\\)"))
(push (cons (match-string 1) (match-string 2)) item)
(goto-char (match-end 2)))
;; Add display name as head.
(push
(cons (cdr (or (assoc "standard::display-name" item)
(assoc "name" item)))
(nreverse item))
result))
(forward-line)))
result))))
Sync with Tramp repository. * lisp/net/tramp-adb.el (tramp-adb-handle-start-file-process): * lisp/net/tramp-sh.el (tramp-sh-handle-start-file-process) * lisp/net/tramp-smb.el (tramp-smb-handle-start-file-process): Create BUFFER if it doesn't exist. Reported by Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com>. * lisp/net/tramp-gvfs.el (tramp-gvfs-file-attributes) (tramp-gvfs-file-attributes-with-gvfs-ls-regexp) (tramp-gvfs-file-attributes-with-gvfs-info-regexp): New defconst. (tramp-gvfs-get-directory-attributes) (tramp-gvfs-get-root-attributes) (tramp-gvfs-get-file-attributes): New defun. (tramp-gvfs-handle-file-attributes) (tramp-gvfs-handle-file-name-all-completions): Use them. (tramp-gvfs-handle-file-directory-p): Use `file-truename'. (tramp-gvfs-maybe-open-connection): Set :noquery flag for process. (tramp-gvfs-send-command): Add locale settings to `process-environment'. (top): Suppress D-Bus error messages during zeroconf initialization. * lisp/net/tramp.el (tramp-unknown-id-string) (tramp-unknown-id-integer): New defconst. (tramp-check-cached-permissions) * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-attributes) * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls) (tramp-convert-file-attributes, tramp-get-remote-uid) (tramp-get-remote-gid): Use them. * lisp/net/tramp-sh.el (tramp-display-escape-sequence-regexp): Rename from `tramp-color-escape-sequence-regexp'. (tramp-sh-handle-insert-directory) (tramp-convert-file-attributes): Adapt callees. (tramp-device-escape-sequence-regexp): New defconst. (tramp-wait-for-output): Use it. Reported by Matthías Páll Gissurarson <icetritlo@gmail.com>. * lisp/net/tramp-smb.el (tramp-smb-handle-file-name-all-completions): Simplify. * test/lisp/net/tramp-tests.el (tramp-test26-process-file) (tramp-test28-shell-command): Use `tramp-display-escape-sequence-regexp'.
2016-05-28 12:14:58 +02:00
(defun tramp-gvfs-get-root-attributes (filename &optional file-system)
"Return GVFS attributes association list of FILENAME.
If FILE-SYSTEM is non-nil, return file system attributes."
;; Don't modify `last-coding-system-used' by accident.
(let ((last-coding-system-used last-coding-system-used)
result)
(with-parsed-tramp-file-name filename nil
(with-tramp-file-property
v localname
(if file-system "file-system-attributes" "file-attributes")
(tramp-message
v 5 "file%s gvfs attributes: %s"
(if file-system " system" "") localname)
;; Send command.
(if file-system
(tramp-gvfs-send-command
v "gvfs-info" "--filesystem" (tramp-gvfs-url-file-name filename))
(tramp-gvfs-send-command
v "gvfs-info" (tramp-gvfs-url-file-name filename)))
;; Parse output.
(with-current-buffer (tramp-get-connection-buffer v)
(goto-char (point-min))
(while (re-search-forward
(if file-system
tramp-gvfs-file-system-attributes-regexp
tramp-gvfs-file-attributes-with-gvfs-info-regexp)
nil t)
(push (cons (match-string 1) (match-string 2)) result))
result)))))
Sync with Tramp repository. * lisp/net/tramp-adb.el (tramp-adb-handle-start-file-process): * lisp/net/tramp-sh.el (tramp-sh-handle-start-file-process) * lisp/net/tramp-smb.el (tramp-smb-handle-start-file-process): Create BUFFER if it doesn't exist. Reported by Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com>. * lisp/net/tramp-gvfs.el (tramp-gvfs-file-attributes) (tramp-gvfs-file-attributes-with-gvfs-ls-regexp) (tramp-gvfs-file-attributes-with-gvfs-info-regexp): New defconst. (tramp-gvfs-get-directory-attributes) (tramp-gvfs-get-root-attributes) (tramp-gvfs-get-file-attributes): New defun. (tramp-gvfs-handle-file-attributes) (tramp-gvfs-handle-file-name-all-completions): Use them. (tramp-gvfs-handle-file-directory-p): Use `file-truename'. (tramp-gvfs-maybe-open-connection): Set :noquery flag for process. (tramp-gvfs-send-command): Add locale settings to `process-environment'. (top): Suppress D-Bus error messages during zeroconf initialization. * lisp/net/tramp.el (tramp-unknown-id-string) (tramp-unknown-id-integer): New defconst. (tramp-check-cached-permissions) * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-attributes) * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls) (tramp-convert-file-attributes, tramp-get-remote-uid) (tramp-get-remote-gid): Use them. * lisp/net/tramp-sh.el (tramp-display-escape-sequence-regexp): Rename from `tramp-color-escape-sequence-regexp'. (tramp-sh-handle-insert-directory) (tramp-convert-file-attributes): Adapt callees. (tramp-device-escape-sequence-regexp): New defconst. (tramp-wait-for-output): Use it. Reported by Matthías Páll Gissurarson <icetritlo@gmail.com>. * lisp/net/tramp-smb.el (tramp-smb-handle-file-name-all-completions): Simplify. * test/lisp/net/tramp-tests.el (tramp-test26-process-file) (tramp-test28-shell-command): Use `tramp-display-escape-sequence-regexp'.
2016-05-28 12:14:58 +02:00
(defun tramp-gvfs-get-file-attributes (filename)
"Return GVFS attributes association list of FILENAME."
(setq filename (directory-file-name (expand-file-name filename)))
(with-parsed-tramp-file-name filename nil
(setq localname (tramp-compat-file-name-unquote localname))
Rework Tramp wrt string-match-p, looking-at-p, save-match-data * lisp/net/tramp.el (tramp-find-method, tramp-find-user) (tramp-find-host, tramp-dissect-file-name, tramp-make-tramp-file-name) (tramp-completion-make-tramp-file-name, tramp-debug-message) (tramp-message, tramp-progress-reporter-update) (tramp-set-completion-function) (tramp-rfn-eshadow-update-overlay) (tramp-find-file-name-coding-system-alist) (tramp-file-name-for-operation) (tramp-use-absolute-autoload-file-names) (tramp-get-completion-methods, tramp-get-completion-user-host) (tramp-handle-directory-files) (tramp-handle-file-name-case-insensitive-p) (tramp-handle-file-name-completion, tramp-handle-file-truename) (tramp-handle-insert-directory, tramp-handle-load) (tramp-handle-shell-command, tramp-action-yesno) (tramp-action-yn, tramp-process-actions) (tramp-mode-string-to-int, tramp-get-local-locale) (tramp-local-host-p): * lisp/net/tramp-adb.el (tramp-adb-handle-file-system-info) (tramp-adb-handle-directory-files-and-attributes) (tramp-adb--gnu-switches-to-ash, tramp-adb-sh-fix-ls-output) (tramp-adb-handle-file-name-all-completions) (tramp-adb-handle-shell-command) (tramp-adb-handle-start-file-process): * lisp/net/tramp-archive.el (tramp-archive-dissect-file-name): * lisp/net/tramp-cache.el (tramp-get-hash-table) (tramp-flush-directory-properties, tramp-flush-file-function): * lisp/net/tramp-cmds.el (tramp-reporter-dump-variable) (tramp-append-tramp-buffers): * lisp/net/tramp-compat.el (tramp-compat-process-running-p): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name) (tramp-gvfs-get-file-attributes) (tramp-gvfs-handle-file-attributes) (tramp-gvfs-monitor-process-filter) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec-entry) (tramp-gvfs-mount-spec, tramp-gvfs-maybe-open-connection): * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls) (tramp-do-file-attributes-with-stat) (tramp-sh-handle-file-selinux-context) (tramp-sh-handle-directory-files-and-attributes) (tramp-do-directory-files-and-attributes-with-stat) (tramp-sh-handle-file-name-all-completions) (tramp-sh-handle-dired-compress-file) (tramp-sh-handle-insert-directory) (tramp-sh-handle-expand-file-name) (tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-sh-handle-write-region) (tramp-sh-handle-file-notify-add-watch) (tramp-sh-gio-monitor-process-filter) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter) (tramp-sh-handle-file-system-info, tramp-maybe-send-script) (tramp-find-executable, tramp-open-shell, tramp-find-shell) (tramp-open-connection-setup-interactive-shell) (tramp-find-inline-encoding, tramp-call-local-coding-command) (tramp-compute-multi-hops, tramp-maybe-open-connection) (tramp-convert-file-attributes) (tramp-make-copy-program-file-name, tramp-get-remote-locale) (tramp-get-test-nt-command, tramp-get-remote-stat) (tramp-get-inline-coding): * lisp/net/tramp-smb.el (tramp-smb-handle-directory-files) (tramp-smb-action-get-acl, tramp-smb-handle-file-attributes) (tramp-smb-handle-file-name-all-completions) (tramp-smb-handle-file-system-info) (tramp-smb-handle-file-writable-p) (tramp-smb-handle-insert-directory) (tramp-smb-handle-make-directory) (tramp-smb-handle-make-directory-internal) (tramp-smb-handle-start-file-process, tramp-smb-get-localname) (tramp-smb-read-file-entry): Use `string-match-p' and `looking-at-p'. Remove superfluous `save-match-data'. Apply `eval-when-compile' on constant concat data. * lisp/net/tramp-compat.el (tramp-compat-file-name-quoted-p-p): Use `string-prefix-p'. (tramp-compat-file-name-unquote): Do not use match data.
2018-12-06 16:00:05 +01:00
(if (or (and (string-match-p "^\\(afp\\|davs?\\|smb\\)$" method)
(string-match-p "^/?\\([^/]+\\)$" localname))
(string-equal localname "/"))
Sync with Tramp repository. * lisp/net/tramp-adb.el (tramp-adb-handle-start-file-process): * lisp/net/tramp-sh.el (tramp-sh-handle-start-file-process) * lisp/net/tramp-smb.el (tramp-smb-handle-start-file-process): Create BUFFER if it doesn't exist. Reported by Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com>. * lisp/net/tramp-gvfs.el (tramp-gvfs-file-attributes) (tramp-gvfs-file-attributes-with-gvfs-ls-regexp) (tramp-gvfs-file-attributes-with-gvfs-info-regexp): New defconst. (tramp-gvfs-get-directory-attributes) (tramp-gvfs-get-root-attributes) (tramp-gvfs-get-file-attributes): New defun. (tramp-gvfs-handle-file-attributes) (tramp-gvfs-handle-file-name-all-completions): Use them. (tramp-gvfs-handle-file-directory-p): Use `file-truename'. (tramp-gvfs-maybe-open-connection): Set :noquery flag for process. (tramp-gvfs-send-command): Add locale settings to `process-environment'. (top): Suppress D-Bus error messages during zeroconf initialization. * lisp/net/tramp.el (tramp-unknown-id-string) (tramp-unknown-id-integer): New defconst. (tramp-check-cached-permissions) * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-attributes) * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls) (tramp-convert-file-attributes, tramp-get-remote-uid) (tramp-get-remote-gid): Use them. * lisp/net/tramp-sh.el (tramp-display-escape-sequence-regexp): Rename from `tramp-color-escape-sequence-regexp'. (tramp-sh-handle-insert-directory) (tramp-convert-file-attributes): Adapt callees. (tramp-device-escape-sequence-regexp): New defconst. (tramp-wait-for-output): Use it. Reported by Matthías Páll Gissurarson <icetritlo@gmail.com>. * lisp/net/tramp-smb.el (tramp-smb-handle-file-name-all-completions): Simplify. * test/lisp/net/tramp-tests.el (tramp-test26-process-file) (tramp-test28-shell-command): Use `tramp-display-escape-sequence-regexp'.
2016-05-28 12:14:58 +02:00
(tramp-gvfs-get-root-attributes filename)
(assoc
(file-name-nondirectory filename)
(tramp-gvfs-get-directory-attributes (file-name-directory filename))))))
(defun tramp-gvfs-handle-file-attributes (filename &optional id-format)
"Like `file-attributes' for Tramp files."
(unless id-format (setq id-format 'integer))
(let ((attributes (tramp-gvfs-get-file-attributes filename))
dirp res-symlink-target res-numlinks res-uid res-gid res-access
res-mod res-change res-size res-filemodes res-inode res-device)
(when attributes
;; ... directory or symlink
(setq dirp (if (equal "directory" (cdr (assoc "type" attributes))) t))
(setq res-symlink-target
;; Google-drive creates file blobs and links to them. We
;; don't want to see them.
(and
(not
(equal (cdr (assoc "standard::is-volatile" attributes)) "TRUE"))
(cdr (assoc "standard::symlink-target" attributes))))
(when (stringp res-symlink-target)
Sync with Tramp repository. * lisp/net/tramp-adb.el (tramp-adb-handle-start-file-process): * lisp/net/tramp-sh.el (tramp-sh-handle-start-file-process) * lisp/net/tramp-smb.el (tramp-smb-handle-start-file-process): Create BUFFER if it doesn't exist. Reported by Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com>. * lisp/net/tramp-gvfs.el (tramp-gvfs-file-attributes) (tramp-gvfs-file-attributes-with-gvfs-ls-regexp) (tramp-gvfs-file-attributes-with-gvfs-info-regexp): New defconst. (tramp-gvfs-get-directory-attributes) (tramp-gvfs-get-root-attributes) (tramp-gvfs-get-file-attributes): New defun. (tramp-gvfs-handle-file-attributes) (tramp-gvfs-handle-file-name-all-completions): Use them. (tramp-gvfs-handle-file-directory-p): Use `file-truename'. (tramp-gvfs-maybe-open-connection): Set :noquery flag for process. (tramp-gvfs-send-command): Add locale settings to `process-environment'. (top): Suppress D-Bus error messages during zeroconf initialization. * lisp/net/tramp.el (tramp-unknown-id-string) (tramp-unknown-id-integer): New defconst. (tramp-check-cached-permissions) * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-attributes) * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls) (tramp-convert-file-attributes, tramp-get-remote-uid) (tramp-get-remote-gid): Use them. * lisp/net/tramp-sh.el (tramp-display-escape-sequence-regexp): Rename from `tramp-color-escape-sequence-regexp'. (tramp-sh-handle-insert-directory) (tramp-convert-file-attributes): Adapt callees. (tramp-device-escape-sequence-regexp): New defconst. (tramp-wait-for-output): Use it. Reported by Matthías Páll Gissurarson <icetritlo@gmail.com>. * lisp/net/tramp-smb.el (tramp-smb-handle-file-name-all-completions): Simplify. * test/lisp/net/tramp-tests.el (tramp-test26-process-file) (tramp-test28-shell-command): Use `tramp-display-escape-sequence-regexp'.
2016-05-28 12:14:58 +02:00
(setq res-symlink-target
;; Parse unibyte codes "\xNN". We assume they are
;; non-ASCII codepoints in the range #x80 through #xff.
;; Convert them to multibyte.
(decode-coding-string
(replace-regexp-in-string
"\\\\x\\([[:xdigit:]]\\{2\\}\\)"
(lambda (x)
(unibyte-string (string-to-number (match-string 1 x) 16)))
res-symlink-target)
'utf-8)))
;; ... number links
(setq res-numlinks
(string-to-number
(or (cdr (assoc "unix::nlink" attributes)) "0")))
;; ... uid and gid
(setq res-uid
(if (eq id-format 'integer)
(string-to-number
(or (cdr (assoc "unix::uid" attributes))
(eval-when-compile (format "%s" tramp-unknown-id-integer))))
(or (cdr (assoc "owner::user" attributes))
(cdr (assoc "unix::uid" attributes))
tramp-unknown-id-string)))
(setq res-gid
(if (eq id-format 'integer)
(string-to-number
(or (cdr (assoc "unix::gid" attributes))
(eval-when-compile (format "%s" tramp-unknown-id-integer))))
(or (cdr (assoc "owner::group" attributes))
(cdr (assoc "unix::gid" attributes))
tramp-unknown-id-string)))
;; ... last access, modification and change time
(setq res-access
(seconds-to-time
(string-to-number
(or (cdr (assoc "time::access" attributes)) "0"))))
(setq res-mod
(seconds-to-time
(string-to-number
(or (cdr (assoc "time::modified" attributes)) "0"))))
(setq res-change
(seconds-to-time
(string-to-number
(or (cdr (assoc "time::changed" attributes)) "0"))))
;; ... size
(setq res-size
(string-to-number
(or (cdr (assoc "standard::size" attributes)) "0")))
;; ... file mode flags
(setq res-filemodes
(let ((n (cdr (assoc "unix::mode" attributes))))
(if n
(tramp-file-mode-from-int (string-to-number n))
(format
"%s%s%s%s------"
(if dirp "d" (if res-symlink-target "l" "-"))
(if (equal (cdr (assoc "access::can-read" attributes))
"FALSE")
"-" "r")
(if (equal (cdr (assoc "access::can-write" attributes))
"FALSE")
"-" "w")
(if (equal (cdr (assoc "access::can-execute" attributes))
"FALSE")
"-" "x")))))
;; ... inode and device
(setq res-inode
(let ((n (cdr (assoc "unix::inode" attributes))))
(if n
(string-to-number n)
(tramp-get-inode (tramp-dissect-file-name filename)))))
(setq res-device
(let ((n (cdr (assoc "unix::device" attributes))))
(if n
(string-to-number n)
(tramp-get-device (tramp-dissect-file-name filename)))))
;; Return data gathered.
(list
;; 0. t for directory, string (name linked to) for
;; symbolic link, or nil.
(or dirp res-symlink-target)
;; 1. Number of links to file.
res-numlinks
;; 2. File uid.
res-uid
;; 3. File gid.
res-gid
;; 4. Last access time, as a list of integers.
;; 5. Last modification time, likewise.
;; 6. Last status change time, likewise.
res-access res-mod res-change
;; 7. Size in bytes (-1, if number is out of range).
res-size
;; 8. File modes.
res-filemodes
;; 9. t if file's gid would change if file were deleted
;; and recreated.
nil
;; 10. Inode number.
res-inode
;; 11. Device number.
res-device
))))
2009-06-22 21:04:49 +00:00
(defun tramp-gvfs-handle-file-executable-p (filename)
"Like `file-executable-p' for Tramp files."
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(with-parsed-tramp-file-name filename nil
(with-tramp-file-property v localname "file-executable-p"
(and (file-exists-p filename)
(tramp-check-cached-permissions v ?x)))))
2009-06-22 21:04:49 +00:00
(defun tramp-gvfs-handle-file-name-all-completions (filename directory)
"Like `file-name-all-completions' for Tramp files."
(unless (string-match-p "/" filename)
(all-completions
filename
(with-parsed-tramp-file-name (expand-file-name directory) nil
(with-tramp-file-property v localname "file-name-all-completions"
(let ((result '("./" "../")))
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
;; Get a list of directories and files.
(dolist (item (tramp-gvfs-get-directory-attributes directory) result)
(if (string-equal (cdr (assoc "type" item)) "directory")
(push (file-name-as-directory (car item)) result)
(push (car item) result)))))))))
2009-06-22 21:04:49 +00:00
(defun tramp-gvfs-handle-file-notify-add-watch (file-name flags _callback)
Complete file name handlers. * net/tramp.el (tramp-handle-set-visited-file-modtime) (tramp-handle-verify-visited-file-modtime) (tramp-handle-file-notify-rm-watch): New functions. (tramp-call-process): Do not bind `default-directory'. * net/tramp-adb.el (tramp-adb-file-name-handler-alist): Order alphabetically. [access-file, add-name-to-file, dired-call-process]: [dired-compress-file, file-acl, file-notify-rm-watch]: [file-ownership-preserved-p, file-selinux-context]: [make-directory-internal, make-symbolic-link, set-file-acl]: [set-file-selinux-context, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (tramp-adb-handle-write-region): Apply `set-visited-file-modtime'. * net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) [file-notify-add-watch, file-notify-rm-watch]: [set-file-times, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (with-tramp-gvfs-error-message) (tramp-gvfs-handle-set-visited-file-modtime) (tramp-gvfs-fuse-file-name): Remove. (tramp-gvfs-handle-file-notify-add-watch) (tramp-gvfs-file-gvfs-monitor-file-process-filter): New defuns. (tramp-gvfs-handle-write-region): Fix error in moving tmpfile. * net/tramp-sh.el (tramp-sh-file-name-handler-alist): Order alphabetically. [file-notify-rm-watch ]: Use default Tramp handler. [executable-find]: Remove private handler. (tramp-do-copy-or-rename-file-out-of-band): Do not bind `default-directory'. (tramp-sh-handle-executable-find) (tramp-sh-handle-file-notify-rm-watch): Remove functions. (tramp-sh-file-gvfs-monitor-dir-process-filter) (tramp-sh-file-inotifywait-process-filter, tramp-set-remote-path): Do not use `format' in `tramp-message'. * net/tramp-smb.el (tramp-smb-file-name-handler-alist) [file-notify-rm-watch, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (tramp-smb-call-winexe): Do not bind `default-directory'.
2013-08-01 13:10:31 +02:00
"Like `file-notify-add-watch' for Tramp files."
(setq file-name (expand-file-name file-name))
(with-parsed-tramp-file-name file-name nil
;; TODO: We cannot watch directories, because `gio monitor' is not
;; supported for gvfs-mounted directories. However,
;; `file-notify-add-watch' uses directories.
(when (or (not (tramp-gvfs-gio-tool-p v)) (file-directory-p file-name))
(tramp-error
v 'file-notify-error "Monitoring not supported for `%s'" file-name))
(let* ((default-directory (file-name-directory file-name))
(events
(cond
((and (memq 'change flags) (memq 'attribute-change flags))
'(created changed changes-done-hint moved deleted
attribute-changed))
((memq 'change flags)
'(created changed changes-done-hint moved deleted))
((memq 'attribute-change flags) '(attribute-changed))))
(p (apply
#'start-process
"gvfs-monitor" (generate-new-buffer " *gvfs-monitor*")
`("gio" "monitor" ,(tramp-gvfs-url-file-name file-name)))))
Complete file name handlers. * net/tramp.el (tramp-handle-set-visited-file-modtime) (tramp-handle-verify-visited-file-modtime) (tramp-handle-file-notify-rm-watch): New functions. (tramp-call-process): Do not bind `default-directory'. * net/tramp-adb.el (tramp-adb-file-name-handler-alist): Order alphabetically. [access-file, add-name-to-file, dired-call-process]: [dired-compress-file, file-acl, file-notify-rm-watch]: [file-ownership-preserved-p, file-selinux-context]: [make-directory-internal, make-symbolic-link, set-file-acl]: [set-file-selinux-context, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (tramp-adb-handle-write-region): Apply `set-visited-file-modtime'. * net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) [file-notify-add-watch, file-notify-rm-watch]: [set-file-times, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (with-tramp-gvfs-error-message) (tramp-gvfs-handle-set-visited-file-modtime) (tramp-gvfs-fuse-file-name): Remove. (tramp-gvfs-handle-file-notify-add-watch) (tramp-gvfs-file-gvfs-monitor-file-process-filter): New defuns. (tramp-gvfs-handle-write-region): Fix error in moving tmpfile. * net/tramp-sh.el (tramp-sh-file-name-handler-alist): Order alphabetically. [file-notify-rm-watch ]: Use default Tramp handler. [executable-find]: Remove private handler. (tramp-do-copy-or-rename-file-out-of-band): Do not bind `default-directory'. (tramp-sh-handle-executable-find) (tramp-sh-handle-file-notify-rm-watch): Remove functions. (tramp-sh-file-gvfs-monitor-dir-process-filter) (tramp-sh-file-inotifywait-process-filter, tramp-set-remote-path): Do not use `format' in `tramp-message'. * net/tramp-smb.el (tramp-smb-file-name-handler-alist) [file-notify-rm-watch, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (tramp-smb-call-winexe): Do not bind `default-directory'.
2013-08-01 13:10:31 +02:00
(if (not (processp p))
(tramp-error
v 'file-notify-error "Monitoring not supported for `%s'" file-name)
Code cleanup. * net/tramp.el (tramp-debug-message): Do not check for connection buffer. (tramp-message): Use "vector" connection property. * net/tramp.el (tramp-rfn-eshadow-update-overlay) (tramp-equal-remote, tramp-eshell-directory-change) * net/tramp-adb.el (tramp-adb-handle-copy-file) (tramp-adb-handle-rename-file) * net/tramp-cmds.el (tramp-list-remote-buffers) (tramp-cleanup-connection, tramp-cleanup-this-connection) * net/tramp-compat.el (tramp-compat-process-running-p) * net/tramp-ftp.el (tramp-ftp-file-name-handler) * net/tramp-gvfs.el (tramp-gvfs-handle-copy-file) (tramp-gvfs-handle-rename-file) * net/tramp-sh.el (tramp-sh-handle-set-file-times) (tramp-set-file-uid-gid) * net/tramp-smb.el (tramp-smb-handle-copy-file) (tramp-smb-handle-rename-file): Use `tramp-tramp-file-p' instead of `file-remote-p'. * net/tramp.el (tramp-connectable-p, tramp-handle-file-remote-p) * net/tramp-gw.el (tramp-gw-gw-proc-sentinel) (tramp-gw-aux-proc-sentinel, tramp-gw-process-filter) (tramp-gw-open-network-stream): Suppress unrelated traces. * net/tramp-adb.el (tramp-adb-maybe-open-connection) * net/tramp-gvfs.el (tramp-gvfs-handle-file-notify-add-watch) * net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band) * net/tramp-smb.el (tramp-smb-maybe-open-connection): Set "vector" connection property. * net/tramp-cache.el (top): Suppress traces when reading presistency file. * net/tramp-sh.el (tramp-sh-handle-file-notify-add-watch): Refactor common code. Improve debug message. (tramp-maybe-open-connection) * net/tramp-smb.el (tramp-smb-call-winexe): Do not request connection buffer too early. * net/tramp-smb.el (tramp-smb-actions-get-acl): New defconst, renamed from `tramp-smb-actions-with-acl'. (tramp-smb-actions-set-acl): New defconst. (tramp-smb-handle-copy-directory) (tramp-smb-action-get-acl): New defun, renamed from `tramp-smb-action-with-acl'. (tramp-smb-action-set-acl): New defun. (tramp-smb-handle-set-file-acl): Rewrite.
2013-10-17 21:39:22 +02:00
(tramp-message
Tramp requires Emacs 24.4 * doc/misc/tramp.texi (Frequently Asked Questions): Use `with-eval-after-load'. in example. * doc/misc/trampver.texi: Set variable emacsver. * lisp/net/tramp.el (tramp-send-string, tramp-call-process) (tramp-call-process-region, tramp-process-lines): * lisp/net/tramp-adb.el (tramp-adb-handle-file-truename) (tramp-adb-sh-fix-ls-output, tramp-adb-maybe-open-connection): * lisp/net/tramp-gvfs.el (tramp-gvfs-get-directory-attributes) (tramp-gvfs-handle-file-notify-add-watch) * lisp/net/tramp-sh.el (tramp-sh-handle-file-truename) (tramp-do-copy-or-rename-file-out-of-band) (tramp-sh-handle-file-notify-add-watch, tramp-find-executable) (tramp-set-remote-path) (tramp-open-connection-setup-interactive-shell) (tramp-maybe-open-connection, tramp-send-command): * 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) (tramp-smb-maybe-open-connection): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-set-file-acl): (tramp-sudoedit-send-command): Use `string-join' and `string-empty-p'. * lisp/net/tramp-adb.el: * lisp/net/tramp-archive.el: * lisp/net/tramp-integration.el: * lisp/net/tramp-ftp.el: Use `with-eval-after-load'. * lisp/net/tramp-cmds.el (tramp-cleanup-connection) (tramp-cleanup-all-connections): Cancel timer. * lisp/net/tramp-compat.el (subr-x): Require. (default-toplevel-value): Don't make it a defalias. * lisp/net/tramp-gvfs.el: Use `dbus-event-error-functions'. Do not special handle `split-string'. * lisp/net/tramp.el: Require Emacs 24.4. (tramp-password-prompt-regexp): Use `password-word-equivalents'. (tramp-user-error): Use `user-error'. (tramp-replace-environment-variables): Use `substitute-env-vars'. (tramp-wait-for-regexp): Rearrange `with-current-buffer' call. (tramp-get-local-gid): Use `group-gid'. * lisp/net/trampver.el: Check for Emacs 24.4. * test/lisp/net/tramp-tests.el (tramp-test02-file-name-dissect) (tramp-test02-file-name-dissect-simplified) (tramp-test02-file-name-dissect-separate) (tramp-test03-file-name-host-rules) (tramp-test03-file-name-method-rules): Don't check for `user-error'.
2019-06-28 16:32:12 +02:00
v 6 "Run `%s', %S" (string-join (process-command p) " ") p)
(process-put p 'vector v)
Remove XEmacs compatibility in Tramp * doc/misc/tramp.texi: Replace flags by their hard coded name. Remove unused flags and the enclosed alternative text for XEmacs. * doc/misc/trampver.texi: Use "Tramp" CamelCase. Rename "emacs" and "xemacs" flags to "unified" and "separate". Remove flags "emacsgw", "emacsname", "emacsdir", "ftppackagename", "emacsothername", "emacsotherdir" and "emacsotherfilename". (trampver): * lisp/net/trampver.el (tramp-version): Set to "2.3.0-pre". * lisp/net/tramp.el (bkup-backup-directory-info) (directory-sep-char, ls-lisp-use-insert-directory-program) (outline-regexp, tramp-backup-directory-alist) (tramp-default-method, tramp-shell-prompt-pattern, tramp-syntax) (tramp-file-name-regexp-unified) (tramp-file-name-regexp-separate) (tramp-completion-file-name-regexp-unified) (tramp-completion-file-name-regexp-separate, tramp-chunksize) (tramp-get-method-parameter, tramp-find-method, tramp-find-user) (tramp-debug-message, tramp-progress-reporter-update) (with-tramp-progress-reporter) (tramp-rfn-eshadow-setup-minibuffer) (rfn-eshadow-setup-minibuffer-hook, tramp-unload-hook) (tramp-rfn-eshadow-update-overlay) (rfn-eshadow-update-overlay-hook, tramp-default-file-modes) (tramp-file-name-for-operation) (tramp-completion-file-name-handler) (tramp-autoload-file-name-handler, tramp-completion-mode-p) (tramp-handle-directory-files) (tramp-handle-directory-files-and-attributes) (tramp-handle-dired-uncache, tramp-handle-find-backup-file-name) (tramp-handle-insert-file-contents, tramp-handle-load) (tramp-handle-shell-command) (tramp-handle-verify-visited-file-modtime) (tramp-handle-file-notify-valid-p, tramp-accept-process-output) (tramp-check-for-regexp, tramp-wait-for-regexp) (tramp-send-string, tramp-mode-string-to-int) (tramp-get-local-gid, tramp-check-cached-permissions) (tramp-get-remote-tmpdir, tramp-make-tramp-temp-file) (auto-save-file-name-transforms) (tramp-handle-make-auto-save-file-name, tramp-read-passwd) (tramp-clear-passwd, tramp-time-diff): * lisp/net/tramp-adb.el (directory-listing-before-filename-regexp) (directory-sep-char, tramp-adb-file-name-handler-alist) (tramp-adb-parse-device-names) (tramp-adb-handle-expand-file-name) (tramp-adb-handle-file-truename, tramp-adb--gnu-switches-to-ash) (tramp-adb-handle-file-local-copy) (tramp-adb-handle-write-region, tramp-adb-handle-set-file-modes) (tramp-adb-handle-rename-file, tramp-adb-handle-process-file) (tramp-adb-handle-shell-command) (tramp-adb-handle-start-file-process, tramp-adb-get-device) (tramp-adb-maybe-open-connection): * lisp/net/tramp-cache.el (tramp-persistency-file-name) (tramp-cache-print): * lisp/net/tramp-cmds.el (tramp-cleanup-all-connections) (tramp-bug, tramp-reporter-dump-variable) (tramp-load-report-modules, tramp-append-tramp-buffers): * lisp/net/tramp-compat.el (tramp-compat-funcall) (tramp-advice-file-expand-wildcards) (tramp-compat-temporary-file-directory) (tramp-compat-make-temp-file, tramp-compat-copy-file) (tramp-compat-delete-directory, ) (tramp-compat-process-running-p): * lisp/net/tramp-ftp.el (tramp-methods) <ftp>: (tramp-default-method-alist, tramp-foreign-file-name-handler-alist): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) (tramp-gvfs-do-copy-or-rename-file, tramp-gvfs-handle-copy-file) (tramp-gvfs-handle-file-local-copy) (tramp-gvfs-handle-file-name-all-completions) (tramp-gvfs-handle-file-notify-add-watch) (tramp-gvfs-monitor-file-process-filter) (tramp-gvfs-handle-file-readable-p) (tramp-gvfs-handle-rename-file, tramp-gvfs-handle-write-region) (tramp-gvfs-file-name, tramp-gvfs-handler-askquestion) (tramp-gvfs-maybe-open-connection) (tramp-gvfs-parse-device-names): * lisp/net/tramp-gw.el (tramp-gw-aux-proc-sentinel) (tramp-gw-open-connection, tramp-gw-open-network-stream): * lisp/net/tramp-sh.el (directory-sep-char) (tramp-sh-file-name-handler-alist) (tramp-sh-handle-file-truename) (tramp-sh-handle-set-visited-file-modtime) (tramp-sh-handle-verify-visited-file-modtime) (tramp-sh-handle-set-file-modes, tramp-sh-handle-set-file-times) (tramp-sh-handle-file-acl) (tramp-sh-handle-file-name-all-completions) (tramp-sh-handle-copy-file, tramp-sh-handle-rename-file) (tramp-do-copy-or-rename-file-directly) (tramp-do-copy-or-rename-file-out-of-band) (dired-compress-file-suffixes, dired-remove-file) (tramp-sh-handle-dired-compress-file) (tramp-sh-handle-insert-directory) (tramp-sh-handle-expand-file-name) (tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-sh-handle-file-local-copy) (tramp-sh-handle-write-region, tramp-sh-handle-vc-registered) (tramp-sh-handle-file-notify-add-watch) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter, tramp-maybe-send-script) (tramp-find-executable) (tramp-open-connection-setup-interactive-shell) (tramp-find-inline-encoding, tramp-compute-multi-hops) (tramp-maybe-open-connection, tramp-convert-file-attributes) (tramp-get-remote-path, tramp-get-remote-touch): * lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist) (tramp-smb-handle-copy-directory, tramp-smb-handle-copy-file) (tramp-smb-handle-delete-directory) (tramp-smb-handle-directory-files, tramp-smb-handle-file-acl) (tramp-smb-handle-make-directory-internal) (tramp-smb-handle-process-file, tramp-smb-handle-rename-file) (tramp-smb-handle-set-file-acl, tramp-smb-handle-set-file-modes) (tramp-smb-handle-write-region, tramp-smb-get-file-entries) (tramp-smb-get-cifs-capabilities) (tramp-smb-maybe-open-connection): * lisp/net/trampver.el (tramp-repository-get-version): Remove XEmacs compat code. * lisp/net/tramp-cmds.el (mml-mode, mml-insert-empty-tag) (reporter-dump-variable): Declare functions. * lisp/net/tramp.el (tramp-bkup-backup-directory-info) (tramp-advice-minibuffer-electric-separator) (tramp-advice-minibuffer-electric-tilde) (tramp-handle-unhandled-file-name-directory): * lisp/net/tramp-compat.el (tramp-compat-with-temp-message) (tramp-compat-font-lock-add-keywords) (tramp-compat-load, tramp-compat-number-sequence) (tramp-compat-split-string, tramp-compat-delete-dups): * lisp/net/tramp-sh.el (tramp-sh-handle-insert-file-contents-literally): Remove. * lisp/net/tramp-sh.el (tramp-methods) <psftp>: This does not work recursively.
2016-01-14 14:12:17 +01:00
(process-put p 'events events)
(process-put p 'watch-name localname)
(process-put p 'adjust-window-size-function #'ignore)
Remove XEmacs compatibility in Tramp * doc/misc/tramp.texi: Replace flags by their hard coded name. Remove unused flags and the enclosed alternative text for XEmacs. * doc/misc/trampver.texi: Use "Tramp" CamelCase. Rename "emacs" and "xemacs" flags to "unified" and "separate". Remove flags "emacsgw", "emacsname", "emacsdir", "ftppackagename", "emacsothername", "emacsotherdir" and "emacsotherfilename". (trampver): * lisp/net/trampver.el (tramp-version): Set to "2.3.0-pre". * lisp/net/tramp.el (bkup-backup-directory-info) (directory-sep-char, ls-lisp-use-insert-directory-program) (outline-regexp, tramp-backup-directory-alist) (tramp-default-method, tramp-shell-prompt-pattern, tramp-syntax) (tramp-file-name-regexp-unified) (tramp-file-name-regexp-separate) (tramp-completion-file-name-regexp-unified) (tramp-completion-file-name-regexp-separate, tramp-chunksize) (tramp-get-method-parameter, tramp-find-method, tramp-find-user) (tramp-debug-message, tramp-progress-reporter-update) (with-tramp-progress-reporter) (tramp-rfn-eshadow-setup-minibuffer) (rfn-eshadow-setup-minibuffer-hook, tramp-unload-hook) (tramp-rfn-eshadow-update-overlay) (rfn-eshadow-update-overlay-hook, tramp-default-file-modes) (tramp-file-name-for-operation) (tramp-completion-file-name-handler) (tramp-autoload-file-name-handler, tramp-completion-mode-p) (tramp-handle-directory-files) (tramp-handle-directory-files-and-attributes) (tramp-handle-dired-uncache, tramp-handle-find-backup-file-name) (tramp-handle-insert-file-contents, tramp-handle-load) (tramp-handle-shell-command) (tramp-handle-verify-visited-file-modtime) (tramp-handle-file-notify-valid-p, tramp-accept-process-output) (tramp-check-for-regexp, tramp-wait-for-regexp) (tramp-send-string, tramp-mode-string-to-int) (tramp-get-local-gid, tramp-check-cached-permissions) (tramp-get-remote-tmpdir, tramp-make-tramp-temp-file) (auto-save-file-name-transforms) (tramp-handle-make-auto-save-file-name, tramp-read-passwd) (tramp-clear-passwd, tramp-time-diff): * lisp/net/tramp-adb.el (directory-listing-before-filename-regexp) (directory-sep-char, tramp-adb-file-name-handler-alist) (tramp-adb-parse-device-names) (tramp-adb-handle-expand-file-name) (tramp-adb-handle-file-truename, tramp-adb--gnu-switches-to-ash) (tramp-adb-handle-file-local-copy) (tramp-adb-handle-write-region, tramp-adb-handle-set-file-modes) (tramp-adb-handle-rename-file, tramp-adb-handle-process-file) (tramp-adb-handle-shell-command) (tramp-adb-handle-start-file-process, tramp-adb-get-device) (tramp-adb-maybe-open-connection): * lisp/net/tramp-cache.el (tramp-persistency-file-name) (tramp-cache-print): * lisp/net/tramp-cmds.el (tramp-cleanup-all-connections) (tramp-bug, tramp-reporter-dump-variable) (tramp-load-report-modules, tramp-append-tramp-buffers): * lisp/net/tramp-compat.el (tramp-compat-funcall) (tramp-advice-file-expand-wildcards) (tramp-compat-temporary-file-directory) (tramp-compat-make-temp-file, tramp-compat-copy-file) (tramp-compat-delete-directory, ) (tramp-compat-process-running-p): * lisp/net/tramp-ftp.el (tramp-methods) <ftp>: (tramp-default-method-alist, tramp-foreign-file-name-handler-alist): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) (tramp-gvfs-do-copy-or-rename-file, tramp-gvfs-handle-copy-file) (tramp-gvfs-handle-file-local-copy) (tramp-gvfs-handle-file-name-all-completions) (tramp-gvfs-handle-file-notify-add-watch) (tramp-gvfs-monitor-file-process-filter) (tramp-gvfs-handle-file-readable-p) (tramp-gvfs-handle-rename-file, tramp-gvfs-handle-write-region) (tramp-gvfs-file-name, tramp-gvfs-handler-askquestion) (tramp-gvfs-maybe-open-connection) (tramp-gvfs-parse-device-names): * lisp/net/tramp-gw.el (tramp-gw-aux-proc-sentinel) (tramp-gw-open-connection, tramp-gw-open-network-stream): * lisp/net/tramp-sh.el (directory-sep-char) (tramp-sh-file-name-handler-alist) (tramp-sh-handle-file-truename) (tramp-sh-handle-set-visited-file-modtime) (tramp-sh-handle-verify-visited-file-modtime) (tramp-sh-handle-set-file-modes, tramp-sh-handle-set-file-times) (tramp-sh-handle-file-acl) (tramp-sh-handle-file-name-all-completions) (tramp-sh-handle-copy-file, tramp-sh-handle-rename-file) (tramp-do-copy-or-rename-file-directly) (tramp-do-copy-or-rename-file-out-of-band) (dired-compress-file-suffixes, dired-remove-file) (tramp-sh-handle-dired-compress-file) (tramp-sh-handle-insert-directory) (tramp-sh-handle-expand-file-name) (tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-sh-handle-file-local-copy) (tramp-sh-handle-write-region, tramp-sh-handle-vc-registered) (tramp-sh-handle-file-notify-add-watch) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter, tramp-maybe-send-script) (tramp-find-executable) (tramp-open-connection-setup-interactive-shell) (tramp-find-inline-encoding, tramp-compute-multi-hops) (tramp-maybe-open-connection, tramp-convert-file-attributes) (tramp-get-remote-path, tramp-get-remote-touch): * lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist) (tramp-smb-handle-copy-directory, tramp-smb-handle-copy-file) (tramp-smb-handle-delete-directory) (tramp-smb-handle-directory-files, tramp-smb-handle-file-acl) (tramp-smb-handle-make-directory-internal) (tramp-smb-handle-process-file, tramp-smb-handle-rename-file) (tramp-smb-handle-set-file-acl, tramp-smb-handle-set-file-modes) (tramp-smb-handle-write-region, tramp-smb-get-file-entries) (tramp-smb-get-cifs-capabilities) (tramp-smb-maybe-open-connection): * lisp/net/trampver.el (tramp-repository-get-version): Remove XEmacs compat code. * lisp/net/tramp-cmds.el (mml-mode, mml-insert-empty-tag) (reporter-dump-variable): Declare functions. * lisp/net/tramp.el (tramp-bkup-backup-directory-info) (tramp-advice-minibuffer-electric-separator) (tramp-advice-minibuffer-electric-tilde) (tramp-handle-unhandled-file-name-directory): * lisp/net/tramp-compat.el (tramp-compat-with-temp-message) (tramp-compat-font-lock-add-keywords) (tramp-compat-load, tramp-compat-number-sequence) (tramp-compat-split-string, tramp-compat-delete-dups): * lisp/net/tramp-sh.el (tramp-sh-handle-insert-file-contents-literally): Remove. * lisp/net/tramp-sh.el (tramp-methods) <psftp>: This does not work recursively.
2016-01-14 14:12:17 +01:00
(set-process-query-on-exit-flag p nil)
(set-process-filter p #'tramp-gvfs-monitor-process-filter)
(set-process-sentinel p #'tramp-file-notify-process-sentinel)
;; There might be an error if the monitor is not supported.
;; Give the filter a chance to read the output.
(while (tramp-accept-process-output p 0))
(unless (process-live-p p)
(tramp-error
p 'file-notify-error "Monitoring not supported for `%s'" file-name))
;; Set "gio-file-monitor" property. We believe, that "gio
;; monitor" uses polling when applied for mounted files.
(tramp-set-connection-property p "gio-file-monitor" 'GPollFileMonitor)
Complete file name handlers. * net/tramp.el (tramp-handle-set-visited-file-modtime) (tramp-handle-verify-visited-file-modtime) (tramp-handle-file-notify-rm-watch): New functions. (tramp-call-process): Do not bind `default-directory'. * net/tramp-adb.el (tramp-adb-file-name-handler-alist): Order alphabetically. [access-file, add-name-to-file, dired-call-process]: [dired-compress-file, file-acl, file-notify-rm-watch]: [file-ownership-preserved-p, file-selinux-context]: [make-directory-internal, make-symbolic-link, set-file-acl]: [set-file-selinux-context, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (tramp-adb-handle-write-region): Apply `set-visited-file-modtime'. * net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) [file-notify-add-watch, file-notify-rm-watch]: [set-file-times, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (with-tramp-gvfs-error-message) (tramp-gvfs-handle-set-visited-file-modtime) (tramp-gvfs-fuse-file-name): Remove. (tramp-gvfs-handle-file-notify-add-watch) (tramp-gvfs-file-gvfs-monitor-file-process-filter): New defuns. (tramp-gvfs-handle-write-region): Fix error in moving tmpfile. * net/tramp-sh.el (tramp-sh-file-name-handler-alist): Order alphabetically. [file-notify-rm-watch ]: Use default Tramp handler. [executable-find]: Remove private handler. (tramp-do-copy-or-rename-file-out-of-band): Do not bind `default-directory'. (tramp-sh-handle-executable-find) (tramp-sh-handle-file-notify-rm-watch): Remove functions. (tramp-sh-file-gvfs-monitor-dir-process-filter) (tramp-sh-file-inotifywait-process-filter, tramp-set-remote-path): Do not use `format' in `tramp-message'. * net/tramp-smb.el (tramp-smb-file-name-handler-alist) [file-notify-rm-watch, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (tramp-smb-call-winexe): Do not bind `default-directory'.
2013-08-01 13:10:31 +02:00
p))))
(defun tramp-gvfs-monitor-process-filter (proc string)
"Read output from \"gvfs-monitor-file\" and add corresponding \
Adapt Tramp docstrings according to checkdoc * lisp/net/tramp.el (tramp-backup-directory-alist) (tramp-echoed-echo-mark-regexp, tramp-syntax-values) (tramp-lookup-syntax, 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-unknown-id-string) (tramp-unknown-id-integer, tramp-build-file-name-regexp) (tramp-build-completion-file-name-regexp, tramp-chunksize) (tramp-find-method, tramp-find-user, tramp-find-host) (tramp-dissect-file-name, tramp-get-buffer) (tramp-get-connection-buffer, tramp-debug-message, tramp-error) (with-tramp-connection-property, tramp-run-real-handler) (tramp-file-name-for-operation, tramp-file-name-handler) (tramp-completion-file-name-handler) (tramp-completion-handle-file-name-completion) (tramp-completion-dissect-file-name) (tramp-completion-dissect-file-name1) (tramp-handle-file-name-as-directory) (tramp-handle-file-name-directory) (tramp-handle-file-name-nondirectory, tramp-mode-string-to-int) (tramp-file-mode-from-int): * lisp/net/tramp-adb.el (tramp-adb-file-name-p): * lisp/net/tramp-archive.el (tramp-archive-run-real-handler) (tramp-archive-file-name-handler) (tramp-archive-dissect-file-name) (with-parsed-tramp-archive-file-name) (tramp-archive-gvfs-file-name, tramp-archive-handle-access-file): * lisp/net/tramp-cmds.el (tramp-list-remote-buffers): * lisp/net/tramp-compat.el (tramp-unload-file-name-handlers) (tramp-compat-funcall, tramp-compat-tramp-file-name-slots): * lisp/net/tramp-ftp.el (tramp-ftp-file-name-handler) (tramp-ftp-file-name-p): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-p) (tramp-gvfs-file-name-handler) (tramp-gvfs-stringify-dbus-message) (tramp-gvfs-monitor-process-filter) (tramp-gvfs-handler-mounted-unmounted): * lisp/net/tramp-integration.el (tramp-rfn-eshadow-update-overlay-regexp): * lisp/net/tramp-rclone.el (tramp-rclone-file-name-p) (tramp-rclone-file-name-handler, tramp-rclone-send-command): * lisp/net/tramp-sh.el (tramp-sh--quoting-style-options) (tramp-sh-gio-monitor-process-filter) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter, tramp-find-executable) (tramp-set-remote-path, tramp-open-shell, tramp-find-shell) (tramp-send-command-and-check, tramp-shell-case-fold) (tramp-get-remote-path): * lisp/net/tramp-smb.el (tramp-smb-file-name-p) (tramp-smb-file-name-handler) (tramp-smb-do-file-attributes-with-stat) (tramp-smb-handle-substitute-in-file-name) (tramp-smb-get-stat-capability, tramp-smb-shell-quote-argument): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-p) (tramp-sudoedit-file-name-handler) (tramp-sudoedit-send-command-string): * test/lisp/net/tramp-archive-tests.el (tramp-archive-test-all): * test/lisp/net/tramp-tests.el (tramp--test-gvfs-p) (tramp--test-with-proper-process-name-and-buffer) (tramp-test-all): Adapt docstrings according to `checkdoc'.
2019-11-13 13:10:58 +01:00
`file-notify' events."
(let* ((events (process-get proc 'events))
(rest-string (process-get proc 'rest-string))
Complete file name handlers. * net/tramp.el (tramp-handle-set-visited-file-modtime) (tramp-handle-verify-visited-file-modtime) (tramp-handle-file-notify-rm-watch): New functions. (tramp-call-process): Do not bind `default-directory'. * net/tramp-adb.el (tramp-adb-file-name-handler-alist): Order alphabetically. [access-file, add-name-to-file, dired-call-process]: [dired-compress-file, file-acl, file-notify-rm-watch]: [file-ownership-preserved-p, file-selinux-context]: [make-directory-internal, make-symbolic-link, set-file-acl]: [set-file-selinux-context, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (tramp-adb-handle-write-region): Apply `set-visited-file-modtime'. * net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) [file-notify-add-watch, file-notify-rm-watch]: [set-file-times, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (with-tramp-gvfs-error-message) (tramp-gvfs-handle-set-visited-file-modtime) (tramp-gvfs-fuse-file-name): Remove. (tramp-gvfs-handle-file-notify-add-watch) (tramp-gvfs-file-gvfs-monitor-file-process-filter): New defuns. (tramp-gvfs-handle-write-region): Fix error in moving tmpfile. * net/tramp-sh.el (tramp-sh-file-name-handler-alist): Order alphabetically. [file-notify-rm-watch ]: Use default Tramp handler. [executable-find]: Remove private handler. (tramp-do-copy-or-rename-file-out-of-band): Do not bind `default-directory'. (tramp-sh-handle-executable-find) (tramp-sh-handle-file-notify-rm-watch): Remove functions. (tramp-sh-file-gvfs-monitor-dir-process-filter) (tramp-sh-file-inotifywait-process-filter, tramp-set-remote-path): Do not use `format' in `tramp-message'. * net/tramp-smb.el (tramp-smb-file-name-handler-alist) [file-notify-rm-watch, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (tramp-smb-call-winexe): Do not bind `default-directory'.
2013-08-01 13:10:31 +02:00
(dd (with-current-buffer (process-buffer proc) default-directory))
(ddu (regexp-quote (tramp-gvfs-url-file-name dd))))
(when rest-string
(tramp-message proc 10 "Previous string:\n%s" rest-string))
(tramp-message proc 6 "%S\n%s" proc string)
(setq string (concat rest-string string)
;; Fix action names.
string (tramp-compat-string-replace
"attributes changed" "attribute-changed" string)
string (tramp-compat-string-replace
"changes done" "changes-done-hint" string)
string (tramp-compat-string-replace
"renamed to" "moved" string))
;; https://bugs.launchpad.net/bugs/1742946
Rework Tramp wrt string-match-p, looking-at-p, save-match-data * lisp/net/tramp.el (tramp-find-method, tramp-find-user) (tramp-find-host, tramp-dissect-file-name, tramp-make-tramp-file-name) (tramp-completion-make-tramp-file-name, tramp-debug-message) (tramp-message, tramp-progress-reporter-update) (tramp-set-completion-function) (tramp-rfn-eshadow-update-overlay) (tramp-find-file-name-coding-system-alist) (tramp-file-name-for-operation) (tramp-use-absolute-autoload-file-names) (tramp-get-completion-methods, tramp-get-completion-user-host) (tramp-handle-directory-files) (tramp-handle-file-name-case-insensitive-p) (tramp-handle-file-name-completion, tramp-handle-file-truename) (tramp-handle-insert-directory, tramp-handle-load) (tramp-handle-shell-command, tramp-action-yesno) (tramp-action-yn, tramp-process-actions) (tramp-mode-string-to-int, tramp-get-local-locale) (tramp-local-host-p): * lisp/net/tramp-adb.el (tramp-adb-handle-file-system-info) (tramp-adb-handle-directory-files-and-attributes) (tramp-adb--gnu-switches-to-ash, tramp-adb-sh-fix-ls-output) (tramp-adb-handle-file-name-all-completions) (tramp-adb-handle-shell-command) (tramp-adb-handle-start-file-process): * lisp/net/tramp-archive.el (tramp-archive-dissect-file-name): * lisp/net/tramp-cache.el (tramp-get-hash-table) (tramp-flush-directory-properties, tramp-flush-file-function): * lisp/net/tramp-cmds.el (tramp-reporter-dump-variable) (tramp-append-tramp-buffers): * lisp/net/tramp-compat.el (tramp-compat-process-running-p): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name) (tramp-gvfs-get-file-attributes) (tramp-gvfs-handle-file-attributes) (tramp-gvfs-monitor-process-filter) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec-entry) (tramp-gvfs-mount-spec, tramp-gvfs-maybe-open-connection): * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls) (tramp-do-file-attributes-with-stat) (tramp-sh-handle-file-selinux-context) (tramp-sh-handle-directory-files-and-attributes) (tramp-do-directory-files-and-attributes-with-stat) (tramp-sh-handle-file-name-all-completions) (tramp-sh-handle-dired-compress-file) (tramp-sh-handle-insert-directory) (tramp-sh-handle-expand-file-name) (tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-sh-handle-write-region) (tramp-sh-handle-file-notify-add-watch) (tramp-sh-gio-monitor-process-filter) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter) (tramp-sh-handle-file-system-info, tramp-maybe-send-script) (tramp-find-executable, tramp-open-shell, tramp-find-shell) (tramp-open-connection-setup-interactive-shell) (tramp-find-inline-encoding, tramp-call-local-coding-command) (tramp-compute-multi-hops, tramp-maybe-open-connection) (tramp-convert-file-attributes) (tramp-make-copy-program-file-name, tramp-get-remote-locale) (tramp-get-test-nt-command, tramp-get-remote-stat) (tramp-get-inline-coding): * lisp/net/tramp-smb.el (tramp-smb-handle-directory-files) (tramp-smb-action-get-acl, tramp-smb-handle-file-attributes) (tramp-smb-handle-file-name-all-completions) (tramp-smb-handle-file-system-info) (tramp-smb-handle-file-writable-p) (tramp-smb-handle-insert-directory) (tramp-smb-handle-make-directory) (tramp-smb-handle-make-directory-internal) (tramp-smb-handle-start-file-process, tramp-smb-get-localname) (tramp-smb-read-file-entry): Use `string-match-p' and `looking-at-p'. Remove superfluous `save-match-data'. Apply `eval-when-compile' on constant concat data. * lisp/net/tramp-compat.el (tramp-compat-file-name-quoted-p-p): Use `string-prefix-p'. (tramp-compat-file-name-unquote): Do not use match data.
2018-12-06 16:00:05 +01:00
(when
(string-match-p "Monitoring not supported\\|No locations given" string)
(delete-process proc))
Complete file name handlers. * net/tramp.el (tramp-handle-set-visited-file-modtime) (tramp-handle-verify-visited-file-modtime) (tramp-handle-file-notify-rm-watch): New functions. (tramp-call-process): Do not bind `default-directory'. * net/tramp-adb.el (tramp-adb-file-name-handler-alist): Order alphabetically. [access-file, add-name-to-file, dired-call-process]: [dired-compress-file, file-acl, file-notify-rm-watch]: [file-ownership-preserved-p, file-selinux-context]: [make-directory-internal, make-symbolic-link, set-file-acl]: [set-file-selinux-context, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (tramp-adb-handle-write-region): Apply `set-visited-file-modtime'. * net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) [file-notify-add-watch, file-notify-rm-watch]: [set-file-times, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (with-tramp-gvfs-error-message) (tramp-gvfs-handle-set-visited-file-modtime) (tramp-gvfs-fuse-file-name): Remove. (tramp-gvfs-handle-file-notify-add-watch) (tramp-gvfs-file-gvfs-monitor-file-process-filter): New defuns. (tramp-gvfs-handle-write-region): Fix error in moving tmpfile. * net/tramp-sh.el (tramp-sh-file-name-handler-alist): Order alphabetically. [file-notify-rm-watch ]: Use default Tramp handler. [executable-find]: Remove private handler. (tramp-do-copy-or-rename-file-out-of-band): Do not bind `default-directory'. (tramp-sh-handle-executable-find) (tramp-sh-handle-file-notify-rm-watch): Remove functions. (tramp-sh-file-gvfs-monitor-dir-process-filter) (tramp-sh-file-inotifywait-process-filter, tramp-set-remote-path): Do not use `format' in `tramp-message'. * net/tramp-smb.el (tramp-smb-file-name-handler-alist) [file-notify-rm-watch, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (tramp-smb-call-winexe): Do not bind `default-directory'.
2013-08-01 13:10:31 +02:00
(while (string-match
Rework Tramp wrt string-match-p, looking-at-p, save-match-data * lisp/net/tramp.el (tramp-find-method, tramp-find-user) (tramp-find-host, tramp-dissect-file-name, tramp-make-tramp-file-name) (tramp-completion-make-tramp-file-name, tramp-debug-message) (tramp-message, tramp-progress-reporter-update) (tramp-set-completion-function) (tramp-rfn-eshadow-update-overlay) (tramp-find-file-name-coding-system-alist) (tramp-file-name-for-operation) (tramp-use-absolute-autoload-file-names) (tramp-get-completion-methods, tramp-get-completion-user-host) (tramp-handle-directory-files) (tramp-handle-file-name-case-insensitive-p) (tramp-handle-file-name-completion, tramp-handle-file-truename) (tramp-handle-insert-directory, tramp-handle-load) (tramp-handle-shell-command, tramp-action-yesno) (tramp-action-yn, tramp-process-actions) (tramp-mode-string-to-int, tramp-get-local-locale) (tramp-local-host-p): * lisp/net/tramp-adb.el (tramp-adb-handle-file-system-info) (tramp-adb-handle-directory-files-and-attributes) (tramp-adb--gnu-switches-to-ash, tramp-adb-sh-fix-ls-output) (tramp-adb-handle-file-name-all-completions) (tramp-adb-handle-shell-command) (tramp-adb-handle-start-file-process): * lisp/net/tramp-archive.el (tramp-archive-dissect-file-name): * lisp/net/tramp-cache.el (tramp-get-hash-table) (tramp-flush-directory-properties, tramp-flush-file-function): * lisp/net/tramp-cmds.el (tramp-reporter-dump-variable) (tramp-append-tramp-buffers): * lisp/net/tramp-compat.el (tramp-compat-process-running-p): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name) (tramp-gvfs-get-file-attributes) (tramp-gvfs-handle-file-attributes) (tramp-gvfs-monitor-process-filter) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec-entry) (tramp-gvfs-mount-spec, tramp-gvfs-maybe-open-connection): * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls) (tramp-do-file-attributes-with-stat) (tramp-sh-handle-file-selinux-context) (tramp-sh-handle-directory-files-and-attributes) (tramp-do-directory-files-and-attributes-with-stat) (tramp-sh-handle-file-name-all-completions) (tramp-sh-handle-dired-compress-file) (tramp-sh-handle-insert-directory) (tramp-sh-handle-expand-file-name) (tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-sh-handle-write-region) (tramp-sh-handle-file-notify-add-watch) (tramp-sh-gio-monitor-process-filter) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter) (tramp-sh-handle-file-system-info, tramp-maybe-send-script) (tramp-find-executable, tramp-open-shell, tramp-find-shell) (tramp-open-connection-setup-interactive-shell) (tramp-find-inline-encoding, tramp-call-local-coding-command) (tramp-compute-multi-hops, tramp-maybe-open-connection) (tramp-convert-file-attributes) (tramp-make-copy-program-file-name, tramp-get-remote-locale) (tramp-get-test-nt-command, tramp-get-remote-stat) (tramp-get-inline-coding): * lisp/net/tramp-smb.el (tramp-smb-handle-directory-files) (tramp-smb-action-get-acl, tramp-smb-handle-file-attributes) (tramp-smb-handle-file-name-all-completions) (tramp-smb-handle-file-system-info) (tramp-smb-handle-file-writable-p) (tramp-smb-handle-insert-directory) (tramp-smb-handle-make-directory) (tramp-smb-handle-make-directory-internal) (tramp-smb-handle-start-file-process, tramp-smb-get-localname) (tramp-smb-read-file-entry): Use `string-match-p' and `looking-at-p'. Remove superfluous `save-match-data'. Apply `eval-when-compile' on constant concat data. * lisp/net/tramp-compat.el (tramp-compat-file-name-quoted-p-p): Use `string-prefix-p'. (tramp-compat-file-name-unquote): Do not use match data.
2018-12-06 16:00:05 +01:00
(eval-when-compile
(concat "^.+:"
"[[:space:]]\\(.+\\):"
"[[:space:]]" (regexp-opt tramp-gio-events t)
"\\([[:space:]]\\(.+\\)\\)?$"))
Complete file name handlers. * net/tramp.el (tramp-handle-set-visited-file-modtime) (tramp-handle-verify-visited-file-modtime) (tramp-handle-file-notify-rm-watch): New functions. (tramp-call-process): Do not bind `default-directory'. * net/tramp-adb.el (tramp-adb-file-name-handler-alist): Order alphabetically. [access-file, add-name-to-file, dired-call-process]: [dired-compress-file, file-acl, file-notify-rm-watch]: [file-ownership-preserved-p, file-selinux-context]: [make-directory-internal, make-symbolic-link, set-file-acl]: [set-file-selinux-context, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (tramp-adb-handle-write-region): Apply `set-visited-file-modtime'. * net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) [file-notify-add-watch, file-notify-rm-watch]: [set-file-times, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (with-tramp-gvfs-error-message) (tramp-gvfs-handle-set-visited-file-modtime) (tramp-gvfs-fuse-file-name): Remove. (tramp-gvfs-handle-file-notify-add-watch) (tramp-gvfs-file-gvfs-monitor-file-process-filter): New defuns. (tramp-gvfs-handle-write-region): Fix error in moving tmpfile. * net/tramp-sh.el (tramp-sh-file-name-handler-alist): Order alphabetically. [file-notify-rm-watch ]: Use default Tramp handler. [executable-find]: Remove private handler. (tramp-do-copy-or-rename-file-out-of-band): Do not bind `default-directory'. (tramp-sh-handle-executable-find) (tramp-sh-handle-file-notify-rm-watch): Remove functions. (tramp-sh-file-gvfs-monitor-dir-process-filter) (tramp-sh-file-inotifywait-process-filter, tramp-set-remote-path): Do not use `format' in `tramp-message'. * net/tramp-smb.el (tramp-smb-file-name-handler-alist) [file-notify-rm-watch, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (tramp-smb-call-winexe): Do not bind `default-directory'.
2013-08-01 13:10:31 +02:00
string)
(let ((file (match-string 1 string))
(file1 (match-string 4 string))
(action (intern-soft (match-string 2 string))))
Complete file name handlers. * net/tramp.el (tramp-handle-set-visited-file-modtime) (tramp-handle-verify-visited-file-modtime) (tramp-handle-file-notify-rm-watch): New functions. (tramp-call-process): Do not bind `default-directory'. * net/tramp-adb.el (tramp-adb-file-name-handler-alist): Order alphabetically. [access-file, add-name-to-file, dired-call-process]: [dired-compress-file, file-acl, file-notify-rm-watch]: [file-ownership-preserved-p, file-selinux-context]: [make-directory-internal, make-symbolic-link, set-file-acl]: [set-file-selinux-context, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (tramp-adb-handle-write-region): Apply `set-visited-file-modtime'. * net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) [file-notify-add-watch, file-notify-rm-watch]: [set-file-times, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (with-tramp-gvfs-error-message) (tramp-gvfs-handle-set-visited-file-modtime) (tramp-gvfs-fuse-file-name): Remove. (tramp-gvfs-handle-file-notify-add-watch) (tramp-gvfs-file-gvfs-monitor-file-process-filter): New defuns. (tramp-gvfs-handle-write-region): Fix error in moving tmpfile. * net/tramp-sh.el (tramp-sh-file-name-handler-alist): Order alphabetically. [file-notify-rm-watch ]: Use default Tramp handler. [executable-find]: Remove private handler. (tramp-do-copy-or-rename-file-out-of-band): Do not bind `default-directory'. (tramp-sh-handle-executable-find) (tramp-sh-handle-file-notify-rm-watch): Remove functions. (tramp-sh-file-gvfs-monitor-dir-process-filter) (tramp-sh-file-inotifywait-process-filter, tramp-set-remote-path): Do not use `format' in `tramp-message'. * net/tramp-smb.el (tramp-smb-file-name-handler-alist) [file-notify-rm-watch, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (tramp-smb-call-winexe): Do not bind `default-directory'.
2013-08-01 13:10:31 +02:00
(setq string (replace-match "" nil nil string))
;; File names are returned as URL paths. We must convert them.
(when (string-match ddu file)
(setq file (replace-match dd nil nil file)))
Tramp code cleanup * lisp/net/tramp.el (tramp-shell-prompt-pattern) (tramp-wrong-passwd-regexp, tramp-method-regexp-alist) (tramp-domain-regexp, tramp-host-regexp, tramp-ipv6-regexp) (tramp-port-regexp, tramp-debug-outline-regexp) (tramp-drop-volume-letter, tramp-parse-shostkeys) (tramp-handle-file-name-case-insensitive-p): * lisp/net/tramp-adb.el (tramp-adb-send-command-and-check): * lisp/net/tramp-ftp.el (tramp-ftp-enable-ange-ftp): * lisp/net/tramp-gvfs.el (tramp-gvfs-monitor-process-filter): * lisp/net/tramp-sh.el (tramp-display-escape-sequence-regexp) (tramp-device-escape-sequence-regexp): * lisp/net/tramp-smb.el (tramp-smb-do-file-attributes-with-stat) (tramp-smb-handle-set-file-acl, tramp-smb-read-file-entry): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-file-selinux-context): Use character classes in regexp. * lisp/net/tramp-adb.el (tramp-adb-ls-date-year-regexp) (tramp-adb-ls-date-time-regexp): New defconst. (tramp-adb-ls-date-regexp, tramp-adb-ls-toolbox-regexp) (tramp-adb-sh-fix-ls-output): Use them. (tramp-adb-handle-set-file-times, tramp-adb-maybe-open-connection): Apply `eval-when-compile' on constant concat data. (tramp-do-parse-file-attributes-with-ls): Suppress `signal-hook-function'. (tramp-adb--gnu-switches-to-ash): Remove unused function. (tramp-adb-handle-set-file-modes): Qhote argument. (tramp-adb-maybe-open-connection): Set file property rather than flush. * lisp/net/tramp-cmds.el (tramp-rename-these-files): Apply `eval-when-compile' on constant concat data. * lisp/net/tramp-gvfs.el (tramp-gvfs-file-attributes) (tramp-gvfs-file-attributes-with-gvfs-ls-regexp): Embed them in `eval-and-compile'. (tramp-gvfs-get-directory-attributes): Apply `eval-when-compile' on constant concat data.
2020-07-10 10:45:14 +02:00
(while (string-match-p "%\\([[:xdigit:]]\\{2\\}\\)" file)
(setq file (url-unhex-string file)))
(when (string-match ddu (or file1 ""))
(setq file1 (replace-match dd nil nil file1)))
Tramp code cleanup * lisp/net/tramp.el (tramp-shell-prompt-pattern) (tramp-wrong-passwd-regexp, tramp-method-regexp-alist) (tramp-domain-regexp, tramp-host-regexp, tramp-ipv6-regexp) (tramp-port-regexp, tramp-debug-outline-regexp) (tramp-drop-volume-letter, tramp-parse-shostkeys) (tramp-handle-file-name-case-insensitive-p): * lisp/net/tramp-adb.el (tramp-adb-send-command-and-check): * lisp/net/tramp-ftp.el (tramp-ftp-enable-ange-ftp): * lisp/net/tramp-gvfs.el (tramp-gvfs-monitor-process-filter): * lisp/net/tramp-sh.el (tramp-display-escape-sequence-regexp) (tramp-device-escape-sequence-regexp): * lisp/net/tramp-smb.el (tramp-smb-do-file-attributes-with-stat) (tramp-smb-handle-set-file-acl, tramp-smb-read-file-entry): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-file-selinux-context): Use character classes in regexp. * lisp/net/tramp-adb.el (tramp-adb-ls-date-year-regexp) (tramp-adb-ls-date-time-regexp): New defconst. (tramp-adb-ls-date-regexp, tramp-adb-ls-toolbox-regexp) (tramp-adb-sh-fix-ls-output): Use them. (tramp-adb-handle-set-file-times, tramp-adb-maybe-open-connection): Apply `eval-when-compile' on constant concat data. (tramp-do-parse-file-attributes-with-ls): Suppress `signal-hook-function'. (tramp-adb--gnu-switches-to-ash): Remove unused function. (tramp-adb-handle-set-file-modes): Qhote argument. (tramp-adb-maybe-open-connection): Set file property rather than flush. * lisp/net/tramp-cmds.el (tramp-rename-these-files): Apply `eval-when-compile' on constant concat data. * lisp/net/tramp-gvfs.el (tramp-gvfs-file-attributes) (tramp-gvfs-file-attributes-with-gvfs-ls-regexp): Embed them in `eval-and-compile'. (tramp-gvfs-get-directory-attributes): Apply `eval-when-compile' on constant concat data.
2020-07-10 10:45:14 +02:00
(while (string-match-p "%\\([[:xdigit:]]\\{2\\}\\)" (or file1 ""))
(setq file1 (url-unhex-string file1)))
;; Remove watch when file or directory to be watched is deleted.
(when (and (member action '(moved deleted))
(string-equal file (process-get proc 'watch-name)))
(delete-process proc))
Complete file name handlers. * net/tramp.el (tramp-handle-set-visited-file-modtime) (tramp-handle-verify-visited-file-modtime) (tramp-handle-file-notify-rm-watch): New functions. (tramp-call-process): Do not bind `default-directory'. * net/tramp-adb.el (tramp-adb-file-name-handler-alist): Order alphabetically. [access-file, add-name-to-file, dired-call-process]: [dired-compress-file, file-acl, file-notify-rm-watch]: [file-ownership-preserved-p, file-selinux-context]: [make-directory-internal, make-symbolic-link, set-file-acl]: [set-file-selinux-context, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (tramp-adb-handle-write-region): Apply `set-visited-file-modtime'. * net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) [file-notify-add-watch, file-notify-rm-watch]: [set-file-times, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (with-tramp-gvfs-error-message) (tramp-gvfs-handle-set-visited-file-modtime) (tramp-gvfs-fuse-file-name): Remove. (tramp-gvfs-handle-file-notify-add-watch) (tramp-gvfs-file-gvfs-monitor-file-process-filter): New defuns. (tramp-gvfs-handle-write-region): Fix error in moving tmpfile. * net/tramp-sh.el (tramp-sh-file-name-handler-alist): Order alphabetically. [file-notify-rm-watch ]: Use default Tramp handler. [executable-find]: Remove private handler. (tramp-do-copy-or-rename-file-out-of-band): Do not bind `default-directory'. (tramp-sh-handle-executable-find) (tramp-sh-handle-file-notify-rm-watch): Remove functions. (tramp-sh-file-gvfs-monitor-dir-process-filter) (tramp-sh-file-inotifywait-process-filter, tramp-set-remote-path): Do not use `format' in `tramp-message'. * net/tramp-smb.el (tramp-smb-file-name-handler-alist) [file-notify-rm-watch, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (tramp-smb-call-winexe): Do not bind `default-directory'.
2013-08-01 13:10:31 +02:00
;; Usually, we would add an Emacs event now. Unfortunately,
;; `unread-command-events' does not accept several events at
;; once. Therefore, we apply the callback directly.
(when (member action events)
(tramp-compat-funcall
'file-notify-callback (list proc action file file1)))))
Complete file name handlers. * net/tramp.el (tramp-handle-set-visited-file-modtime) (tramp-handle-verify-visited-file-modtime) (tramp-handle-file-notify-rm-watch): New functions. (tramp-call-process): Do not bind `default-directory'. * net/tramp-adb.el (tramp-adb-file-name-handler-alist): Order alphabetically. [access-file, add-name-to-file, dired-call-process]: [dired-compress-file, file-acl, file-notify-rm-watch]: [file-ownership-preserved-p, file-selinux-context]: [make-directory-internal, make-symbolic-link, set-file-acl]: [set-file-selinux-context, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (tramp-adb-handle-write-region): Apply `set-visited-file-modtime'. * net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) [file-notify-add-watch, file-notify-rm-watch]: [set-file-times, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (with-tramp-gvfs-error-message) (tramp-gvfs-handle-set-visited-file-modtime) (tramp-gvfs-fuse-file-name): Remove. (tramp-gvfs-handle-file-notify-add-watch) (tramp-gvfs-file-gvfs-monitor-file-process-filter): New defuns. (tramp-gvfs-handle-write-region): Fix error in moving tmpfile. * net/tramp-sh.el (tramp-sh-file-name-handler-alist): Order alphabetically. [file-notify-rm-watch ]: Use default Tramp handler. [executable-find]: Remove private handler. (tramp-do-copy-or-rename-file-out-of-band): Do not bind `default-directory'. (tramp-sh-handle-executable-find) (tramp-sh-handle-file-notify-rm-watch): Remove functions. (tramp-sh-file-gvfs-monitor-dir-process-filter) (tramp-sh-file-inotifywait-process-filter, tramp-set-remote-path): Do not use `format' in `tramp-message'. * net/tramp-smb.el (tramp-smb-file-name-handler-alist) [file-notify-rm-watch, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (tramp-smb-call-winexe): Do not bind `default-directory'.
2013-08-01 13:10:31 +02:00
;; Save rest of the string.
(when (zerop (length string)) (setq string nil))
(when string (tramp-message proc 10 "Rest string:\n%s" string))
Remove XEmacs compatibility in Tramp * doc/misc/tramp.texi: Replace flags by their hard coded name. Remove unused flags and the enclosed alternative text for XEmacs. * doc/misc/trampver.texi: Use "Tramp" CamelCase. Rename "emacs" and "xemacs" flags to "unified" and "separate". Remove flags "emacsgw", "emacsname", "emacsdir", "ftppackagename", "emacsothername", "emacsotherdir" and "emacsotherfilename". (trampver): * lisp/net/trampver.el (tramp-version): Set to "2.3.0-pre". * lisp/net/tramp.el (bkup-backup-directory-info) (directory-sep-char, ls-lisp-use-insert-directory-program) (outline-regexp, tramp-backup-directory-alist) (tramp-default-method, tramp-shell-prompt-pattern, tramp-syntax) (tramp-file-name-regexp-unified) (tramp-file-name-regexp-separate) (tramp-completion-file-name-regexp-unified) (tramp-completion-file-name-regexp-separate, tramp-chunksize) (tramp-get-method-parameter, tramp-find-method, tramp-find-user) (tramp-debug-message, tramp-progress-reporter-update) (with-tramp-progress-reporter) (tramp-rfn-eshadow-setup-minibuffer) (rfn-eshadow-setup-minibuffer-hook, tramp-unload-hook) (tramp-rfn-eshadow-update-overlay) (rfn-eshadow-update-overlay-hook, tramp-default-file-modes) (tramp-file-name-for-operation) (tramp-completion-file-name-handler) (tramp-autoload-file-name-handler, tramp-completion-mode-p) (tramp-handle-directory-files) (tramp-handle-directory-files-and-attributes) (tramp-handle-dired-uncache, tramp-handle-find-backup-file-name) (tramp-handle-insert-file-contents, tramp-handle-load) (tramp-handle-shell-command) (tramp-handle-verify-visited-file-modtime) (tramp-handle-file-notify-valid-p, tramp-accept-process-output) (tramp-check-for-regexp, tramp-wait-for-regexp) (tramp-send-string, tramp-mode-string-to-int) (tramp-get-local-gid, tramp-check-cached-permissions) (tramp-get-remote-tmpdir, tramp-make-tramp-temp-file) (auto-save-file-name-transforms) (tramp-handle-make-auto-save-file-name, tramp-read-passwd) (tramp-clear-passwd, tramp-time-diff): * lisp/net/tramp-adb.el (directory-listing-before-filename-regexp) (directory-sep-char, tramp-adb-file-name-handler-alist) (tramp-adb-parse-device-names) (tramp-adb-handle-expand-file-name) (tramp-adb-handle-file-truename, tramp-adb--gnu-switches-to-ash) (tramp-adb-handle-file-local-copy) (tramp-adb-handle-write-region, tramp-adb-handle-set-file-modes) (tramp-adb-handle-rename-file, tramp-adb-handle-process-file) (tramp-adb-handle-shell-command) (tramp-adb-handle-start-file-process, tramp-adb-get-device) (tramp-adb-maybe-open-connection): * lisp/net/tramp-cache.el (tramp-persistency-file-name) (tramp-cache-print): * lisp/net/tramp-cmds.el (tramp-cleanup-all-connections) (tramp-bug, tramp-reporter-dump-variable) (tramp-load-report-modules, tramp-append-tramp-buffers): * lisp/net/tramp-compat.el (tramp-compat-funcall) (tramp-advice-file-expand-wildcards) (tramp-compat-temporary-file-directory) (tramp-compat-make-temp-file, tramp-compat-copy-file) (tramp-compat-delete-directory, ) (tramp-compat-process-running-p): * lisp/net/tramp-ftp.el (tramp-methods) <ftp>: (tramp-default-method-alist, tramp-foreign-file-name-handler-alist): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) (tramp-gvfs-do-copy-or-rename-file, tramp-gvfs-handle-copy-file) (tramp-gvfs-handle-file-local-copy) (tramp-gvfs-handle-file-name-all-completions) (tramp-gvfs-handle-file-notify-add-watch) (tramp-gvfs-monitor-file-process-filter) (tramp-gvfs-handle-file-readable-p) (tramp-gvfs-handle-rename-file, tramp-gvfs-handle-write-region) (tramp-gvfs-file-name, tramp-gvfs-handler-askquestion) (tramp-gvfs-maybe-open-connection) (tramp-gvfs-parse-device-names): * lisp/net/tramp-gw.el (tramp-gw-aux-proc-sentinel) (tramp-gw-open-connection, tramp-gw-open-network-stream): * lisp/net/tramp-sh.el (directory-sep-char) (tramp-sh-file-name-handler-alist) (tramp-sh-handle-file-truename) (tramp-sh-handle-set-visited-file-modtime) (tramp-sh-handle-verify-visited-file-modtime) (tramp-sh-handle-set-file-modes, tramp-sh-handle-set-file-times) (tramp-sh-handle-file-acl) (tramp-sh-handle-file-name-all-completions) (tramp-sh-handle-copy-file, tramp-sh-handle-rename-file) (tramp-do-copy-or-rename-file-directly) (tramp-do-copy-or-rename-file-out-of-band) (dired-compress-file-suffixes, dired-remove-file) (tramp-sh-handle-dired-compress-file) (tramp-sh-handle-insert-directory) (tramp-sh-handle-expand-file-name) (tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-sh-handle-file-local-copy) (tramp-sh-handle-write-region, tramp-sh-handle-vc-registered) (tramp-sh-handle-file-notify-add-watch) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter, tramp-maybe-send-script) (tramp-find-executable) (tramp-open-connection-setup-interactive-shell) (tramp-find-inline-encoding, tramp-compute-multi-hops) (tramp-maybe-open-connection, tramp-convert-file-attributes) (tramp-get-remote-path, tramp-get-remote-touch): * lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist) (tramp-smb-handle-copy-directory, tramp-smb-handle-copy-file) (tramp-smb-handle-delete-directory) (tramp-smb-handle-directory-files, tramp-smb-handle-file-acl) (tramp-smb-handle-make-directory-internal) (tramp-smb-handle-process-file, tramp-smb-handle-rename-file) (tramp-smb-handle-set-file-acl, tramp-smb-handle-set-file-modes) (tramp-smb-handle-write-region, tramp-smb-get-file-entries) (tramp-smb-get-cifs-capabilities) (tramp-smb-maybe-open-connection): * lisp/net/trampver.el (tramp-repository-get-version): Remove XEmacs compat code. * lisp/net/tramp-cmds.el (mml-mode, mml-insert-empty-tag) (reporter-dump-variable): Declare functions. * lisp/net/tramp.el (tramp-bkup-backup-directory-info) (tramp-advice-minibuffer-electric-separator) (tramp-advice-minibuffer-electric-tilde) (tramp-handle-unhandled-file-name-directory): * lisp/net/tramp-compat.el (tramp-compat-with-temp-message) (tramp-compat-font-lock-add-keywords) (tramp-compat-load, tramp-compat-number-sequence) (tramp-compat-split-string, tramp-compat-delete-dups): * lisp/net/tramp-sh.el (tramp-sh-handle-insert-file-contents-literally): Remove. * lisp/net/tramp-sh.el (tramp-methods) <psftp>: This does not work recursively.
2016-01-14 14:12:17 +01:00
(process-put proc 'rest-string string)))
Complete file name handlers. * net/tramp.el (tramp-handle-set-visited-file-modtime) (tramp-handle-verify-visited-file-modtime) (tramp-handle-file-notify-rm-watch): New functions. (tramp-call-process): Do not bind `default-directory'. * net/tramp-adb.el (tramp-adb-file-name-handler-alist): Order alphabetically. [access-file, add-name-to-file, dired-call-process]: [dired-compress-file, file-acl, file-notify-rm-watch]: [file-ownership-preserved-p, file-selinux-context]: [make-directory-internal, make-symbolic-link, set-file-acl]: [set-file-selinux-context, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (tramp-adb-handle-write-region): Apply `set-visited-file-modtime'. * net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) [file-notify-add-watch, file-notify-rm-watch]: [set-file-times, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (with-tramp-gvfs-error-message) (tramp-gvfs-handle-set-visited-file-modtime) (tramp-gvfs-fuse-file-name): Remove. (tramp-gvfs-handle-file-notify-add-watch) (tramp-gvfs-file-gvfs-monitor-file-process-filter): New defuns. (tramp-gvfs-handle-write-region): Fix error in moving tmpfile. * net/tramp-sh.el (tramp-sh-file-name-handler-alist): Order alphabetically. [file-notify-rm-watch ]: Use default Tramp handler. [executable-find]: Remove private handler. (tramp-do-copy-or-rename-file-out-of-band): Do not bind `default-directory'. (tramp-sh-handle-executable-find) (tramp-sh-handle-file-notify-rm-watch): Remove functions. (tramp-sh-file-gvfs-monitor-dir-process-filter) (tramp-sh-file-inotifywait-process-filter, tramp-set-remote-path): Do not use `format' in `tramp-message'. * net/tramp-smb.el (tramp-smb-file-name-handler-alist) [file-notify-rm-watch, set-visited-file-modtime]: [verify-visited-file-modtime]: Add handler. (tramp-smb-call-winexe): Do not bind `default-directory'.
2013-08-01 13:10:31 +02:00
2009-06-22 21:04:49 +00:00
(defun tramp-gvfs-handle-file-readable-p (filename)
"Like `file-readable-p' for Tramp files."
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(with-parsed-tramp-file-name filename nil
Remove XEmacs compatibility in Tramp * doc/misc/tramp.texi: Replace flags by their hard coded name. Remove unused flags and the enclosed alternative text for XEmacs. * doc/misc/trampver.texi: Use "Tramp" CamelCase. Rename "emacs" and "xemacs" flags to "unified" and "separate". Remove flags "emacsgw", "emacsname", "emacsdir", "ftppackagename", "emacsothername", "emacsotherdir" and "emacsotherfilename". (trampver): * lisp/net/trampver.el (tramp-version): Set to "2.3.0-pre". * lisp/net/tramp.el (bkup-backup-directory-info) (directory-sep-char, ls-lisp-use-insert-directory-program) (outline-regexp, tramp-backup-directory-alist) (tramp-default-method, tramp-shell-prompt-pattern, tramp-syntax) (tramp-file-name-regexp-unified) (tramp-file-name-regexp-separate) (tramp-completion-file-name-regexp-unified) (tramp-completion-file-name-regexp-separate, tramp-chunksize) (tramp-get-method-parameter, tramp-find-method, tramp-find-user) (tramp-debug-message, tramp-progress-reporter-update) (with-tramp-progress-reporter) (tramp-rfn-eshadow-setup-minibuffer) (rfn-eshadow-setup-minibuffer-hook, tramp-unload-hook) (tramp-rfn-eshadow-update-overlay) (rfn-eshadow-update-overlay-hook, tramp-default-file-modes) (tramp-file-name-for-operation) (tramp-completion-file-name-handler) (tramp-autoload-file-name-handler, tramp-completion-mode-p) (tramp-handle-directory-files) (tramp-handle-directory-files-and-attributes) (tramp-handle-dired-uncache, tramp-handle-find-backup-file-name) (tramp-handle-insert-file-contents, tramp-handle-load) (tramp-handle-shell-command) (tramp-handle-verify-visited-file-modtime) (tramp-handle-file-notify-valid-p, tramp-accept-process-output) (tramp-check-for-regexp, tramp-wait-for-regexp) (tramp-send-string, tramp-mode-string-to-int) (tramp-get-local-gid, tramp-check-cached-permissions) (tramp-get-remote-tmpdir, tramp-make-tramp-temp-file) (auto-save-file-name-transforms) (tramp-handle-make-auto-save-file-name, tramp-read-passwd) (tramp-clear-passwd, tramp-time-diff): * lisp/net/tramp-adb.el (directory-listing-before-filename-regexp) (directory-sep-char, tramp-adb-file-name-handler-alist) (tramp-adb-parse-device-names) (tramp-adb-handle-expand-file-name) (tramp-adb-handle-file-truename, tramp-adb--gnu-switches-to-ash) (tramp-adb-handle-file-local-copy) (tramp-adb-handle-write-region, tramp-adb-handle-set-file-modes) (tramp-adb-handle-rename-file, tramp-adb-handle-process-file) (tramp-adb-handle-shell-command) (tramp-adb-handle-start-file-process, tramp-adb-get-device) (tramp-adb-maybe-open-connection): * lisp/net/tramp-cache.el (tramp-persistency-file-name) (tramp-cache-print): * lisp/net/tramp-cmds.el (tramp-cleanup-all-connections) (tramp-bug, tramp-reporter-dump-variable) (tramp-load-report-modules, tramp-append-tramp-buffers): * lisp/net/tramp-compat.el (tramp-compat-funcall) (tramp-advice-file-expand-wildcards) (tramp-compat-temporary-file-directory) (tramp-compat-make-temp-file, tramp-compat-copy-file) (tramp-compat-delete-directory, ) (tramp-compat-process-running-p): * lisp/net/tramp-ftp.el (tramp-methods) <ftp>: (tramp-default-method-alist, tramp-foreign-file-name-handler-alist): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) (tramp-gvfs-do-copy-or-rename-file, tramp-gvfs-handle-copy-file) (tramp-gvfs-handle-file-local-copy) (tramp-gvfs-handle-file-name-all-completions) (tramp-gvfs-handle-file-notify-add-watch) (tramp-gvfs-monitor-file-process-filter) (tramp-gvfs-handle-file-readable-p) (tramp-gvfs-handle-rename-file, tramp-gvfs-handle-write-region) (tramp-gvfs-file-name, tramp-gvfs-handler-askquestion) (tramp-gvfs-maybe-open-connection) (tramp-gvfs-parse-device-names): * lisp/net/tramp-gw.el (tramp-gw-aux-proc-sentinel) (tramp-gw-open-connection, tramp-gw-open-network-stream): * lisp/net/tramp-sh.el (directory-sep-char) (tramp-sh-file-name-handler-alist) (tramp-sh-handle-file-truename) (tramp-sh-handle-set-visited-file-modtime) (tramp-sh-handle-verify-visited-file-modtime) (tramp-sh-handle-set-file-modes, tramp-sh-handle-set-file-times) (tramp-sh-handle-file-acl) (tramp-sh-handle-file-name-all-completions) (tramp-sh-handle-copy-file, tramp-sh-handle-rename-file) (tramp-do-copy-or-rename-file-directly) (tramp-do-copy-or-rename-file-out-of-band) (dired-compress-file-suffixes, dired-remove-file) (tramp-sh-handle-dired-compress-file) (tramp-sh-handle-insert-directory) (tramp-sh-handle-expand-file-name) (tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-sh-handle-file-local-copy) (tramp-sh-handle-write-region, tramp-sh-handle-vc-registered) (tramp-sh-handle-file-notify-add-watch) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter, tramp-maybe-send-script) (tramp-find-executable) (tramp-open-connection-setup-interactive-shell) (tramp-find-inline-encoding, tramp-compute-multi-hops) (tramp-maybe-open-connection, tramp-convert-file-attributes) (tramp-get-remote-path, tramp-get-remote-touch): * lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist) (tramp-smb-handle-copy-directory, tramp-smb-handle-copy-file) (tramp-smb-handle-delete-directory) (tramp-smb-handle-directory-files, tramp-smb-handle-file-acl) (tramp-smb-handle-make-directory-internal) (tramp-smb-handle-process-file, tramp-smb-handle-rename-file) (tramp-smb-handle-set-file-acl, tramp-smb-handle-set-file-modes) (tramp-smb-handle-write-region, tramp-smb-get-file-entries) (tramp-smb-get-cifs-capabilities) (tramp-smb-maybe-open-connection): * lisp/net/trampver.el (tramp-repository-get-version): Remove XEmacs compat code. * lisp/net/tramp-cmds.el (mml-mode, mml-insert-empty-tag) (reporter-dump-variable): Declare functions. * lisp/net/tramp.el (tramp-bkup-backup-directory-info) (tramp-advice-minibuffer-electric-separator) (tramp-advice-minibuffer-electric-tilde) (tramp-handle-unhandled-file-name-directory): * lisp/net/tramp-compat.el (tramp-compat-with-temp-message) (tramp-compat-font-lock-add-keywords) (tramp-compat-load, tramp-compat-number-sequence) (tramp-compat-split-string, tramp-compat-delete-dups): * lisp/net/tramp-sh.el (tramp-sh-handle-insert-file-contents-literally): Remove. * lisp/net/tramp-sh.el (tramp-methods) <psftp>: This does not work recursively.
2016-01-14 14:12:17 +01:00
(with-tramp-file-property v localname "file-readable-p"
(and (file-exists-p filename)
(or (tramp-check-cached-permissions v ?r)
;; `tramp-check-cached-permissions' doesn't handle
;; symbolic links.
(and (stringp (file-symlink-p filename))
(file-readable-p
(concat
(file-remote-p filename) (file-symlink-p filename))))
;; If the user is different from what we guess to be
;; the user, we don't know. Let's check, whether
;; access is restricted explicitly.
Rearrange detecting remote uid and gid in Tramp * 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-rclone.el (tramp-rclone-file-name-handler-alist): * lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist): Add `tramp-get-remote-gid' and 'tramp-get-remote-uid'. * lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler-alist): Add `file-ownership-preserved-p'. (tramp-crypt-add-directory): Check, that NAME is not quoted. (tramp-crypt-handle-file-ownership-preserved-p): New defun. (tramp-crypt-handle-insert-directory): Fix docstring. * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add `tramp-get-remote-gid' and 'tramp-get-remote-uid'. (tramp-gvfs-handle-file-readable-p): Call `tramp-get-remote-uid'. (tramp-gvfs-handle-get-remote-uid) (tramp-gvfs-handle-get-remote-gid): Rename from `tramp-gvfs-get-remote-{uid,gid}'. Do not cache result. (tramp-gvfs-maybe-open-connection): No special handling for remote uid and gid. * lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist): Add `tramp-get-remote-gid' and 'tramp-get-remote-uid'. (tramp-sh-handle-get-remote-uid, tramp-sh-handle-get-remote-gid): Rename from `tramp-get-remote-{uid,gid}'. Do not cache result. (tramp-sh-handle-file-ownership-preserved-p): Distinguish by GROUP when caching. * lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler-alist): Add `tramp-get-remote-gid' and 'tramp-get-remote-uid'. (tramp-sudoedit-handle-get-remote-uid) (tramp-sudoedit-handle-get-remote-gid): Rename from `tramp-sudoedit-get-remote-{uid,gid}'. Do not cache result. (tramp-sudoedit-handle-set-file-uid-gid) (tramp-sudoedit-handle-write-region): Call `tramp-get-remote-uid' and `tramp-get-remote-gid'. (tramp-sudoedit-maybe-open-connection): No special handling for remote uid and gid. * lisp/net/tramp.el (tramp-file-name-for-operation): Add `tramp-get-remote-gid' and 'tramp-get-remote-uid'. (tramp-handle-write-region, tramp-check-cached-permissions): Call `tramp-get-remote-uid' and `tramp-get-remote-gid'. (tramp-get-remote-uid, tramp-get-remote-gid): New defuns. (tramp-local-host-p): Simplify `tramp-get-remote-uid' call. * test/lisp/net/tramp-tests.el (tramp-test17-dired-with-wildcards) Skip if needed.
2020-06-14 15:31:17 +02:00
(and (/= (tramp-get-remote-uid v 'integer)
(tramp-compat-file-attribute-user-id
(file-attributes filename 'integer)))
(not
(string-equal
"FALSE"
(cdr (assoc
"access::can-read"
(tramp-gvfs-get-file-attributes filename)))))))))))
(defun tramp-gvfs-handle-file-system-info (filename)
"Like `file-system-info' for Tramp files."
(setq filename (directory-file-name (expand-file-name filename)))
(with-parsed-tramp-file-name filename nil
;; We don't use cached values.
Extend tramp-cache.el interface * lisp/net/tramp.el (tramp-handle-add-name-to-file) (tramp-handle-dired-uncache): * lisp/net/tramp-adb.el (tramp-adb-handle-make-directory) (tramp-adb-handle-delete-directory, tramp-adb-handle-delete-file) (tramp-adb-handle-write-region, tramp-adb-handle-set-file-modes) (tramp-adb-handle-set-file-times, tramp-adb-handle-copy-file) (tramp-adb-handle-rename-file, tramp-adb-handle-process-file) (tramp-adb-handle-start-file-process, tramp-adb-get-device) (tramp-adb-maybe-open-connection): * lisp/net/tramp-cache.el (tramp-flush-file-properties) (tramp-flush-directory-properties, tramp-flush-file-function): * lisp/net/tramp-cmds.el (tramp-cleanup-connection): * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file) (tramp-gvfs-handle-delete-directory, tramp-gvfs-handle-delete-file) (tramp-gvfs-handle-file-system-info, tramp-gvfs-handle-make-directory) (tramp-gvfs-handle-write-region, tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-send-command): * lisp/net/tramp-sh.el (tramp-sh-handle-make-symbolic-link) (tramp-sh-handle-set-file-modes, tramp-sh-handle-set-file-times) (tramp-sh-handle-set-file-selinux-context, tramp-sh-handle-set-file-acl) (tramp-sh-handle-add-name-to-file, tramp-sh-handle-copy-directory) (tramp-do-copy-or-rename-file, tramp-do-copy-or-rename-file-out-of-band) (tramp-sh-handle-make-directory, tramp-sh-handle-delete-directory) (tramp-sh-handle-delete-file, tramp-sh-handle-dired-compress-file) (tramp-process-sentinel, tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-sh-handle-write-region): * lisp/net/tramp-smb.el (tramp-smb-handle-add-name-to-file) (tramp-smb-handle-copy-directory, tramp-smb-handle-copy-file) (tramp-smb-handle-delete-directory, tramp-smb-handle-delete-file) (tramp-smb-handle-file-acl, tramp-smb-handle-make-directory-internal) (tramp-smb-handle-make-symbolic-link, tramp-smb-handle-process-file) (tramp-smb-handle-rename-file, tramp-smb-handle-set-file-acl) (tramp-smb-handle-set-file-modes, tramp-smb-handle-start-file-process) (tramp-smb-handle-write-region, tramp-smb-maybe-open-connection): Use them. * lisp/net/tramp-cache.el (tramp-flush-file-properties) (tramp-flush-directory-properties, tramp-flush-connection-properties): Rename from `tramp-flush-file-property',`tramp-flush-directory-property' and `tramp-flush-connection-property', respectively. (tramp-flush-file-property, tramp-flush-connection-property): New defuns.
2017-12-12 15:46:17 +01:00
(tramp-flush-file-property v localname "file-system-attributes")
(let* ((attr (tramp-gvfs-get-root-attributes filename 'file-system))
(size (cdr (assoc "filesystem::size" attr)))
(used (cdr (assoc "filesystem::used" attr)))
(free (cdr (assoc "filesystem::free" attr))))
(when (or size used free)
(list (string-to-number (or size "0"))
(string-to-number (or free "0"))
(- (string-to-number (or size "0"))
(string-to-number (or used "0"))))))))
2009-06-22 21:04:49 +00:00
(defun tramp-gvfs-handle-make-directory (dir &optional parents)
"Like `make-directory' for Tramp files."
Sync with Tramp repository * doc/misc/tramp.texi (Configuration): Note, that Tramp must be required prior changing its configuration. (Connection caching, Predefined connection information) (Remote shell setup): Fix typos. (Predefined connection information): Describe, how to overwrite parameters of `tramp-methods'. (Remote programs, Remote processes, Traces and Profiles): Simplify example. (Remote programs): Remove superfluous comment. * doc/misc/trampver.texi: Update release number. * lisp/net/tramp-cache.el (tramp-connection-properties): Adapt docstring. * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file): New defun. (tramp-gvfs-handle-copy-file, tramp-gvfs-handle-rename-file): Use it. (tramp-gvfs-handle-make-directory): Reimplement PARENTS handling, "gvfs-mkdir -p ..." does not work robust. (tramp-gvfs-maybe-open-connection): Adapt `tramp-get-method-parameter' call. * lisp/net/tramp-sh.el (tramp-methods): Add `tramp-remote-shell-login' parameter where it fits. (tramp-get-remote-path): Use it. (tramp-make-copy-program-file-name): Fix quoting for "psftp" method. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/tramp.el (tramp-methods): Adapt docstring. (tramp-get-method-parameter): Replace argument METHOD by VEC. Check also for hits in `tramp-connection-properties'. Adapt docstring. (tramp-get-remote-tmpdir): Cache only the local name of tmpdir. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/trampver.el Update release number. * test/automated/tramp-tests.el (tramp--instrument-test-case): Add "^make-symbolic-link not supported$" to `debug-ignored-errors'. (tramp-test13-make-directory, tramp--test-adb-p) (tramp--test-smb-or-windows-nt-p): Simplify. (tramp--test-ftp-p, tramp--test-gvfs-p): New defuns. (tramp--test-special-characters): Fix docstring. Add gvfs and ftp tests. (tramp--test-utf8): Fix docstring.
2015-07-21 14:59:18 +02:00
(setq dir (directory-file-name (expand-file-name dir)))
(with-parsed-tramp-file-name dir nil
(when (and (null parents) (file-exists-p dir))
(tramp-error v 'file-already-exists "Directory already exists %s" dir))
Extend tramp-cache.el interface * lisp/net/tramp.el (tramp-handle-add-name-to-file) (tramp-handle-dired-uncache): * lisp/net/tramp-adb.el (tramp-adb-handle-make-directory) (tramp-adb-handle-delete-directory, tramp-adb-handle-delete-file) (tramp-adb-handle-write-region, tramp-adb-handle-set-file-modes) (tramp-adb-handle-set-file-times, tramp-adb-handle-copy-file) (tramp-adb-handle-rename-file, tramp-adb-handle-process-file) (tramp-adb-handle-start-file-process, tramp-adb-get-device) (tramp-adb-maybe-open-connection): * lisp/net/tramp-cache.el (tramp-flush-file-properties) (tramp-flush-directory-properties, tramp-flush-file-function): * lisp/net/tramp-cmds.el (tramp-cleanup-connection): * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file) (tramp-gvfs-handle-delete-directory, tramp-gvfs-handle-delete-file) (tramp-gvfs-handle-file-system-info, tramp-gvfs-handle-make-directory) (tramp-gvfs-handle-write-region, tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-send-command): * lisp/net/tramp-sh.el (tramp-sh-handle-make-symbolic-link) (tramp-sh-handle-set-file-modes, tramp-sh-handle-set-file-times) (tramp-sh-handle-set-file-selinux-context, tramp-sh-handle-set-file-acl) (tramp-sh-handle-add-name-to-file, tramp-sh-handle-copy-directory) (tramp-do-copy-or-rename-file, tramp-do-copy-or-rename-file-out-of-band) (tramp-sh-handle-make-directory, tramp-sh-handle-delete-directory) (tramp-sh-handle-delete-file, tramp-sh-handle-dired-compress-file) (tramp-process-sentinel, tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-sh-handle-write-region): * lisp/net/tramp-smb.el (tramp-smb-handle-add-name-to-file) (tramp-smb-handle-copy-directory, tramp-smb-handle-copy-file) (tramp-smb-handle-delete-directory, tramp-smb-handle-delete-file) (tramp-smb-handle-file-acl, tramp-smb-handle-make-directory-internal) (tramp-smb-handle-make-symbolic-link, tramp-smb-handle-process-file) (tramp-smb-handle-rename-file, tramp-smb-handle-set-file-acl) (tramp-smb-handle-set-file-modes, tramp-smb-handle-start-file-process) (tramp-smb-handle-write-region, tramp-smb-maybe-open-connection): Use them. * lisp/net/tramp-cache.el (tramp-flush-file-properties) (tramp-flush-directory-properties, tramp-flush-connection-properties): Rename from `tramp-flush-file-property',`tramp-flush-directory-property' and `tramp-flush-connection-property', respectively. (tramp-flush-file-property, tramp-flush-connection-property): New defuns.
2017-12-12 15:46:17 +01:00
(tramp-flush-directory-properties v localname)
Sync with Tramp repository * doc/misc/tramp.texi (Configuration): Note, that Tramp must be required prior changing its configuration. (Connection caching, Predefined connection information) (Remote shell setup): Fix typos. (Predefined connection information): Describe, how to overwrite parameters of `tramp-methods'. (Remote programs, Remote processes, Traces and Profiles): Simplify example. (Remote programs): Remove superfluous comment. * doc/misc/trampver.texi: Update release number. * lisp/net/tramp-cache.el (tramp-connection-properties): Adapt docstring. * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file): New defun. (tramp-gvfs-handle-copy-file, tramp-gvfs-handle-rename-file): Use it. (tramp-gvfs-handle-make-directory): Reimplement PARENTS handling, "gvfs-mkdir -p ..." does not work robust. (tramp-gvfs-maybe-open-connection): Adapt `tramp-get-method-parameter' call. * lisp/net/tramp-sh.el (tramp-methods): Add `tramp-remote-shell-login' parameter where it fits. (tramp-get-remote-path): Use it. (tramp-make-copy-program-file-name): Fix quoting for "psftp" method. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/tramp.el (tramp-methods): Adapt docstring. (tramp-get-method-parameter): Replace argument METHOD by VEC. Check also for hits in `tramp-connection-properties'. Adapt docstring. (tramp-get-remote-tmpdir): Cache only the local name of tmpdir. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/trampver.el Update release number. * test/automated/tramp-tests.el (tramp--instrument-test-case): Add "^make-symbolic-link not supported$" to `debug-ignored-errors'. (tramp-test13-make-directory, tramp--test-adb-p) (tramp--test-smb-or-windows-nt-p): Simplify. (tramp--test-ftp-p, tramp--test-gvfs-p): New defuns. (tramp--test-special-characters): Fix docstring. Add gvfs and ftp tests. (tramp--test-utf8): Fix docstring.
2015-07-21 14:59:18 +02:00
(save-match-data
(let ((ldir (file-name-directory dir)))
;; Make missing directory parts. "gvfs-mkdir -p ..." does not
;; work robust.
(when (and parents (not (file-directory-p ldir)))
(make-directory ldir parents))
;; Just do it.
(unless (or (tramp-gvfs-send-command
v "gvfs-mkdir" (tramp-gvfs-url-file-name dir))
(and parents (file-directory-p dir)))
(tramp-error v 'file-error "Couldn't make directory %s" dir))))))
2009-06-22 21:04:49 +00:00
(defun tramp-gvfs-handle-rename-file
(filename newname &optional ok-if-already-exists)
"Like `rename-file' for Tramp files."
Sync with Tramp repository * doc/misc/tramp.texi (Configuration): Note, that Tramp must be required prior changing its configuration. (Connection caching, Predefined connection information) (Remote shell setup): Fix typos. (Predefined connection information): Describe, how to overwrite parameters of `tramp-methods'. (Remote programs, Remote processes, Traces and Profiles): Simplify example. (Remote programs): Remove superfluous comment. * doc/misc/trampver.texi: Update release number. * lisp/net/tramp-cache.el (tramp-connection-properties): Adapt docstring. * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file): New defun. (tramp-gvfs-handle-copy-file, tramp-gvfs-handle-rename-file): Use it. (tramp-gvfs-handle-make-directory): Reimplement PARENTS handling, "gvfs-mkdir -p ..." does not work robust. (tramp-gvfs-maybe-open-connection): Adapt `tramp-get-method-parameter' call. * lisp/net/tramp-sh.el (tramp-methods): Add `tramp-remote-shell-login' parameter where it fits. (tramp-get-remote-path): Use it. (tramp-make-copy-program-file-name): Fix quoting for "psftp" method. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/tramp.el (tramp-methods): Adapt docstring. (tramp-get-method-parameter): Replace argument METHOD by VEC. Check also for hits in `tramp-connection-properties'. Adapt docstring. (tramp-get-remote-tmpdir): Cache only the local name of tmpdir. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/trampver.el Update release number. * test/automated/tramp-tests.el (tramp--instrument-test-case): Add "^make-symbolic-link not supported$" to `debug-ignored-errors'. (tramp-test13-make-directory, tramp--test-adb-p) (tramp--test-smb-or-windows-nt-p): Simplify. (tramp--test-ftp-p, tramp--test-gvfs-p): New defuns. (tramp--test-special-characters): Fix docstring. Add gvfs and ftp tests. (tramp--test-utf8): Fix docstring.
2015-07-21 14:59:18 +02:00
;; Check if both files are local -- invoke normal rename-file.
;; Otherwise, use Tramp from local system.
(setq filename (expand-file-name filename)
newname (expand-file-name newname))
Sync with Tramp repository * doc/misc/tramp.texi (Configuration): Note, that Tramp must be required prior changing its configuration. (Connection caching, Predefined connection information) (Remote shell setup): Fix typos. (Predefined connection information): Describe, how to overwrite parameters of `tramp-methods'. (Remote programs, Remote processes, Traces and Profiles): Simplify example. (Remote programs): Remove superfluous comment. * doc/misc/trampver.texi: Update release number. * lisp/net/tramp-cache.el (tramp-connection-properties): Adapt docstring. * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file): New defun. (tramp-gvfs-handle-copy-file, tramp-gvfs-handle-rename-file): Use it. (tramp-gvfs-handle-make-directory): Reimplement PARENTS handling, "gvfs-mkdir -p ..." does not work robust. (tramp-gvfs-maybe-open-connection): Adapt `tramp-get-method-parameter' call. * lisp/net/tramp-sh.el (tramp-methods): Add `tramp-remote-shell-login' parameter where it fits. (tramp-get-remote-path): Use it. (tramp-make-copy-program-file-name): Fix quoting for "psftp" method. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/tramp.el (tramp-methods): Adapt docstring. (tramp-get-method-parameter): Replace argument METHOD by VEC. Check also for hits in `tramp-connection-properties'. Adapt docstring. (tramp-get-remote-tmpdir): Cache only the local name of tmpdir. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/trampver.el Update release number. * test/automated/tramp-tests.el (tramp--instrument-test-case): Add "^make-symbolic-link not supported$" to `debug-ignored-errors'. (tramp-test13-make-directory, tramp--test-adb-p) (tramp--test-smb-or-windows-nt-p): Simplify. (tramp--test-ftp-p, tramp--test-gvfs-p): New defuns. (tramp--test-special-characters): Fix docstring. Add gvfs and ftp tests. (tramp--test-utf8): Fix docstring.
2015-07-21 14:59:18 +02:00
;; At least one file a Tramp file?
(if (or (tramp-tramp-file-p filename)
(tramp-tramp-file-p newname))
(tramp-gvfs-do-copy-or-rename-file
Remove XEmacs compatibility in Tramp * doc/misc/tramp.texi: Replace flags by their hard coded name. Remove unused flags and the enclosed alternative text for XEmacs. * doc/misc/trampver.texi: Use "Tramp" CamelCase. Rename "emacs" and "xemacs" flags to "unified" and "separate". Remove flags "emacsgw", "emacsname", "emacsdir", "ftppackagename", "emacsothername", "emacsotherdir" and "emacsotherfilename". (trampver): * lisp/net/trampver.el (tramp-version): Set to "2.3.0-pre". * lisp/net/tramp.el (bkup-backup-directory-info) (directory-sep-char, ls-lisp-use-insert-directory-program) (outline-regexp, tramp-backup-directory-alist) (tramp-default-method, tramp-shell-prompt-pattern, tramp-syntax) (tramp-file-name-regexp-unified) (tramp-file-name-regexp-separate) (tramp-completion-file-name-regexp-unified) (tramp-completion-file-name-regexp-separate, tramp-chunksize) (tramp-get-method-parameter, tramp-find-method, tramp-find-user) (tramp-debug-message, tramp-progress-reporter-update) (with-tramp-progress-reporter) (tramp-rfn-eshadow-setup-minibuffer) (rfn-eshadow-setup-minibuffer-hook, tramp-unload-hook) (tramp-rfn-eshadow-update-overlay) (rfn-eshadow-update-overlay-hook, tramp-default-file-modes) (tramp-file-name-for-operation) (tramp-completion-file-name-handler) (tramp-autoload-file-name-handler, tramp-completion-mode-p) (tramp-handle-directory-files) (tramp-handle-directory-files-and-attributes) (tramp-handle-dired-uncache, tramp-handle-find-backup-file-name) (tramp-handle-insert-file-contents, tramp-handle-load) (tramp-handle-shell-command) (tramp-handle-verify-visited-file-modtime) (tramp-handle-file-notify-valid-p, tramp-accept-process-output) (tramp-check-for-regexp, tramp-wait-for-regexp) (tramp-send-string, tramp-mode-string-to-int) (tramp-get-local-gid, tramp-check-cached-permissions) (tramp-get-remote-tmpdir, tramp-make-tramp-temp-file) (auto-save-file-name-transforms) (tramp-handle-make-auto-save-file-name, tramp-read-passwd) (tramp-clear-passwd, tramp-time-diff): * lisp/net/tramp-adb.el (directory-listing-before-filename-regexp) (directory-sep-char, tramp-adb-file-name-handler-alist) (tramp-adb-parse-device-names) (tramp-adb-handle-expand-file-name) (tramp-adb-handle-file-truename, tramp-adb--gnu-switches-to-ash) (tramp-adb-handle-file-local-copy) (tramp-adb-handle-write-region, tramp-adb-handle-set-file-modes) (tramp-adb-handle-rename-file, tramp-adb-handle-process-file) (tramp-adb-handle-shell-command) (tramp-adb-handle-start-file-process, tramp-adb-get-device) (tramp-adb-maybe-open-connection): * lisp/net/tramp-cache.el (tramp-persistency-file-name) (tramp-cache-print): * lisp/net/tramp-cmds.el (tramp-cleanup-all-connections) (tramp-bug, tramp-reporter-dump-variable) (tramp-load-report-modules, tramp-append-tramp-buffers): * lisp/net/tramp-compat.el (tramp-compat-funcall) (tramp-advice-file-expand-wildcards) (tramp-compat-temporary-file-directory) (tramp-compat-make-temp-file, tramp-compat-copy-file) (tramp-compat-delete-directory, ) (tramp-compat-process-running-p): * lisp/net/tramp-ftp.el (tramp-methods) <ftp>: (tramp-default-method-alist, tramp-foreign-file-name-handler-alist): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) (tramp-gvfs-do-copy-or-rename-file, tramp-gvfs-handle-copy-file) (tramp-gvfs-handle-file-local-copy) (tramp-gvfs-handle-file-name-all-completions) (tramp-gvfs-handle-file-notify-add-watch) (tramp-gvfs-monitor-file-process-filter) (tramp-gvfs-handle-file-readable-p) (tramp-gvfs-handle-rename-file, tramp-gvfs-handle-write-region) (tramp-gvfs-file-name, tramp-gvfs-handler-askquestion) (tramp-gvfs-maybe-open-connection) (tramp-gvfs-parse-device-names): * lisp/net/tramp-gw.el (tramp-gw-aux-proc-sentinel) (tramp-gw-open-connection, tramp-gw-open-network-stream): * lisp/net/tramp-sh.el (directory-sep-char) (tramp-sh-file-name-handler-alist) (tramp-sh-handle-file-truename) (tramp-sh-handle-set-visited-file-modtime) (tramp-sh-handle-verify-visited-file-modtime) (tramp-sh-handle-set-file-modes, tramp-sh-handle-set-file-times) (tramp-sh-handle-file-acl) (tramp-sh-handle-file-name-all-completions) (tramp-sh-handle-copy-file, tramp-sh-handle-rename-file) (tramp-do-copy-or-rename-file-directly) (tramp-do-copy-or-rename-file-out-of-band) (dired-compress-file-suffixes, dired-remove-file) (tramp-sh-handle-dired-compress-file) (tramp-sh-handle-insert-directory) (tramp-sh-handle-expand-file-name) (tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-sh-handle-file-local-copy) (tramp-sh-handle-write-region, tramp-sh-handle-vc-registered) (tramp-sh-handle-file-notify-add-watch) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter, tramp-maybe-send-script) (tramp-find-executable) (tramp-open-connection-setup-interactive-shell) (tramp-find-inline-encoding, tramp-compute-multi-hops) (tramp-maybe-open-connection, tramp-convert-file-attributes) (tramp-get-remote-path, tramp-get-remote-touch): * lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist) (tramp-smb-handle-copy-directory, tramp-smb-handle-copy-file) (tramp-smb-handle-delete-directory) (tramp-smb-handle-directory-files, tramp-smb-handle-file-acl) (tramp-smb-handle-make-directory-internal) (tramp-smb-handle-process-file, tramp-smb-handle-rename-file) (tramp-smb-handle-set-file-acl, tramp-smb-handle-set-file-modes) (tramp-smb-handle-write-region, tramp-smb-get-file-entries) (tramp-smb-get-cifs-capabilities) (tramp-smb-maybe-open-connection): * lisp/net/trampver.el (tramp-repository-get-version): Remove XEmacs compat code. * lisp/net/tramp-cmds.el (mml-mode, mml-insert-empty-tag) (reporter-dump-variable): Declare functions. * lisp/net/tramp.el (tramp-bkup-backup-directory-info) (tramp-advice-minibuffer-electric-separator) (tramp-advice-minibuffer-electric-tilde) (tramp-handle-unhandled-file-name-directory): * lisp/net/tramp-compat.el (tramp-compat-with-temp-message) (tramp-compat-font-lock-add-keywords) (tramp-compat-load, tramp-compat-number-sequence) (tramp-compat-split-string, tramp-compat-delete-dups): * lisp/net/tramp-sh.el (tramp-sh-handle-insert-file-contents-literally): Remove. * lisp/net/tramp-sh.el (tramp-methods) <psftp>: This does not work recursively.
2016-01-14 14:12:17 +01:00
'rename filename newname ok-if-already-exists
'keep-date 'preserve-uid-gid)
Sync with Tramp repository * doc/misc/tramp.texi (Configuration): Note, that Tramp must be required prior changing its configuration. (Connection caching, Predefined connection information) (Remote shell setup): Fix typos. (Predefined connection information): Describe, how to overwrite parameters of `tramp-methods'. (Remote programs, Remote processes, Traces and Profiles): Simplify example. (Remote programs): Remove superfluous comment. * doc/misc/trampver.texi: Update release number. * lisp/net/tramp-cache.el (tramp-connection-properties): Adapt docstring. * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file): New defun. (tramp-gvfs-handle-copy-file, tramp-gvfs-handle-rename-file): Use it. (tramp-gvfs-handle-make-directory): Reimplement PARENTS handling, "gvfs-mkdir -p ..." does not work robust. (tramp-gvfs-maybe-open-connection): Adapt `tramp-get-method-parameter' call. * lisp/net/tramp-sh.el (tramp-methods): Add `tramp-remote-shell-login' parameter where it fits. (tramp-get-remote-path): Use it. (tramp-make-copy-program-file-name): Fix quoting for "psftp" method. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/tramp.el (tramp-methods): Adapt docstring. (tramp-get-method-parameter): Replace argument METHOD by VEC. Check also for hits in `tramp-connection-properties'. Adapt docstring. (tramp-get-remote-tmpdir): Cache only the local name of tmpdir. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/trampver.el Update release number. * test/automated/tramp-tests.el (tramp--instrument-test-case): Add "^make-symbolic-link not supported$" to `debug-ignored-errors'. (tramp-test13-make-directory, tramp--test-adb-p) (tramp--test-smb-or-windows-nt-p): Simplify. (tramp--test-ftp-p, tramp--test-gvfs-p): New defuns. (tramp--test-special-characters): Fix docstring. Add gvfs and ftp tests. (tramp--test-utf8): Fix docstring.
2015-07-21 14:59:18 +02:00
(tramp-run-real-handler
#'rename-file (list filename newname ok-if-already-exists))))
Add 'nofollow' flag to set-file-modes etc. This avoids some race conditions (Bug#39683). E.g., if some other program changes a file to a symlink between the time Emacs creates the file and the time it changes the file’s permissions, using the new flag prevents Emacs from inadvertently changing the permissions of a victim in some completely unrelated directory. * admin/merge-gnulib (GNULIB_MODULES): Add fchmodat. * doc/lispref/files.texi (Testing Accessibility, Changing Files): * doc/lispref/os.texi (File Notifications): * etc/NEWS: Adjust documentation accordingly. * lib/chmodat.c, lib/fchmodat.c, lib/lchmod.c, m4/fchmodat.m4: * m4/lchmod.m4: New files, copied from Gnulib. * lib/gnulib.mk.in: Regenerate. * lisp/dired-aux.el (dired-do-chmod): * lisp/doc-view.el (doc-view-make-safe-dir): * lisp/emacs-lisp/autoload.el (autoload--save-buffer): * lisp/emacs-lisp/bytecomp.el (byte-compile-file): * lisp/eshell/em-pred.el (eshell-pred-file-mode): * lisp/files.el (backup-buffer-copy, copy-directory): * lisp/gnus/mail-source.el (mail-source-movemail): * lisp/gnus/mm-decode.el (mm-display-external): * lisp/gnus/nnmail.el (nnmail-write-region): * lisp/net/tramp-adb.el (tramp-adb-handle-file-local-copy) (tramp-adb-handle-write-region): * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-directly): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-write-region): * lisp/net/tramp.el (tramp-handle-write-region) (tramp-make-tramp-temp-file): * lisp/server.el (server-ensure-safe-dir): * lisp/url/url-util.el (url-make-private-file): When getting or setting file modes, avoid following symbolic links when the file is not supposed to be a symbolic link. * lisp/doc-view.el (doc-view-make-safe-dir): Omit no-longer-needed separate symlink test. * lisp/gnus/gnus-util.el (gnus-set-file-modes): * lisp/net/tramp.el (tramp-handle-file-modes): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-set-file-modes): * src/fileio.c (symlink_nofollow_flag): New function. (Ffile_modes, Fset_file_modes): Support an optional FLAG arg. All C callers changed. * lisp/net/ange-ftp.el (ange-ftp-set-file-modes): * lisp/net/tramp-adb.el (tramp-adb-handle-set-file-modes): * lisp/net/tramp-sh.el (tramp-sh-handle-set-file-modes): * lisp/net/tramp-smb.el (tramp-smb-handle-set-file-modes): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-set-file-modes): Accept an optional FLAG arg that is currently ignored, and add a FIXME comment for it. * m4/gnulib-comp.m4: Regenerate.
2020-02-23 16:19:42 -08:00
(defun tramp-gvfs-handle-set-file-modes (filename mode &optional flag)
"Like `set-file-modes' for Tramp files."
(with-parsed-tramp-file-name filename nil
(tramp-flush-file-properties v localname)
(tramp-gvfs-send-command
Finish implementation of {set-}file-modes FLAG arg in Tramp * lisp/net/tramp-adb.el (tramp-adb-handle-file-local-copy): Do not use 'nofollow for temporary files. Use `tramp-compat-set-file-modes'. (tramp-adb-handle-write-region): Do not use 'nofollow for temporary files. (tramp-adb-handle-set-file-modes): Implement FLAG. * lisp/net/tramp-compat.el (tramp-compat-file-modes) (tramp-compat-set-file-modes): New defaliases. * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-set-file-modes): Make explicit check (eq flag 'nofollow). * lisp/net/tramp-sh.el (tramp-sh-handle-set-file-modes): Implement FLAG. (tramp-do-copy-or-rename-file-directly) (tramp-sh-handle-file-local-copy, tramp-sh-handle-write-region): Do not use 'nofollow for temporary files. (tramp-get-remote-chmod-h): New defun. * lisp/net/tramp-smb.el (tramp-smb-handle-set-file-modes): Implement FLAG. * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-set-file-modes): Implement FLAG. (tramp-sudoedit-handle-write-region): Use `tramp-compat-set-file-modes'. * lisp/net/tramp.el (tramp-default-file-modes): Optional argument FLAG. (tramp-handle-file-modes): Use `file-truename' instead of `file-chase-links'. The latter function does not work for remote file names. (tramp-handle-write-region): Call `tramp-default-file-modes' with 'nofollow if needed. Do not use 'nofollow for temporary files. * test/lisp/net/tramp-tests.el (tramp--test-ignore-make-symbolic-link-error): Check also for "Cannot chmod .* with nofollow flag" error. (tramp-test20-file-modes): Extend test. (tramp--test-emacs28-p): New defun.
2020-02-25 13:25:57 +01:00
v "gvfs-set-attribute" (if (eq flag 'nofollow) "-nt" "-t") "uint32"
(tramp-gvfs-url-file-name filename) "unix::mode" (number-to-string mode))))
Add ‘nofollow’ flag to set-file-times This is a companion to the recent set-file-modes patch. It adds support for a ‘nofollow’ flag to set-file-times (Bug#39773). Like the set-file-modes patch, it needs work in the w32 port. * admin/merge-gnulib (GNULIB_MODULES): Add futimens, utimensat. Remove utimens. * doc/lispref/files.texi (Changing Files): * etc/NEWS: Mention the change. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate. * lisp/files.el (copy-directory): * lisp/gnus/gnus-cloud.el (gnus-cloud-replace-file): * lisp/net/tramp-adb.el (tramp-adb-handle-copy-file): * lisp/net/tramp-smb.el (tramp-smb-handle-copy-file): * lisp/tar-mode.el (tar-copy): * test/lisp/filenotify-tests.el (file-notify-test03-events): * test/lisp/files-tests.el: (files-tests-file-name-non-special-set-file-times): * test/lisp/net/tramp-tests.el (tramp-test22-file-times): When setting file times, avoid following symbolic links when the file is not supposed to be a symbolic link. * lib/futimens.c, lib/utimensat.c, m4/futimens.m4, m4/utimensat.m4: New files, copied from Gnulib. * lisp/gnus/gnus-cloud.el (gnus-cloud-replace-file): When creating a file that is not supposed to exist already, use the excl flag to check this. * lisp/net/tramp-adb.el (tramp-adb-handle-set-file-times): * lisp/net/tramp-sh.el (tramp-sh-handle-set-file-times): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-set-file-times): Accept an optional FLAG arg that is currently ignored, and add a FIXME comment for it. * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-set-file-times): * src/fileio.c (Fset_file_times): Support an optional FLAG arg. * src/fileio.c (Fcopy_file): Use futimens instead of set_file_times, as it’s simpler and is a POSIX API. * src/sysdep.c (set_file_times): Move from here ... * src/w32.c (set_file_times): ... to here, and make it static, since it is now used only in w32.c. Presumably w32.c should also add support for futimens and utimensat (the POSIX APIs, which Emacs now uses) and it can remove fdutimens (the Gnulib API, which Emacs no longer uses).
2020-03-07 12:04:05 -08:00
(defun tramp-gvfs-handle-set-file-times (filename &optional time flag)
"Like `set-file-times' for Tramp files."
(with-parsed-tramp-file-name filename nil
(tramp-flush-file-properties v localname)
(tramp-gvfs-send-command
v "gvfs-set-attribute" (if (eq flag 'nofollow) "-nt" "-t") "uint64"
(tramp-gvfs-url-file-name filename) "time::modified"
(format-time-string
"%s" (if (or (null time)
(tramp-compat-time-equal-p time tramp-time-doesnt-exist)
(tramp-compat-time-equal-p time tramp-time-dont-know))
(current-time)
time)))))
Rearrange detecting remote uid and gid in Tramp * 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-rclone.el (tramp-rclone-file-name-handler-alist): * lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist): Add `tramp-get-remote-gid' and 'tramp-get-remote-uid'. * lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler-alist): Add `file-ownership-preserved-p'. (tramp-crypt-add-directory): Check, that NAME is not quoted. (tramp-crypt-handle-file-ownership-preserved-p): New defun. (tramp-crypt-handle-insert-directory): Fix docstring. * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add `tramp-get-remote-gid' and 'tramp-get-remote-uid'. (tramp-gvfs-handle-file-readable-p): Call `tramp-get-remote-uid'. (tramp-gvfs-handle-get-remote-uid) (tramp-gvfs-handle-get-remote-gid): Rename from `tramp-gvfs-get-remote-{uid,gid}'. Do not cache result. (tramp-gvfs-maybe-open-connection): No special handling for remote uid and gid. * lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist): Add `tramp-get-remote-gid' and 'tramp-get-remote-uid'. (tramp-sh-handle-get-remote-uid, tramp-sh-handle-get-remote-gid): Rename from `tramp-get-remote-{uid,gid}'. Do not cache result. (tramp-sh-handle-file-ownership-preserved-p): Distinguish by GROUP when caching. * lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler-alist): Add `tramp-get-remote-gid' and 'tramp-get-remote-uid'. (tramp-sudoedit-handle-get-remote-uid) (tramp-sudoedit-handle-get-remote-gid): Rename from `tramp-sudoedit-get-remote-{uid,gid}'. Do not cache result. (tramp-sudoedit-handle-set-file-uid-gid) (tramp-sudoedit-handle-write-region): Call `tramp-get-remote-uid' and `tramp-get-remote-gid'. (tramp-sudoedit-maybe-open-connection): No special handling for remote uid and gid. * lisp/net/tramp.el (tramp-file-name-for-operation): Add `tramp-get-remote-gid' and 'tramp-get-remote-uid'. (tramp-handle-write-region, tramp-check-cached-permissions): Call `tramp-get-remote-uid' and `tramp-get-remote-gid'. (tramp-get-remote-uid, tramp-get-remote-gid): New defuns. (tramp-local-host-p): Simplify `tramp-get-remote-uid' call. * test/lisp/net/tramp-tests.el (tramp-test17-dired-with-wildcards) Skip if needed.
2020-06-14 15:31:17 +02:00
(defun tramp-gvfs-handle-get-remote-uid (vec id-format)
"The uid of the remote connection VEC, in ID-FORMAT.
ID-FORMAT valid values are `string' and `integer'."
(if (equal id-format 'string)
(tramp-file-name-user vec)
(when-let
((localname (tramp-get-connection-property vec "default-location" nil)))
(tramp-compat-file-attribute-user-id
(file-attributes
(tramp-make-tramp-file-name vec localname) id-format)))))
(defun tramp-gvfs-handle-get-remote-gid (vec id-format)
"The gid of the remote connection VEC, in ID-FORMAT.
ID-FORMAT valid values are `string' and `integer'."
(when-let
((localname (tramp-get-connection-property vec "default-location" nil)))
(tramp-compat-file-attribute-group-id
(file-attributes
(tramp-make-tramp-file-name vec localname) id-format))))
(defun tramp-gvfs-handle-set-file-uid-gid (filename &optional uid gid)
"Like `tramp-set-file-uid-gid' for Tramp files."
(with-parsed-tramp-file-name filename nil
(tramp-flush-file-properties v localname)
(when (natnump uid)
(tramp-gvfs-send-command
v "gvfs-set-attribute" "-t" "uint32"
(tramp-gvfs-url-file-name filename) "unix::uid" (number-to-string uid)))
(when (natnump gid)
(tramp-gvfs-send-command
v "gvfs-set-attribute" "-t" "uint32"
(tramp-gvfs-url-file-name filename)
"unix::gid" (number-to-string gid)))))
2009-06-22 21:04:49 +00:00
;; File name conversions.
(defun tramp-gvfs-activation-uri (filename)
"Return activation URI to be used in gio commands."
(if (tramp-tramp-file-p filename)
(with-parsed-tramp-file-name filename nil
;; Ensure that media devices are cached.
(when (string-equal method "mtp")
(tramp-get-media-device v))
(with-tramp-connection-property v "activation-uri"
(setq localname "/")
(when (string-equal "gdrive" method)
(setq method "google-drive"))
(when (string-equal "nextcloud" method)
(setq method "davs"
localname
(concat (tramp-gvfs-get-remote-prefix v) localname)))
(when (string-equal "mtp" method)
(when-let
((media (tramp-get-connection-property v "media-device" nil)))
(setq method (tramp-media-device-method media)
host (tramp-media-device-host media)
port (tramp-media-device-port media))))
(when (and user domain)
(setq user (concat domain ";" user)))
(url-recreate-url
(url-parse-make-urlobj
method (and user (url-hexify-string user))
nil (and host (url-hexify-string host))
(if (stringp port) (string-to-number port) port)
localname nil nil t))))
;; Local URI.
(url-recreate-url
(url-parse-make-urlobj "file" nil nil nil nil nil nil nil t))))
2009-06-22 21:04:49 +00:00
(defun tramp-gvfs-url-file-name (filename)
"Return FILENAME in URL syntax."
(setq filename (tramp-compat-file-name-unquote filename))
(let* (;; "/" must NOT be hexified.
(url-unreserved-chars (cons ?/ url-unreserved-chars))
(result
(concat (substring (tramp-gvfs-activation-uri filename) 0 -1)
(url-hexify-string (tramp-file-local-name filename)))))
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(when (tramp-tramp-file-p filename)
(tramp-message
(tramp-dissect-file-name filename) 10
"remote file `%s' is URL `%s'" filename result))
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
result))
2009-06-22 21:04:49 +00:00
(defun tramp-gvfs-object-path (filename)
"Create a D-Bus object path from FILENAME."
(expand-file-name (dbus-escape-as-identifier filename) tramp-gvfs-path-tramp))
(defun tramp-gvfs-file-name (object-path)
"Retrieve file name from D-Bus OBJECT-PATH."
(dbus-unescape-from-identifier
Remove XEmacs compatibility in Tramp * doc/misc/tramp.texi: Replace flags by their hard coded name. Remove unused flags and the enclosed alternative text for XEmacs. * doc/misc/trampver.texi: Use "Tramp" CamelCase. Rename "emacs" and "xemacs" flags to "unified" and "separate". Remove flags "emacsgw", "emacsname", "emacsdir", "ftppackagename", "emacsothername", "emacsotherdir" and "emacsotherfilename". (trampver): * lisp/net/trampver.el (tramp-version): Set to "2.3.0-pre". * lisp/net/tramp.el (bkup-backup-directory-info) (directory-sep-char, ls-lisp-use-insert-directory-program) (outline-regexp, tramp-backup-directory-alist) (tramp-default-method, tramp-shell-prompt-pattern, tramp-syntax) (tramp-file-name-regexp-unified) (tramp-file-name-regexp-separate) (tramp-completion-file-name-regexp-unified) (tramp-completion-file-name-regexp-separate, tramp-chunksize) (tramp-get-method-parameter, tramp-find-method, tramp-find-user) (tramp-debug-message, tramp-progress-reporter-update) (with-tramp-progress-reporter) (tramp-rfn-eshadow-setup-minibuffer) (rfn-eshadow-setup-minibuffer-hook, tramp-unload-hook) (tramp-rfn-eshadow-update-overlay) (rfn-eshadow-update-overlay-hook, tramp-default-file-modes) (tramp-file-name-for-operation) (tramp-completion-file-name-handler) (tramp-autoload-file-name-handler, tramp-completion-mode-p) (tramp-handle-directory-files) (tramp-handle-directory-files-and-attributes) (tramp-handle-dired-uncache, tramp-handle-find-backup-file-name) (tramp-handle-insert-file-contents, tramp-handle-load) (tramp-handle-shell-command) (tramp-handle-verify-visited-file-modtime) (tramp-handle-file-notify-valid-p, tramp-accept-process-output) (tramp-check-for-regexp, tramp-wait-for-regexp) (tramp-send-string, tramp-mode-string-to-int) (tramp-get-local-gid, tramp-check-cached-permissions) (tramp-get-remote-tmpdir, tramp-make-tramp-temp-file) (auto-save-file-name-transforms) (tramp-handle-make-auto-save-file-name, tramp-read-passwd) (tramp-clear-passwd, tramp-time-diff): * lisp/net/tramp-adb.el (directory-listing-before-filename-regexp) (directory-sep-char, tramp-adb-file-name-handler-alist) (tramp-adb-parse-device-names) (tramp-adb-handle-expand-file-name) (tramp-adb-handle-file-truename, tramp-adb--gnu-switches-to-ash) (tramp-adb-handle-file-local-copy) (tramp-adb-handle-write-region, tramp-adb-handle-set-file-modes) (tramp-adb-handle-rename-file, tramp-adb-handle-process-file) (tramp-adb-handle-shell-command) (tramp-adb-handle-start-file-process, tramp-adb-get-device) (tramp-adb-maybe-open-connection): * lisp/net/tramp-cache.el (tramp-persistency-file-name) (tramp-cache-print): * lisp/net/tramp-cmds.el (tramp-cleanup-all-connections) (tramp-bug, tramp-reporter-dump-variable) (tramp-load-report-modules, tramp-append-tramp-buffers): * lisp/net/tramp-compat.el (tramp-compat-funcall) (tramp-advice-file-expand-wildcards) (tramp-compat-temporary-file-directory) (tramp-compat-make-temp-file, tramp-compat-copy-file) (tramp-compat-delete-directory, ) (tramp-compat-process-running-p): * lisp/net/tramp-ftp.el (tramp-methods) <ftp>: (tramp-default-method-alist, tramp-foreign-file-name-handler-alist): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) (tramp-gvfs-do-copy-or-rename-file, tramp-gvfs-handle-copy-file) (tramp-gvfs-handle-file-local-copy) (tramp-gvfs-handle-file-name-all-completions) (tramp-gvfs-handle-file-notify-add-watch) (tramp-gvfs-monitor-file-process-filter) (tramp-gvfs-handle-file-readable-p) (tramp-gvfs-handle-rename-file, tramp-gvfs-handle-write-region) (tramp-gvfs-file-name, tramp-gvfs-handler-askquestion) (tramp-gvfs-maybe-open-connection) (tramp-gvfs-parse-device-names): * lisp/net/tramp-gw.el (tramp-gw-aux-proc-sentinel) (tramp-gw-open-connection, tramp-gw-open-network-stream): * lisp/net/tramp-sh.el (directory-sep-char) (tramp-sh-file-name-handler-alist) (tramp-sh-handle-file-truename) (tramp-sh-handle-set-visited-file-modtime) (tramp-sh-handle-verify-visited-file-modtime) (tramp-sh-handle-set-file-modes, tramp-sh-handle-set-file-times) (tramp-sh-handle-file-acl) (tramp-sh-handle-file-name-all-completions) (tramp-sh-handle-copy-file, tramp-sh-handle-rename-file) (tramp-do-copy-or-rename-file-directly) (tramp-do-copy-or-rename-file-out-of-band) (dired-compress-file-suffixes, dired-remove-file) (tramp-sh-handle-dired-compress-file) (tramp-sh-handle-insert-directory) (tramp-sh-handle-expand-file-name) (tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-sh-handle-file-local-copy) (tramp-sh-handle-write-region, tramp-sh-handle-vc-registered) (tramp-sh-handle-file-notify-add-watch) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter, tramp-maybe-send-script) (tramp-find-executable) (tramp-open-connection-setup-interactive-shell) (tramp-find-inline-encoding, tramp-compute-multi-hops) (tramp-maybe-open-connection, tramp-convert-file-attributes) (tramp-get-remote-path, tramp-get-remote-touch): * lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist) (tramp-smb-handle-copy-directory, tramp-smb-handle-copy-file) (tramp-smb-handle-delete-directory) (tramp-smb-handle-directory-files, tramp-smb-handle-file-acl) (tramp-smb-handle-make-directory-internal) (tramp-smb-handle-process-file, tramp-smb-handle-rename-file) (tramp-smb-handle-set-file-acl, tramp-smb-handle-set-file-modes) (tramp-smb-handle-write-region, tramp-smb-get-file-entries) (tramp-smb-get-cifs-capabilities) (tramp-smb-maybe-open-connection): * lisp/net/trampver.el (tramp-repository-get-version): Remove XEmacs compat code. * lisp/net/tramp-cmds.el (mml-mode, mml-insert-empty-tag) (reporter-dump-variable): Declare functions. * lisp/net/tramp.el (tramp-bkup-backup-directory-info) (tramp-advice-minibuffer-electric-separator) (tramp-advice-minibuffer-electric-tilde) (tramp-handle-unhandled-file-name-directory): * lisp/net/tramp-compat.el (tramp-compat-with-temp-message) (tramp-compat-font-lock-add-keywords) (tramp-compat-load, tramp-compat-number-sequence) (tramp-compat-split-string, tramp-compat-delete-dups): * lisp/net/tramp-sh.el (tramp-sh-handle-insert-file-contents-literally): Remove. * lisp/net/tramp-sh.el (tramp-methods) <psftp>: This does not work recursively.
2016-01-14 14:12:17 +01:00
(replace-regexp-in-string "^.*/\\([^/]+\\)$" "\\1" object-path)))
2009-06-22 21:04:49 +00:00
(defun tramp-gvfs-url-host (url)
"Return the host name part of URL, a string.
We cannot use `url-host', because `url-generic-parse-url' returns
a downcased host name only."
(and (stringp url)
(string-match "^[[:alnum:]]+://\\([^/:]+\\)" url)
(match-string 1 url)))
2009-06-22 21:04:49 +00:00
;; D-Bus GVFS functions.
(defun tramp-gvfs-handler-askpassword (message user domain flags)
"Implementation for the \"org.gtk.vfs.MountOperation.askPassword\" method."
(let* ((filename
(tramp-gvfs-file-name (dbus-event-path-name last-input-event)))
(pw-prompt
(format
"%s for %s "
(if (string-match "\\([pP]assword\\|[pP]assphrase\\)" message)
(capitalize (match-string 1 message))
"Password")
filename))
password)
(condition-case nil
(with-parsed-tramp-file-name filename l
(when (and (zerop (length user))
(not
(zerop (logand flags tramp-gvfs-password-need-username))))
(setq user (read-string "User name: ")))
(when (and (zerop (length domain))
(not
(zerop (logand flags tramp-gvfs-password-need-domain))))
2009-06-22 21:04:49 +00:00
(setq domain (read-string "Domain name: ")))
(tramp-message l 6 "%S %S %S %d" message user domain flags)
(unless (tramp-get-connection-property l "first-password-request" nil)
(tramp-clear-passwd l))
Sync with Tramp 2.4.0-pre * doc/misc/trampver.texi: * lisp/net/trampver.el: Change version to "2.4.0-pre". * lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist): Use `tramp-handle-file-directory-p'. (tramp-adb-parse-device-names) (tramp-adb-handle-expand-file-name) (tramp-adb-handle-file-truename, tramp-adb-handle-process-file): Adapt `tramp-make-tramp-file-name' call. (tramp-adb-handle-file-directory-p): Remove. (tramp-adb-maybe-open-connection): Do not set tramp-current-*. * lisp/net/tramp-cache.el (tramp-get-hash-table): Adapt `tramp-make-tramp-file-name' call. * lisp/net/tramp-cmds.el (tramp-cleanup-connection): Do not set tramp-current-*. * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Use `tramp-handle-file-directory-p'. (tramp-gvfs-dbus-event-error): Trace with verbosity 6. (tramp-gvfs-do-copy-or-rename-file): Use `file-truename'. (tramp-gvfs-handle-file-directory-p): Remove. (tramp-gvfs-handler-askpassword): Do not set tramp-current-*. * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band) (tramp-sh-handle-start-file-process) (tramp-maybe-open-connection, tramp-get-remote-path): Do not set tramp-current-*. (tramp-maybe-open-connection): Set "password-vector" property. * lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist): Use `tramp-handle-file-accessible-directory-p' and `tramp-handle-file-directory-p'. (tramp-smb-handle-copy-directory, tramp-smb-handle-file-acl) (tramp-smb-handle-set-file-acl) (tramp-smb-maybe-open-connection): Do not set tramp-current-*. (tramp-smb-handle-file-directory-p): Remove. (tramp-smb-handle-make-symbolic-link): Use `tramp-get-connection-buffer' rather than `buffer-name'. * lisp/net/tramp.el (tramp-current-method, tramp-current-user) (tramp-current-domain, tramp-current-host) (tramp-current-port): Remove. (tramp-dissect-file-name): No special handling of localname anymore. (tramp-make-tramp-file-name): Reimplemnt with new signature. (tramp-completion-make-tramp-file-name): Fix docstring. (tramp-get-buffer, tramp-handle-file-name-as-directory) (tramp-handle-file-name-directory) (tramp-check-cached-permissions, tramp-local-host-p) (tramp-get-remote-tmpdir, tramp-clear-passwd): Adapt `tramp-make-tramp-file-name' call. (tramp-completion-handle-file-name-all-completions) (tramp-action-login, tramp-read-passwd): Do not set tramp-current-*. (tramp-handle-file-directory-p): New defun. (tramp-handle-verify-visited-file-modtime): Remove superfluous `with-parsed-tramp-file-name'. (tramp-process-actions, tramp-read-passwd): Use "password-vector" property. (tramp-call-process, tramp-call-process-region): No special setting of vec. (tramp-read-passwd): Handle "login-as" property. * test/lisp/net/tramp-tests.el (tramp-test21-file-links): Special code for "smb".
2017-12-09 13:22:52 +01:00
(setq password (tramp-read-passwd
2009-06-22 21:04:49 +00:00
(tramp-get-connection-process l) pw-prompt))
;; Return result.
(if (stringp password)
(list
t ;; password handled.
nil ;; no abort of D-Bus.
password
Introduce a defstruct `tramp-file-name' as central data structure. 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.
2017-05-24 16:16:53 +02:00
(tramp-file-name-user l)
2009-06-22 21:04:49 +00:00
domain
nil ;; not anonymous.
0) ;; no password save.
;; No password provided.
Introduce a defstruct `tramp-file-name' as central data structure. 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.
2017-05-24 16:16:53 +02:00
(list nil t "" (tramp-file-name-user l) domain nil 0)))
2009-06-22 21:04:49 +00:00
;; When QUIT is raised, we shall return this information to D-Bus.
(quit (list nil t "" "" "" nil 0)))))
(defun tramp-gvfs-handler-askquestion (message choices)
"Implementation for the \"org.gtk.vfs.MountOperation.askQuestion\" method."
(save-window-excursion
(let ((enable-recursive-minibuffers t)
(use-dialog-box (and use-dialog-box (null noninteractive)))
result)
2009-06-22 21:04:49 +00:00
(with-parsed-tramp-file-name
(tramp-gvfs-file-name (dbus-event-path-name last-input-event)) nil
(tramp-message v 6 "%S %S" message choices)
(setq result
(condition-case nil
(list
t ;; handled.
nil ;; no abort of D-Bus.
(with-tramp-connection-property (tramp-get-process v) message
;; In theory, there can be several choices.
;; Until now, there is only the question whether
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
;; to accept an unknown host signature or certificate.
(with-temp-buffer
;; Preserve message for `progress-reporter'.
(with-temp-message ""
(insert message)
(goto-char (point-max))
(if noninteractive
(message "%s" message)
(pop-to-buffer (current-buffer)))
(if (yes-or-no-p
(concat
(buffer-substring
(line-beginning-position) (point))
" "))
0 1)))))
;; When QUIT is raised, we shall return this
;; information to D-Bus.
(quit (list nil t 1))))
(tramp-message v 6 "%s" result)
;; When the choice is "no", we set a dummy fuse-mountpoint in
;; order to leave the timeout.
(unless (zerop (cl-caddr result))
(tramp-set-file-property v "/" "fuse-mountpoint" "/"))
result))))
2009-06-22 21:04:49 +00:00
(defun tramp-gvfs-handler-mounted-unmounted (mount-info)
Adapt Tramp docstrings according to checkdoc * lisp/net/tramp.el (tramp-backup-directory-alist) (tramp-echoed-echo-mark-regexp, tramp-syntax-values) (tramp-lookup-syntax, 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-unknown-id-string) (tramp-unknown-id-integer, tramp-build-file-name-regexp) (tramp-build-completion-file-name-regexp, tramp-chunksize) (tramp-find-method, tramp-find-user, tramp-find-host) (tramp-dissect-file-name, tramp-get-buffer) (tramp-get-connection-buffer, tramp-debug-message, tramp-error) (with-tramp-connection-property, tramp-run-real-handler) (tramp-file-name-for-operation, tramp-file-name-handler) (tramp-completion-file-name-handler) (tramp-completion-handle-file-name-completion) (tramp-completion-dissect-file-name) (tramp-completion-dissect-file-name1) (tramp-handle-file-name-as-directory) (tramp-handle-file-name-directory) (tramp-handle-file-name-nondirectory, tramp-mode-string-to-int) (tramp-file-mode-from-int): * lisp/net/tramp-adb.el (tramp-adb-file-name-p): * lisp/net/tramp-archive.el (tramp-archive-run-real-handler) (tramp-archive-file-name-handler) (tramp-archive-dissect-file-name) (with-parsed-tramp-archive-file-name) (tramp-archive-gvfs-file-name, tramp-archive-handle-access-file): * lisp/net/tramp-cmds.el (tramp-list-remote-buffers): * lisp/net/tramp-compat.el (tramp-unload-file-name-handlers) (tramp-compat-funcall, tramp-compat-tramp-file-name-slots): * lisp/net/tramp-ftp.el (tramp-ftp-file-name-handler) (tramp-ftp-file-name-p): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-p) (tramp-gvfs-file-name-handler) (tramp-gvfs-stringify-dbus-message) (tramp-gvfs-monitor-process-filter) (tramp-gvfs-handler-mounted-unmounted): * lisp/net/tramp-integration.el (tramp-rfn-eshadow-update-overlay-regexp): * lisp/net/tramp-rclone.el (tramp-rclone-file-name-p) (tramp-rclone-file-name-handler, tramp-rclone-send-command): * lisp/net/tramp-sh.el (tramp-sh--quoting-style-options) (tramp-sh-gio-monitor-process-filter) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter, tramp-find-executable) (tramp-set-remote-path, tramp-open-shell, tramp-find-shell) (tramp-send-command-and-check, tramp-shell-case-fold) (tramp-get-remote-path): * lisp/net/tramp-smb.el (tramp-smb-file-name-p) (tramp-smb-file-name-handler) (tramp-smb-do-file-attributes-with-stat) (tramp-smb-handle-substitute-in-file-name) (tramp-smb-get-stat-capability, tramp-smb-shell-quote-argument): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-p) (tramp-sudoedit-file-name-handler) (tramp-sudoedit-send-command-string): * test/lisp/net/tramp-archive-tests.el (tramp-archive-test-all): * test/lisp/net/tramp-tests.el (tramp--test-gvfs-p) (tramp--test-with-proper-process-name-and-buffer) (tramp-test-all): Adapt docstrings according to `checkdoc'.
2019-11-13 13:10:58 +01:00
"Signal handler for the \"org.gtk.vfs.MountTracker.mounted\" and \
2009-06-22 21:04:49 +00:00
\"org.gtk.vfs.MountTracker.unmounted\" signals."
(ignore-errors
(let ((signal-name (dbus-event-member-name last-input-event))
(elt mount-info))
;; Jump over the first elements of the mount info. Since there
2011-11-24 23:14:48 -08:00
;; were changes in the entries, we cannot access dedicated
;; elements.
(while (stringp (car elt)) (setq elt (cdr elt)))
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(let* ((fuse-mountpoint (tramp-gvfs-dbus-byte-array-to-string (cadr elt)))
(mount-spec (cl-caddr elt))
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
(prefix (tramp-gvfs-dbus-byte-array-to-string (car mount-spec)))
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(default-location (tramp-gvfs-dbus-byte-array-to-string
(cl-cadddr elt)))
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(method (tramp-gvfs-dbus-byte-array-to-string
(cadr (assoc "type" (cadr mount-spec)))))
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(user (tramp-gvfs-dbus-byte-array-to-string
(cadr (assoc "user" (cadr mount-spec)))))
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(domain (tramp-gvfs-dbus-byte-array-to-string
(cadr (assoc "domain" (cadr mount-spec)))))
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(host (tramp-gvfs-dbus-byte-array-to-string
(cadr (or (assoc "host" (cadr mount-spec))
(assoc "server" (cadr mount-spec))))))
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(port (tramp-gvfs-dbus-byte-array-to-string
(cadr (assoc "port" (cadr mount-spec)))))
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(ssl (tramp-gvfs-dbus-byte-array-to-string
(cadr (assoc "ssl" (cadr mount-spec)))))
(uri (tramp-gvfs-dbus-byte-array-to-string
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
(cadr (assoc "uri" (cadr mount-spec))))))
(when (string-match "^\\(afp\\|smb\\)" method)
(setq method (match-string 1 method)))
(when (and (string-equal "dav" method) (string-equal "true" ssl))
(setq method "davs"))
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
(when (and (string-equal "davs" method)
Rework Tramp wrt string-match-p, looking-at-p, save-match-data * lisp/net/tramp.el (tramp-find-method, tramp-find-user) (tramp-find-host, tramp-dissect-file-name, tramp-make-tramp-file-name) (tramp-completion-make-tramp-file-name, tramp-debug-message) (tramp-message, tramp-progress-reporter-update) (tramp-set-completion-function) (tramp-rfn-eshadow-update-overlay) (tramp-find-file-name-coding-system-alist) (tramp-file-name-for-operation) (tramp-use-absolute-autoload-file-names) (tramp-get-completion-methods, tramp-get-completion-user-host) (tramp-handle-directory-files) (tramp-handle-file-name-case-insensitive-p) (tramp-handle-file-name-completion, tramp-handle-file-truename) (tramp-handle-insert-directory, tramp-handle-load) (tramp-handle-shell-command, tramp-action-yesno) (tramp-action-yn, tramp-process-actions) (tramp-mode-string-to-int, tramp-get-local-locale) (tramp-local-host-p): * lisp/net/tramp-adb.el (tramp-adb-handle-file-system-info) (tramp-adb-handle-directory-files-and-attributes) (tramp-adb--gnu-switches-to-ash, tramp-adb-sh-fix-ls-output) (tramp-adb-handle-file-name-all-completions) (tramp-adb-handle-shell-command) (tramp-adb-handle-start-file-process): * lisp/net/tramp-archive.el (tramp-archive-dissect-file-name): * lisp/net/tramp-cache.el (tramp-get-hash-table) (tramp-flush-directory-properties, tramp-flush-file-function): * lisp/net/tramp-cmds.el (tramp-reporter-dump-variable) (tramp-append-tramp-buffers): * lisp/net/tramp-compat.el (tramp-compat-process-running-p): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name) (tramp-gvfs-get-file-attributes) (tramp-gvfs-handle-file-attributes) (tramp-gvfs-monitor-process-filter) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec-entry) (tramp-gvfs-mount-spec, tramp-gvfs-maybe-open-connection): * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls) (tramp-do-file-attributes-with-stat) (tramp-sh-handle-file-selinux-context) (tramp-sh-handle-directory-files-and-attributes) (tramp-do-directory-files-and-attributes-with-stat) (tramp-sh-handle-file-name-all-completions) (tramp-sh-handle-dired-compress-file) (tramp-sh-handle-insert-directory) (tramp-sh-handle-expand-file-name) (tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-sh-handle-write-region) (tramp-sh-handle-file-notify-add-watch) (tramp-sh-gio-monitor-process-filter) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter) (tramp-sh-handle-file-system-info, tramp-maybe-send-script) (tramp-find-executable, tramp-open-shell, tramp-find-shell) (tramp-open-connection-setup-interactive-shell) (tramp-find-inline-encoding, tramp-call-local-coding-command) (tramp-compute-multi-hops, tramp-maybe-open-connection) (tramp-convert-file-attributes) (tramp-make-copy-program-file-name, tramp-get-remote-locale) (tramp-get-test-nt-command, tramp-get-remote-stat) (tramp-get-inline-coding): * lisp/net/tramp-smb.el (tramp-smb-handle-directory-files) (tramp-smb-action-get-acl, tramp-smb-handle-file-attributes) (tramp-smb-handle-file-name-all-completions) (tramp-smb-handle-file-system-info) (tramp-smb-handle-file-writable-p) (tramp-smb-handle-insert-directory) (tramp-smb-handle-make-directory) (tramp-smb-handle-make-directory-internal) (tramp-smb-handle-start-file-process, tramp-smb-get-localname) (tramp-smb-read-file-entry): Use `string-match-p' and `looking-at-p'. Remove superfluous `save-match-data'. Apply `eval-when-compile' on constant concat data. * lisp/net/tramp-compat.el (tramp-compat-file-name-quoted-p-p): Use `string-prefix-p'. (tramp-compat-file-name-unquote): Do not use match data.
2018-12-06 16:00:05 +01:00
(string-match-p
tramp-gvfs-nextcloud-default-prefix-regexp prefix))
(setq method "nextcloud"))
(when (string-equal "google-drive" method)
(setq method "gdrive"))
(when (and (string-equal "http" method) (stringp uri))
(setq host (tramp-gvfs-url-host uri)
uri (url-generic-parse-url uri)
method (url-type uri)
user (url-user uri)
port (url-portspec uri)))
(when (member method tramp-media-methods)
;; Ensure that media devices are cached.
(tramp-get-media-devices nil)
(let ((v (tramp-get-connection-property
(make-tramp-media-device
:method method :host host :port port)
"vector" nil)))
(when v
(setq method (tramp-file-name-method v)
host (tramp-file-name-host v)
port (tramp-file-name-port v)))))
(when (member method tramp-gvfs-methods)
(with-parsed-tramp-file-name
(tramp-make-tramp-file-name method user domain host port "") nil
(tramp-message
v 6 "%s %s"
signal-name (tramp-gvfs-stringify-dbus-message mount-info))
(tramp-flush-file-property v "/" "list-mounts")
(if (string-equal (downcase signal-name) "unmounted")
(tramp-flush-file-properties v "/")
;; Set mountpoint and location.
(tramp-set-file-property v "/" "fuse-mountpoint" fuse-mountpoint)
(tramp-set-connection-property
v "default-location" default-location))))))))
2009-06-22 21:04:49 +00:00
(when tramp-gvfs-enabled
(dbus-register-signal
:session nil tramp-gvfs-path-mounttracker
tramp-gvfs-interface-mounttracker "mounted"
#'tramp-gvfs-handler-mounted-unmounted)
(dbus-register-signal
:session nil tramp-gvfs-path-mounttracker
tramp-gvfs-interface-mounttracker "Mounted"
#'tramp-gvfs-handler-mounted-unmounted)
(dbus-register-signal
:session nil tramp-gvfs-path-mounttracker
tramp-gvfs-interface-mounttracker "unmounted"
#'tramp-gvfs-handler-mounted-unmounted)
(dbus-register-signal
:session nil tramp-gvfs-path-mounttracker
tramp-gvfs-interface-mounttracker "Unmounted"
#'tramp-gvfs-handler-mounted-unmounted))
2009-06-22 21:04:49 +00:00
(defun tramp-gvfs-connection-mounted-p (vec)
"Check, whether the location is already mounted."
(or
(tramp-get-file-property vec "/" "fuse-mountpoint" nil)
(catch 'mounted
(dolist
(elt
(with-tramp-file-property vec "/" "list-mounts"
(with-tramp-dbus-call-method vec t
:session tramp-gvfs-service-daemon tramp-gvfs-path-mounttracker
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
tramp-gvfs-interface-mounttracker tramp-gvfs-listmounts))
nil)
;; Jump over the first elements of the mount info. Since there
2011-11-24 23:14:48 -08:00
;; were changes in the entries, we cannot access dedicated
;; elements.
(while (stringp (car elt)) (setq elt (cdr elt)))
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(let* ((fuse-mountpoint (tramp-gvfs-dbus-byte-array-to-string
(cadr elt)))
(mount-spec (cl-caddr elt))
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
(prefix (tramp-gvfs-dbus-byte-array-to-string (car mount-spec)))
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(default-location (tramp-gvfs-dbus-byte-array-to-string
(cl-cadddr elt)))
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(method (tramp-gvfs-dbus-byte-array-to-string
(cadr (assoc "type" (cadr mount-spec)))))
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(user (tramp-gvfs-dbus-byte-array-to-string
(cadr (assoc "user" (cadr mount-spec)))))
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(domain (tramp-gvfs-dbus-byte-array-to-string
(cadr (assoc "domain" (cadr mount-spec)))))
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(host (tramp-gvfs-dbus-byte-array-to-string
(cadr (or (assoc "host" (cadr mount-spec))
(assoc "server" (cadr mount-spec))))))
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(port (tramp-gvfs-dbus-byte-array-to-string
(cadr (assoc "port" (cadr mount-spec)))))
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(ssl (tramp-gvfs-dbus-byte-array-to-string
(cadr (assoc "ssl" (cadr mount-spec)))))
(uri (tramp-gvfs-dbus-byte-array-to-string
(cadr (assoc "uri" (cadr mount-spec)))))
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
(share (tramp-gvfs-dbus-byte-array-to-string
(or
(cadr (assoc "share" (cadr mount-spec)))
(cadr (assoc "volume" (cadr mount-spec)))))))
(when (string-match "^\\(afp\\|smb\\)" method)
(setq method (match-string 1 method)))
(when (and (string-equal "dav" method) (string-equal "true" ssl))
(setq method "davs"))
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
(when (and (string-equal "davs" method)
Rework Tramp wrt string-match-p, looking-at-p, save-match-data * lisp/net/tramp.el (tramp-find-method, tramp-find-user) (tramp-find-host, tramp-dissect-file-name, tramp-make-tramp-file-name) (tramp-completion-make-tramp-file-name, tramp-debug-message) (tramp-message, tramp-progress-reporter-update) (tramp-set-completion-function) (tramp-rfn-eshadow-update-overlay) (tramp-find-file-name-coding-system-alist) (tramp-file-name-for-operation) (tramp-use-absolute-autoload-file-names) (tramp-get-completion-methods, tramp-get-completion-user-host) (tramp-handle-directory-files) (tramp-handle-file-name-case-insensitive-p) (tramp-handle-file-name-completion, tramp-handle-file-truename) (tramp-handle-insert-directory, tramp-handle-load) (tramp-handle-shell-command, tramp-action-yesno) (tramp-action-yn, tramp-process-actions) (tramp-mode-string-to-int, tramp-get-local-locale) (tramp-local-host-p): * lisp/net/tramp-adb.el (tramp-adb-handle-file-system-info) (tramp-adb-handle-directory-files-and-attributes) (tramp-adb--gnu-switches-to-ash, tramp-adb-sh-fix-ls-output) (tramp-adb-handle-file-name-all-completions) (tramp-adb-handle-shell-command) (tramp-adb-handle-start-file-process): * lisp/net/tramp-archive.el (tramp-archive-dissect-file-name): * lisp/net/tramp-cache.el (tramp-get-hash-table) (tramp-flush-directory-properties, tramp-flush-file-function): * lisp/net/tramp-cmds.el (tramp-reporter-dump-variable) (tramp-append-tramp-buffers): * lisp/net/tramp-compat.el (tramp-compat-process-running-p): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name) (tramp-gvfs-get-file-attributes) (tramp-gvfs-handle-file-attributes) (tramp-gvfs-monitor-process-filter) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec-entry) (tramp-gvfs-mount-spec, tramp-gvfs-maybe-open-connection): * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls) (tramp-do-file-attributes-with-stat) (tramp-sh-handle-file-selinux-context) (tramp-sh-handle-directory-files-and-attributes) (tramp-do-directory-files-and-attributes-with-stat) (tramp-sh-handle-file-name-all-completions) (tramp-sh-handle-dired-compress-file) (tramp-sh-handle-insert-directory) (tramp-sh-handle-expand-file-name) (tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-sh-handle-write-region) (tramp-sh-handle-file-notify-add-watch) (tramp-sh-gio-monitor-process-filter) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter) (tramp-sh-handle-file-system-info, tramp-maybe-send-script) (tramp-find-executable, tramp-open-shell, tramp-find-shell) (tramp-open-connection-setup-interactive-shell) (tramp-find-inline-encoding, tramp-call-local-coding-command) (tramp-compute-multi-hops, tramp-maybe-open-connection) (tramp-convert-file-attributes) (tramp-make-copy-program-file-name, tramp-get-remote-locale) (tramp-get-test-nt-command, tramp-get-remote-stat) (tramp-get-inline-coding): * lisp/net/tramp-smb.el (tramp-smb-handle-directory-files) (tramp-smb-action-get-acl, tramp-smb-handle-file-attributes) (tramp-smb-handle-file-name-all-completions) (tramp-smb-handle-file-system-info) (tramp-smb-handle-file-writable-p) (tramp-smb-handle-insert-directory) (tramp-smb-handle-make-directory) (tramp-smb-handle-make-directory-internal) (tramp-smb-handle-start-file-process, tramp-smb-get-localname) (tramp-smb-read-file-entry): Use `string-match-p' and `looking-at-p'. Remove superfluous `save-match-data'. Apply `eval-when-compile' on constant concat data. * lisp/net/tramp-compat.el (tramp-compat-file-name-quoted-p-p): Use `string-prefix-p'. (tramp-compat-file-name-unquote): Do not use match data.
2018-12-06 16:00:05 +01:00
(string-match-p
tramp-gvfs-nextcloud-default-prefix-regexp prefix))
(setq method "nextcloud"))
(when (string-equal "google-drive" method)
(setq method "gdrive"))
(when (and (string-equal "http" method) (stringp uri))
(setq host (tramp-gvfs-url-host uri)
uri (url-generic-parse-url uri)
method (url-type uri)
user (url-user uri)
port (url-portspec uri)))
(when (member method tramp-media-methods)
;; Ensure that media devices are cached.
(tramp-get-media-devices vec)
(let ((v (tramp-get-connection-property
(make-tramp-media-device
:method method :host host :port port)
"vector" nil)))
(when v
(setq method (tramp-file-name-method v)
host (tramp-file-name-host v)
port (tramp-file-name-port v)))))
(when (and
(string-equal method (tramp-file-name-method vec))
(string-equal user (tramp-file-name-user vec))
(string-equal domain (tramp-file-name-domain vec))
(string-equal host (tramp-file-name-host vec))
(string-equal port (tramp-file-name-port vec))
Rework Tramp wrt string-match-p, looking-at-p, save-match-data * lisp/net/tramp.el (tramp-find-method, tramp-find-user) (tramp-find-host, tramp-dissect-file-name, tramp-make-tramp-file-name) (tramp-completion-make-tramp-file-name, tramp-debug-message) (tramp-message, tramp-progress-reporter-update) (tramp-set-completion-function) (tramp-rfn-eshadow-update-overlay) (tramp-find-file-name-coding-system-alist) (tramp-file-name-for-operation) (tramp-use-absolute-autoload-file-names) (tramp-get-completion-methods, tramp-get-completion-user-host) (tramp-handle-directory-files) (tramp-handle-file-name-case-insensitive-p) (tramp-handle-file-name-completion, tramp-handle-file-truename) (tramp-handle-insert-directory, tramp-handle-load) (tramp-handle-shell-command, tramp-action-yesno) (tramp-action-yn, tramp-process-actions) (tramp-mode-string-to-int, tramp-get-local-locale) (tramp-local-host-p): * lisp/net/tramp-adb.el (tramp-adb-handle-file-system-info) (tramp-adb-handle-directory-files-and-attributes) (tramp-adb--gnu-switches-to-ash, tramp-adb-sh-fix-ls-output) (tramp-adb-handle-file-name-all-completions) (tramp-adb-handle-shell-command) (tramp-adb-handle-start-file-process): * lisp/net/tramp-archive.el (tramp-archive-dissect-file-name): * lisp/net/tramp-cache.el (tramp-get-hash-table) (tramp-flush-directory-properties, tramp-flush-file-function): * lisp/net/tramp-cmds.el (tramp-reporter-dump-variable) (tramp-append-tramp-buffers): * lisp/net/tramp-compat.el (tramp-compat-process-running-p): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name) (tramp-gvfs-get-file-attributes) (tramp-gvfs-handle-file-attributes) (tramp-gvfs-monitor-process-filter) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec-entry) (tramp-gvfs-mount-spec, tramp-gvfs-maybe-open-connection): * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls) (tramp-do-file-attributes-with-stat) (tramp-sh-handle-file-selinux-context) (tramp-sh-handle-directory-files-and-attributes) (tramp-do-directory-files-and-attributes-with-stat) (tramp-sh-handle-file-name-all-completions) (tramp-sh-handle-dired-compress-file) (tramp-sh-handle-insert-directory) (tramp-sh-handle-expand-file-name) (tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-sh-handle-write-region) (tramp-sh-handle-file-notify-add-watch) (tramp-sh-gio-monitor-process-filter) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter) (tramp-sh-handle-file-system-info, tramp-maybe-send-script) (tramp-find-executable, tramp-open-shell, tramp-find-shell) (tramp-open-connection-setup-interactive-shell) (tramp-find-inline-encoding, tramp-call-local-coding-command) (tramp-compute-multi-hops, tramp-maybe-open-connection) (tramp-convert-file-attributes) (tramp-make-copy-program-file-name, tramp-get-remote-locale) (tramp-get-test-nt-command, tramp-get-remote-stat) (tramp-get-inline-coding): * lisp/net/tramp-smb.el (tramp-smb-handle-directory-files) (tramp-smb-action-get-acl, tramp-smb-handle-file-attributes) (tramp-smb-handle-file-name-all-completions) (tramp-smb-handle-file-system-info) (tramp-smb-handle-file-writable-p) (tramp-smb-handle-insert-directory) (tramp-smb-handle-make-directory) (tramp-smb-handle-make-directory-internal) (tramp-smb-handle-start-file-process, tramp-smb-get-localname) (tramp-smb-read-file-entry): Use `string-match-p' and `looking-at-p'. Remove superfluous `save-match-data'. Apply `eval-when-compile' on constant concat data. * lisp/net/tramp-compat.el (tramp-compat-file-name-quoted-p-p): Use `string-prefix-p'. (tramp-compat-file-name-unquote): Do not use match data.
2018-12-06 16:00:05 +01:00
(string-match-p (concat "^/" (regexp-quote (or share "")))
(tramp-file-name-unquote-localname vec)))
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
;; Set mountpoint and location.
(tramp-set-file-property vec "/" "fuse-mountpoint" fuse-mountpoint)
(tramp-set-connection-property
vec "default-location" default-location)
(throw 'mounted t)))))))
2009-06-22 21:04:49 +00:00
(defun tramp-gvfs-unmount (vec)
"Unmount the object identified by VEC."
(setf (tramp-file-name-localname vec) "/"
(tramp-file-name-hop vec) nil)
(when (tramp-gvfs-connection-mounted-p vec)
(tramp-gvfs-send-command
vec "gvfs-mount" "-u"
(tramp-gvfs-url-file-name (tramp-make-tramp-file-name vec))))
(while (tramp-gvfs-connection-mounted-p vec)
(read-event nil nil 0.1))
(tramp-cleanup-connection vec 'keep-debug 'keep-password))
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(defun tramp-gvfs-mount-spec-entry (key value)
"Construct a mount-spec entry to be used in a mount_spec.
It was \"a(say)\", but has changed to \"a{sv})\"."
Rework Tramp wrt string-match-p, looking-at-p, save-match-data * lisp/net/tramp.el (tramp-find-method, tramp-find-user) (tramp-find-host, tramp-dissect-file-name, tramp-make-tramp-file-name) (tramp-completion-make-tramp-file-name, tramp-debug-message) (tramp-message, tramp-progress-reporter-update) (tramp-set-completion-function) (tramp-rfn-eshadow-update-overlay) (tramp-find-file-name-coding-system-alist) (tramp-file-name-for-operation) (tramp-use-absolute-autoload-file-names) (tramp-get-completion-methods, tramp-get-completion-user-host) (tramp-handle-directory-files) (tramp-handle-file-name-case-insensitive-p) (tramp-handle-file-name-completion, tramp-handle-file-truename) (tramp-handle-insert-directory, tramp-handle-load) (tramp-handle-shell-command, tramp-action-yesno) (tramp-action-yn, tramp-process-actions) (tramp-mode-string-to-int, tramp-get-local-locale) (tramp-local-host-p): * lisp/net/tramp-adb.el (tramp-adb-handle-file-system-info) (tramp-adb-handle-directory-files-and-attributes) (tramp-adb--gnu-switches-to-ash, tramp-adb-sh-fix-ls-output) (tramp-adb-handle-file-name-all-completions) (tramp-adb-handle-shell-command) (tramp-adb-handle-start-file-process): * lisp/net/tramp-archive.el (tramp-archive-dissect-file-name): * lisp/net/tramp-cache.el (tramp-get-hash-table) (tramp-flush-directory-properties, tramp-flush-file-function): * lisp/net/tramp-cmds.el (tramp-reporter-dump-variable) (tramp-append-tramp-buffers): * lisp/net/tramp-compat.el (tramp-compat-process-running-p): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name) (tramp-gvfs-get-file-attributes) (tramp-gvfs-handle-file-attributes) (tramp-gvfs-monitor-process-filter) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec-entry) (tramp-gvfs-mount-spec, tramp-gvfs-maybe-open-connection): * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls) (tramp-do-file-attributes-with-stat) (tramp-sh-handle-file-selinux-context) (tramp-sh-handle-directory-files-and-attributes) (tramp-do-directory-files-and-attributes-with-stat) (tramp-sh-handle-file-name-all-completions) (tramp-sh-handle-dired-compress-file) (tramp-sh-handle-insert-directory) (tramp-sh-handle-expand-file-name) (tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-sh-handle-write-region) (tramp-sh-handle-file-notify-add-watch) (tramp-sh-gio-monitor-process-filter) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter) (tramp-sh-handle-file-system-info, tramp-maybe-send-script) (tramp-find-executable, tramp-open-shell, tramp-find-shell) (tramp-open-connection-setup-interactive-shell) (tramp-find-inline-encoding, tramp-call-local-coding-command) (tramp-compute-multi-hops, tramp-maybe-open-connection) (tramp-convert-file-attributes) (tramp-make-copy-program-file-name, tramp-get-remote-locale) (tramp-get-test-nt-command, tramp-get-remote-stat) (tramp-get-inline-coding): * lisp/net/tramp-smb.el (tramp-smb-handle-directory-files) (tramp-smb-action-get-acl, tramp-smb-handle-file-attributes) (tramp-smb-handle-file-name-all-completions) (tramp-smb-handle-file-system-info) (tramp-smb-handle-file-writable-p) (tramp-smb-handle-insert-directory) (tramp-smb-handle-make-directory) (tramp-smb-handle-make-directory-internal) (tramp-smb-handle-start-file-process, tramp-smb-get-localname) (tramp-smb-read-file-entry): Use `string-match-p' and `looking-at-p'. Remove superfluous `save-match-data'. Apply `eval-when-compile' on constant concat data. * lisp/net/tramp-compat.el (tramp-compat-file-name-quoted-p-p): Use `string-prefix-p'. (tramp-compat-file-name-unquote): Do not use match data.
2018-12-06 16:00:05 +01:00
(if (string-match-p "^(aya{sv})" tramp-gvfs-mountlocation-signature)
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(list :dict-entry key
(list :variant (tramp-gvfs-dbus-string-to-byte-array value)))
(list :struct key (tramp-gvfs-dbus-string-to-byte-array value))))
2009-06-22 21:04:49 +00:00
(defun tramp-gvfs-mount-spec (vec)
"Return a mount-spec for \"org.gtk.vfs.MountTracker.mountLocation\"."
(let* ((media (tramp-get-media-device vec))
(method (if media
(tramp-media-device-method media)
(tramp-file-name-method vec)))
Introduce a defstruct `tramp-file-name' as central data structure. 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.
2017-05-24 16:16:53 +02:00
(user (tramp-file-name-user vec))
2009-06-22 21:04:49 +00:00
(domain (tramp-file-name-domain vec))
(host (if media
(tramp-media-device-host media) (tramp-file-name-host vec)))
(port (if media
(tramp-media-device-port media) (tramp-file-name-port vec)))
(localname (tramp-file-name-unquote-localname vec))
(share (when (string-match "^/?\\([^/]+\\)" localname)
(match-string 1 localname)))
Rework Tramp wrt string-match-p, looking-at-p, save-match-data * lisp/net/tramp.el (tramp-find-method, tramp-find-user) (tramp-find-host, tramp-dissect-file-name, tramp-make-tramp-file-name) (tramp-completion-make-tramp-file-name, tramp-debug-message) (tramp-message, tramp-progress-reporter-update) (tramp-set-completion-function) (tramp-rfn-eshadow-update-overlay) (tramp-find-file-name-coding-system-alist) (tramp-file-name-for-operation) (tramp-use-absolute-autoload-file-names) (tramp-get-completion-methods, tramp-get-completion-user-host) (tramp-handle-directory-files) (tramp-handle-file-name-case-insensitive-p) (tramp-handle-file-name-completion, tramp-handle-file-truename) (tramp-handle-insert-directory, tramp-handle-load) (tramp-handle-shell-command, tramp-action-yesno) (tramp-action-yn, tramp-process-actions) (tramp-mode-string-to-int, tramp-get-local-locale) (tramp-local-host-p): * lisp/net/tramp-adb.el (tramp-adb-handle-file-system-info) (tramp-adb-handle-directory-files-and-attributes) (tramp-adb--gnu-switches-to-ash, tramp-adb-sh-fix-ls-output) (tramp-adb-handle-file-name-all-completions) (tramp-adb-handle-shell-command) (tramp-adb-handle-start-file-process): * lisp/net/tramp-archive.el (tramp-archive-dissect-file-name): * lisp/net/tramp-cache.el (tramp-get-hash-table) (tramp-flush-directory-properties, tramp-flush-file-function): * lisp/net/tramp-cmds.el (tramp-reporter-dump-variable) (tramp-append-tramp-buffers): * lisp/net/tramp-compat.el (tramp-compat-process-running-p): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name) (tramp-gvfs-get-file-attributes) (tramp-gvfs-handle-file-attributes) (tramp-gvfs-monitor-process-filter) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec-entry) (tramp-gvfs-mount-spec, tramp-gvfs-maybe-open-connection): * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls) (tramp-do-file-attributes-with-stat) (tramp-sh-handle-file-selinux-context) (tramp-sh-handle-directory-files-and-attributes) (tramp-do-directory-files-and-attributes-with-stat) (tramp-sh-handle-file-name-all-completions) (tramp-sh-handle-dired-compress-file) (tramp-sh-handle-insert-directory) (tramp-sh-handle-expand-file-name) (tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-sh-handle-write-region) (tramp-sh-handle-file-notify-add-watch) (tramp-sh-gio-monitor-process-filter) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter) (tramp-sh-handle-file-system-info, tramp-maybe-send-script) (tramp-find-executable, tramp-open-shell, tramp-find-shell) (tramp-open-connection-setup-interactive-shell) (tramp-find-inline-encoding, tramp-call-local-coding-command) (tramp-compute-multi-hops, tramp-maybe-open-connection) (tramp-convert-file-attributes) (tramp-make-copy-program-file-name, tramp-get-remote-locale) (tramp-get-test-nt-command, tramp-get-remote-stat) (tramp-get-inline-coding): * lisp/net/tramp-smb.el (tramp-smb-handle-directory-files) (tramp-smb-action-get-acl, tramp-smb-handle-file-attributes) (tramp-smb-handle-file-name-all-completions) (tramp-smb-handle-file-system-info) (tramp-smb-handle-file-writable-p) (tramp-smb-handle-insert-directory) (tramp-smb-handle-make-directory) (tramp-smb-handle-make-directory-internal) (tramp-smb-handle-start-file-process, tramp-smb-get-localname) (tramp-smb-read-file-entry): Use `string-match-p' and `looking-at-p'. Remove superfluous `save-match-data'. Apply `eval-when-compile' on constant concat data. * lisp/net/tramp-compat.el (tramp-compat-file-name-quoted-p-p): Use `string-prefix-p'. (tramp-compat-file-name-unquote): Do not use match data.
2018-12-06 16:00:05 +01:00
(ssl (if (string-match-p "^davs\\|^nextcloud" method) "true" "false"))
(mount-spec
`(:array
,@(cond
((string-equal "smb" method)
(list (tramp-gvfs-mount-spec-entry "type" "smb-share")
(tramp-gvfs-mount-spec-entry "server" host)
(tramp-gvfs-mount-spec-entry "share" share)))
Rework Tramp wrt string-match-p, looking-at-p, save-match-data * lisp/net/tramp.el (tramp-find-method, tramp-find-user) (tramp-find-host, tramp-dissect-file-name, tramp-make-tramp-file-name) (tramp-completion-make-tramp-file-name, tramp-debug-message) (tramp-message, tramp-progress-reporter-update) (tramp-set-completion-function) (tramp-rfn-eshadow-update-overlay) (tramp-find-file-name-coding-system-alist) (tramp-file-name-for-operation) (tramp-use-absolute-autoload-file-names) (tramp-get-completion-methods, tramp-get-completion-user-host) (tramp-handle-directory-files) (tramp-handle-file-name-case-insensitive-p) (tramp-handle-file-name-completion, tramp-handle-file-truename) (tramp-handle-insert-directory, tramp-handle-load) (tramp-handle-shell-command, tramp-action-yesno) (tramp-action-yn, tramp-process-actions) (tramp-mode-string-to-int, tramp-get-local-locale) (tramp-local-host-p): * lisp/net/tramp-adb.el (tramp-adb-handle-file-system-info) (tramp-adb-handle-directory-files-and-attributes) (tramp-adb--gnu-switches-to-ash, tramp-adb-sh-fix-ls-output) (tramp-adb-handle-file-name-all-completions) (tramp-adb-handle-shell-command) (tramp-adb-handle-start-file-process): * lisp/net/tramp-archive.el (tramp-archive-dissect-file-name): * lisp/net/tramp-cache.el (tramp-get-hash-table) (tramp-flush-directory-properties, tramp-flush-file-function): * lisp/net/tramp-cmds.el (tramp-reporter-dump-variable) (tramp-append-tramp-buffers): * lisp/net/tramp-compat.el (tramp-compat-process-running-p): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name) (tramp-gvfs-get-file-attributes) (tramp-gvfs-handle-file-attributes) (tramp-gvfs-monitor-process-filter) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec-entry) (tramp-gvfs-mount-spec, tramp-gvfs-maybe-open-connection): * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls) (tramp-do-file-attributes-with-stat) (tramp-sh-handle-file-selinux-context) (tramp-sh-handle-directory-files-and-attributes) (tramp-do-directory-files-and-attributes-with-stat) (tramp-sh-handle-file-name-all-completions) (tramp-sh-handle-dired-compress-file) (tramp-sh-handle-insert-directory) (tramp-sh-handle-expand-file-name) (tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-sh-handle-write-region) (tramp-sh-handle-file-notify-add-watch) (tramp-sh-gio-monitor-process-filter) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter) (tramp-sh-handle-file-system-info, tramp-maybe-send-script) (tramp-find-executable, tramp-open-shell, tramp-find-shell) (tramp-open-connection-setup-interactive-shell) (tramp-find-inline-encoding, tramp-call-local-coding-command) (tramp-compute-multi-hops, tramp-maybe-open-connection) (tramp-convert-file-attributes) (tramp-make-copy-program-file-name, tramp-get-remote-locale) (tramp-get-test-nt-command, tramp-get-remote-stat) (tramp-get-inline-coding): * lisp/net/tramp-smb.el (tramp-smb-handle-directory-files) (tramp-smb-action-get-acl, tramp-smb-handle-file-attributes) (tramp-smb-handle-file-name-all-completions) (tramp-smb-handle-file-system-info) (tramp-smb-handle-file-writable-p) (tramp-smb-handle-insert-directory) (tramp-smb-handle-make-directory) (tramp-smb-handle-make-directory-internal) (tramp-smb-handle-start-file-process, tramp-smb-get-localname) (tramp-smb-read-file-entry): Use `string-match-p' and `looking-at-p'. Remove superfluous `save-match-data'. Apply `eval-when-compile' on constant concat data. * lisp/net/tramp-compat.el (tramp-compat-file-name-quoted-p-p): Use `string-prefix-p'. (tramp-compat-file-name-unquote): Do not use match data.
2018-12-06 16:00:05 +01:00
((string-match-p "^dav\\|^nextcloud" method)
(list (tramp-gvfs-mount-spec-entry "type" "dav")
(tramp-gvfs-mount-spec-entry "host" host)
(tramp-gvfs-mount-spec-entry "ssl" ssl)))
((string-equal "afp" method)
(list (tramp-gvfs-mount-spec-entry "type" "afp-volume")
(tramp-gvfs-mount-spec-entry "host" host)
(tramp-gvfs-mount-spec-entry "volume" share)))
((string-equal "gdrive" method)
(list (tramp-gvfs-mount-spec-entry "type" "google-drive")
(tramp-gvfs-mount-spec-entry "host" host)))
((string-equal "nextcloud" method)
(list (tramp-gvfs-mount-spec-entry "type" "owncloud")
(tramp-gvfs-mount-spec-entry "host" host)))
Rework Tramp wrt string-match-p, looking-at-p, save-match-data * lisp/net/tramp.el (tramp-find-method, tramp-find-user) (tramp-find-host, tramp-dissect-file-name, tramp-make-tramp-file-name) (tramp-completion-make-tramp-file-name, tramp-debug-message) (tramp-message, tramp-progress-reporter-update) (tramp-set-completion-function) (tramp-rfn-eshadow-update-overlay) (tramp-find-file-name-coding-system-alist) (tramp-file-name-for-operation) (tramp-use-absolute-autoload-file-names) (tramp-get-completion-methods, tramp-get-completion-user-host) (tramp-handle-directory-files) (tramp-handle-file-name-case-insensitive-p) (tramp-handle-file-name-completion, tramp-handle-file-truename) (tramp-handle-insert-directory, tramp-handle-load) (tramp-handle-shell-command, tramp-action-yesno) (tramp-action-yn, tramp-process-actions) (tramp-mode-string-to-int, tramp-get-local-locale) (tramp-local-host-p): * lisp/net/tramp-adb.el (tramp-adb-handle-file-system-info) (tramp-adb-handle-directory-files-and-attributes) (tramp-adb--gnu-switches-to-ash, tramp-adb-sh-fix-ls-output) (tramp-adb-handle-file-name-all-completions) (tramp-adb-handle-shell-command) (tramp-adb-handle-start-file-process): * lisp/net/tramp-archive.el (tramp-archive-dissect-file-name): * lisp/net/tramp-cache.el (tramp-get-hash-table) (tramp-flush-directory-properties, tramp-flush-file-function): * lisp/net/tramp-cmds.el (tramp-reporter-dump-variable) (tramp-append-tramp-buffers): * lisp/net/tramp-compat.el (tramp-compat-process-running-p): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name) (tramp-gvfs-get-file-attributes) (tramp-gvfs-handle-file-attributes) (tramp-gvfs-monitor-process-filter) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec-entry) (tramp-gvfs-mount-spec, tramp-gvfs-maybe-open-connection): * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls) (tramp-do-file-attributes-with-stat) (tramp-sh-handle-file-selinux-context) (tramp-sh-handle-directory-files-and-attributes) (tramp-do-directory-files-and-attributes-with-stat) (tramp-sh-handle-file-name-all-completions) (tramp-sh-handle-dired-compress-file) (tramp-sh-handle-insert-directory) (tramp-sh-handle-expand-file-name) (tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-sh-handle-write-region) (tramp-sh-handle-file-notify-add-watch) (tramp-sh-gio-monitor-process-filter) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter) (tramp-sh-handle-file-system-info, tramp-maybe-send-script) (tramp-find-executable, tramp-open-shell, tramp-find-shell) (tramp-open-connection-setup-interactive-shell) (tramp-find-inline-encoding, tramp-call-local-coding-command) (tramp-compute-multi-hops, tramp-maybe-open-connection) (tramp-convert-file-attributes) (tramp-make-copy-program-file-name, tramp-get-remote-locale) (tramp-get-test-nt-command, tramp-get-remote-stat) (tramp-get-inline-coding): * lisp/net/tramp-smb.el (tramp-smb-handle-directory-files) (tramp-smb-action-get-acl, tramp-smb-handle-file-attributes) (tramp-smb-handle-file-name-all-completions) (tramp-smb-handle-file-system-info) (tramp-smb-handle-file-writable-p) (tramp-smb-handle-insert-directory) (tramp-smb-handle-make-directory) (tramp-smb-handle-make-directory-internal) (tramp-smb-handle-start-file-process, tramp-smb-get-localname) (tramp-smb-read-file-entry): Use `string-match-p' and `looking-at-p'. Remove superfluous `save-match-data'. Apply `eval-when-compile' on constant concat data. * lisp/net/tramp-compat.el (tramp-compat-file-name-quoted-p-p): Use `string-prefix-p'. (tramp-compat-file-name-unquote): Do not use match data.
2018-12-06 16:00:05 +01:00
((string-match-p "^http" method)
(list (tramp-gvfs-mount-spec-entry "type" "http")
(tramp-gvfs-mount-spec-entry
"uri"
(url-recreate-url
(url-parse-make-urlobj
method user nil host port "/" nil nil t)))))
(t
(list (tramp-gvfs-mount-spec-entry "type" method)
(tramp-gvfs-mount-spec-entry "host" host))))
,@(when user
(list (tramp-gvfs-mount-spec-entry "user" user)))
,@(when domain
(list (tramp-gvfs-mount-spec-entry "domain" domain)))
,@(when port
(list (tramp-gvfs-mount-spec-entry "port" port)))))
(mount-pref
Rework Tramp wrt string-match-p, looking-at-p, save-match-data * lisp/net/tramp.el (tramp-find-method, tramp-find-user) (tramp-find-host, tramp-dissect-file-name, tramp-make-tramp-file-name) (tramp-completion-make-tramp-file-name, tramp-debug-message) (tramp-message, tramp-progress-reporter-update) (tramp-set-completion-function) (tramp-rfn-eshadow-update-overlay) (tramp-find-file-name-coding-system-alist) (tramp-file-name-for-operation) (tramp-use-absolute-autoload-file-names) (tramp-get-completion-methods, tramp-get-completion-user-host) (tramp-handle-directory-files) (tramp-handle-file-name-case-insensitive-p) (tramp-handle-file-name-completion, tramp-handle-file-truename) (tramp-handle-insert-directory, tramp-handle-load) (tramp-handle-shell-command, tramp-action-yesno) (tramp-action-yn, tramp-process-actions) (tramp-mode-string-to-int, tramp-get-local-locale) (tramp-local-host-p): * lisp/net/tramp-adb.el (tramp-adb-handle-file-system-info) (tramp-adb-handle-directory-files-and-attributes) (tramp-adb--gnu-switches-to-ash, tramp-adb-sh-fix-ls-output) (tramp-adb-handle-file-name-all-completions) (tramp-adb-handle-shell-command) (tramp-adb-handle-start-file-process): * lisp/net/tramp-archive.el (tramp-archive-dissect-file-name): * lisp/net/tramp-cache.el (tramp-get-hash-table) (tramp-flush-directory-properties, tramp-flush-file-function): * lisp/net/tramp-cmds.el (tramp-reporter-dump-variable) (tramp-append-tramp-buffers): * lisp/net/tramp-compat.el (tramp-compat-process-running-p): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name) (tramp-gvfs-get-file-attributes) (tramp-gvfs-handle-file-attributes) (tramp-gvfs-monitor-process-filter) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec-entry) (tramp-gvfs-mount-spec, tramp-gvfs-maybe-open-connection): * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls) (tramp-do-file-attributes-with-stat) (tramp-sh-handle-file-selinux-context) (tramp-sh-handle-directory-files-and-attributes) (tramp-do-directory-files-and-attributes-with-stat) (tramp-sh-handle-file-name-all-completions) (tramp-sh-handle-dired-compress-file) (tramp-sh-handle-insert-directory) (tramp-sh-handle-expand-file-name) (tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-sh-handle-write-region) (tramp-sh-handle-file-notify-add-watch) (tramp-sh-gio-monitor-process-filter) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter) (tramp-sh-handle-file-system-info, tramp-maybe-send-script) (tramp-find-executable, tramp-open-shell, tramp-find-shell) (tramp-open-connection-setup-interactive-shell) (tramp-find-inline-encoding, tramp-call-local-coding-command) (tramp-compute-multi-hops, tramp-maybe-open-connection) (tramp-convert-file-attributes) (tramp-make-copy-program-file-name, tramp-get-remote-locale) (tramp-get-test-nt-command, tramp-get-remote-stat) (tramp-get-inline-coding): * lisp/net/tramp-smb.el (tramp-smb-handle-directory-files) (tramp-smb-action-get-acl, tramp-smb-handle-file-attributes) (tramp-smb-handle-file-name-all-completions) (tramp-smb-handle-file-system-info) (tramp-smb-handle-file-writable-p) (tramp-smb-handle-insert-directory) (tramp-smb-handle-make-directory) (tramp-smb-handle-make-directory-internal) (tramp-smb-handle-start-file-process, tramp-smb-get-localname) (tramp-smb-read-file-entry): Use `string-match-p' and `looking-at-p'. Remove superfluous `save-match-data'. Apply `eval-when-compile' on constant concat data. * lisp/net/tramp-compat.el (tramp-compat-file-name-quoted-p-p): Use `string-prefix-p'. (tramp-compat-file-name-unquote): Do not use match data.
2018-12-06 16:00:05 +01:00
(if (and (string-match-p "^dav" method)
(string-match "^/?[^/]+" localname))
(match-string 0 localname)
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
(tramp-gvfs-get-remote-prefix vec))))
2009-06-22 21:04:49 +00:00
;; Return.
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
`(:struct ,(tramp-gvfs-dbus-string-to-byte-array mount-pref) ,mount-spec)))
2009-06-22 21:04:49 +00:00
(defun tramp-gvfs-handler-volumeadded-volumeremoved (_dbus-name _id volume)
"Signal handler for the \"org.gtk.Private.RemoteVolumeMonitor.VolumeAdded\" \
and \"org.gtk.Private.RemoteVolumeMonitor.VolumeRemoved\" signals."
(ignore-errors
(let* ((signal-name (dbus-event-member-name last-input-event))
(uri (url-generic-parse-url (nth 5 volume)))
(method (url-type uri))
(vec (make-tramp-file-name
:method "mtp"
;; A host name cannot contain spaces.
:host (tramp-compat-string-replace " " "_" (nth 1 volume))))
(media (make-tramp-media-device
:method method
:host (tramp-gvfs-url-host (nth 5 volume))
:port (and (url-portspec uri)))))
(when (member method tramp-media-methods)
(tramp-message
vec 6 "%s %s" signal-name (tramp-gvfs-stringify-dbus-message volume))
(tramp-flush-connection-properties vec)
(tramp-flush-connection-properties media)
(tramp-get-media-devices nil)))))
(when tramp-gvfs-enabled
(dbus-register-signal
:session nil tramp-gvfs-path-remotevolumemonitor
tramp-gvfs-interface-remotevolumemonitor "VolumeAdded"
#'tramp-gvfs-handler-volumeadded-volumeremoved)
(dbus-register-signal
:session nil tramp-gvfs-path-remotevolumemonitor
tramp-gvfs-interface-remotevolumemonitor "VolumeRemoved"
#'tramp-gvfs-handler-volumeadded-volumeremoved))
2009-06-22 21:04:49 +00:00
;; Connection functions.
2009-06-22 21:04:49 +00:00
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
(defun tramp-gvfs-get-remote-prefix (vec)
"The prefix of the remote connection VEC.
This is relevant for GNOME Online Accounts."
(with-tramp-connection-property vec "prefix"
;; Ensure that GNOME Online Accounts are cached.
(when (member (tramp-file-name-method vec) tramp-goa-methods)
(tramp-get-goa-accounts vec))
(tramp-get-connection-property (tramp-get-goa-account vec) "prefix" "/")))
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
2009-06-22 21:04:49 +00:00
(defun tramp-gvfs-maybe-open-connection (vec)
"Maybe open a connection VEC.
Does not do anything if a connection is already open, but re-opens the
connection if a previous connection has died for some reason."
;; During completion, don't reopen a new connection.
(unless (tramp-connectable-p vec)
(throw 'non-essential 'non-essential))
2009-06-22 21:04:49 +00:00
;; We set the file name, in case there are incoming D-Bus signals or
;; D-Bus errors.
(setq tramp-gvfs-dbus-event-vector vec)
;; For password handling, we need a process bound to the connection
;; buffer. Therefore, we create a dummy process. Maybe there is a
;; better solution?
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(unless (get-buffer-process (tramp-get-connection-buffer vec))
2009-06-22 21:04:49 +00:00
(let ((p (make-network-process
Stronger check for Tramp method * lisp/net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection): * lisp/net/tramp-rclone.el (tramp-rclone-maybe-open-connection): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-maybe-open-connection): Use `tramp-get-connection-name'. * lisp/net/tramp-sh.el (tramp-sh-handle-make-symbolic-link): * lisp/net/tramp-smb.el (tramp-smb-handle-make-symbolic-link): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-make-symbolic-link): Don't check remote TARGET. * lisp/net/tramp.el (tramp-dissect-file-name): Check for proper method. (tramp-file-name-for-operation): Take only 2nd argument into account for file name handler. (tramp-file-name-handler): Suppress checks for `file-remote-p'. * test/lisp/net/tramp-archive-tests.el (tramp-archive-test02-file-name-dissect): Suppress check for wrong method. * test/lisp/net/tramp-tests.el (tramp--test-instrument-test-case): Dump *all* Tramp buffers. (tramp-test02-file-name-dissect) (tramp-test02-file-name-dissect-simplified) (tramp-test02-file-name-dissect-separate): Check also wrong method. (tramp-test03-file-name-defaults): Check, that the respective Tramp package is loaded. (tramp-test04-substitute-in-file-name) (tramp-test05-expand-file-name) (tramp-test06-directory-file-name, tramp-test44-auto-load): Suppress check for wrong method. (tramp-test30-make-process): Remove instrumentation code. (tramp-test31-interrupt-process, tramp-test36-vc-registered): Guarantee that connection is established prior starting process.
2019-06-04 12:51:45 +02:00
:name (tramp-get-connection-name vec)
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
:buffer (tramp-get-connection-buffer vec)
Sync with Tramp repository. * lisp/net/tramp-adb.el (tramp-adb-handle-start-file-process): * lisp/net/tramp-sh.el (tramp-sh-handle-start-file-process) * lisp/net/tramp-smb.el (tramp-smb-handle-start-file-process): Create BUFFER if it doesn't exist. Reported by Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com>. * lisp/net/tramp-gvfs.el (tramp-gvfs-file-attributes) (tramp-gvfs-file-attributes-with-gvfs-ls-regexp) (tramp-gvfs-file-attributes-with-gvfs-info-regexp): New defconst. (tramp-gvfs-get-directory-attributes) (tramp-gvfs-get-root-attributes) (tramp-gvfs-get-file-attributes): New defun. (tramp-gvfs-handle-file-attributes) (tramp-gvfs-handle-file-name-all-completions): Use them. (tramp-gvfs-handle-file-directory-p): Use `file-truename'. (tramp-gvfs-maybe-open-connection): Set :noquery flag for process. (tramp-gvfs-send-command): Add locale settings to `process-environment'. (top): Suppress D-Bus error messages during zeroconf initialization. * lisp/net/tramp.el (tramp-unknown-id-string) (tramp-unknown-id-integer): New defconst. (tramp-check-cached-permissions) * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-attributes) * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls) (tramp-convert-file-attributes, tramp-get-remote-uid) (tramp-get-remote-gid): Use them. * lisp/net/tramp-sh.el (tramp-display-escape-sequence-regexp): Rename from `tramp-color-escape-sequence-regexp'. (tramp-sh-handle-insert-directory) (tramp-convert-file-attributes): Adapt callees. (tramp-device-escape-sequence-regexp): New defconst. (tramp-wait-for-output): Use it. Reported by Matthías Páll Gissurarson <icetritlo@gmail.com>. * lisp/net/tramp-smb.el (tramp-smb-handle-file-name-all-completions): Simplify. * test/lisp/net/tramp-tests.el (tramp-test26-process-file) (tramp-test28-shell-command): Use `tramp-display-escape-sequence-regexp'.
2016-05-28 12:14:58 +02:00
:server t :host 'local :service t :noquery t)))
(process-put p 'vector vec)
(set-process-query-on-exit-flag p nil)
;; Set connection-local variables.
(tramp-set-connection-local-variables vec)))
2009-06-22 21:04:49 +00:00
(unless (tramp-gvfs-connection-mounted-p vec)
(let ((method (tramp-file-name-method vec))
(user (tramp-file-name-user vec))
(host (tramp-file-name-host vec))
(localname (tramp-file-name-unquote-localname vec))
(object-path
(tramp-gvfs-object-path (tramp-make-tramp-file-name vec 'noloc))))
2009-06-22 21:04:49 +00:00
(when (and (string-equal method "afp")
(string-equal localname "/"))
(tramp-user-error vec "Filename must contain an AFP volume"))
Rework Tramp wrt string-match-p, looking-at-p, save-match-data * lisp/net/tramp.el (tramp-find-method, tramp-find-user) (tramp-find-host, tramp-dissect-file-name, tramp-make-tramp-file-name) (tramp-completion-make-tramp-file-name, tramp-debug-message) (tramp-message, tramp-progress-reporter-update) (tramp-set-completion-function) (tramp-rfn-eshadow-update-overlay) (tramp-find-file-name-coding-system-alist) (tramp-file-name-for-operation) (tramp-use-absolute-autoload-file-names) (tramp-get-completion-methods, tramp-get-completion-user-host) (tramp-handle-directory-files) (tramp-handle-file-name-case-insensitive-p) (tramp-handle-file-name-completion, tramp-handle-file-truename) (tramp-handle-insert-directory, tramp-handle-load) (tramp-handle-shell-command, tramp-action-yesno) (tramp-action-yn, tramp-process-actions) (tramp-mode-string-to-int, tramp-get-local-locale) (tramp-local-host-p): * lisp/net/tramp-adb.el (tramp-adb-handle-file-system-info) (tramp-adb-handle-directory-files-and-attributes) (tramp-adb--gnu-switches-to-ash, tramp-adb-sh-fix-ls-output) (tramp-adb-handle-file-name-all-completions) (tramp-adb-handle-shell-command) (tramp-adb-handle-start-file-process): * lisp/net/tramp-archive.el (tramp-archive-dissect-file-name): * lisp/net/tramp-cache.el (tramp-get-hash-table) (tramp-flush-directory-properties, tramp-flush-file-function): * lisp/net/tramp-cmds.el (tramp-reporter-dump-variable) (tramp-append-tramp-buffers): * lisp/net/tramp-compat.el (tramp-compat-process-running-p): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name) (tramp-gvfs-get-file-attributes) (tramp-gvfs-handle-file-attributes) (tramp-gvfs-monitor-process-filter) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec-entry) (tramp-gvfs-mount-spec, tramp-gvfs-maybe-open-connection): * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls) (tramp-do-file-attributes-with-stat) (tramp-sh-handle-file-selinux-context) (tramp-sh-handle-directory-files-and-attributes) (tramp-do-directory-files-and-attributes-with-stat) (tramp-sh-handle-file-name-all-completions) (tramp-sh-handle-dired-compress-file) (tramp-sh-handle-insert-directory) (tramp-sh-handle-expand-file-name) (tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-sh-handle-write-region) (tramp-sh-handle-file-notify-add-watch) (tramp-sh-gio-monitor-process-filter) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter) (tramp-sh-handle-file-system-info, tramp-maybe-send-script) (tramp-find-executable, tramp-open-shell, tramp-find-shell) (tramp-open-connection-setup-interactive-shell) (tramp-find-inline-encoding, tramp-call-local-coding-command) (tramp-compute-multi-hops, tramp-maybe-open-connection) (tramp-convert-file-attributes) (tramp-make-copy-program-file-name, tramp-get-remote-locale) (tramp-get-test-nt-command, tramp-get-remote-stat) (tramp-get-inline-coding): * lisp/net/tramp-smb.el (tramp-smb-handle-directory-files) (tramp-smb-action-get-acl, tramp-smb-handle-file-attributes) (tramp-smb-handle-file-name-all-completions) (tramp-smb-handle-file-system-info) (tramp-smb-handle-file-writable-p) (tramp-smb-handle-insert-directory) (tramp-smb-handle-make-directory) (tramp-smb-handle-make-directory-internal) (tramp-smb-handle-start-file-process, tramp-smb-get-localname) (tramp-smb-read-file-entry): Use `string-match-p' and `looking-at-p'. Remove superfluous `save-match-data'. Apply `eval-when-compile' on constant concat data. * lisp/net/tramp-compat.el (tramp-compat-file-name-quoted-p-p): Use `string-prefix-p'. (tramp-compat-file-name-unquote): Do not use match data.
2018-12-06 16:00:05 +01:00
(when (and (string-match-p "davs?" method)
(string-equal localname "/"))
(tramp-user-error vec "Filename must contain a WebDAV share"))
(when (and (string-equal method "smb")
(string-equal localname "/"))
(tramp-user-error vec "Filename must contain a Windows share"))
(when (member method tramp-goa-methods)
;; Ensure that GNOME Online Accounts are cached.
(tramp-get-goa-accounts vec)
(when (tramp-get-connection-property
(tramp-get-goa-account vec) "FilesDisabled" t)
(tramp-user-error
vec "There is no Online Account `%s'"
(tramp-make-tramp-file-name vec 'noloc))))
(with-tramp-progress-reporter
vec 3
(if (zerop (length user))
(format "Opening connection for %s using %s" host method)
(format "Opening connection for %s@%s using %s" user host method))
;; Enable `auth-source'.
(tramp-set-connection-property
vec "first-password-request" tramp-cache-read-persistent-data)
;; There will be a callback of "askPassword" when a password is needed.
(dbus-register-method
:session dbus-service-emacs object-path
tramp-gvfs-interface-mountoperation "askPassword"
#'tramp-gvfs-handler-askpassword)
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(dbus-register-method
:session dbus-service-emacs object-path
tramp-gvfs-interface-mountoperation "AskPassword"
#'tramp-gvfs-handler-askpassword)
;; There could be a callback of "askQuestion" when adding
;; fingerprints or checking certificates.
(dbus-register-method
:session dbus-service-emacs object-path
tramp-gvfs-interface-mountoperation "askQuestion"
#'tramp-gvfs-handler-askquestion)
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(dbus-register-method
:session dbus-service-emacs object-path
tramp-gvfs-interface-mountoperation "AskQuestion"
#'tramp-gvfs-handler-askquestion)
;; The call must be asynchronously, because of the "askPassword"
;; or "askQuestion" callbacks.
Rework Tramp wrt string-match-p, looking-at-p, save-match-data * lisp/net/tramp.el (tramp-find-method, tramp-find-user) (tramp-find-host, tramp-dissect-file-name, tramp-make-tramp-file-name) (tramp-completion-make-tramp-file-name, tramp-debug-message) (tramp-message, tramp-progress-reporter-update) (tramp-set-completion-function) (tramp-rfn-eshadow-update-overlay) (tramp-find-file-name-coding-system-alist) (tramp-file-name-for-operation) (tramp-use-absolute-autoload-file-names) (tramp-get-completion-methods, tramp-get-completion-user-host) (tramp-handle-directory-files) (tramp-handle-file-name-case-insensitive-p) (tramp-handle-file-name-completion, tramp-handle-file-truename) (tramp-handle-insert-directory, tramp-handle-load) (tramp-handle-shell-command, tramp-action-yesno) (tramp-action-yn, tramp-process-actions) (tramp-mode-string-to-int, tramp-get-local-locale) (tramp-local-host-p): * lisp/net/tramp-adb.el (tramp-adb-handle-file-system-info) (tramp-adb-handle-directory-files-and-attributes) (tramp-adb--gnu-switches-to-ash, tramp-adb-sh-fix-ls-output) (tramp-adb-handle-file-name-all-completions) (tramp-adb-handle-shell-command) (tramp-adb-handle-start-file-process): * lisp/net/tramp-archive.el (tramp-archive-dissect-file-name): * lisp/net/tramp-cache.el (tramp-get-hash-table) (tramp-flush-directory-properties, tramp-flush-file-function): * lisp/net/tramp-cmds.el (tramp-reporter-dump-variable) (tramp-append-tramp-buffers): * lisp/net/tramp-compat.el (tramp-compat-process-running-p): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name) (tramp-gvfs-get-file-attributes) (tramp-gvfs-handle-file-attributes) (tramp-gvfs-monitor-process-filter) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec-entry) (tramp-gvfs-mount-spec, tramp-gvfs-maybe-open-connection): * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls) (tramp-do-file-attributes-with-stat) (tramp-sh-handle-file-selinux-context) (tramp-sh-handle-directory-files-and-attributes) (tramp-do-directory-files-and-attributes-with-stat) (tramp-sh-handle-file-name-all-completions) (tramp-sh-handle-dired-compress-file) (tramp-sh-handle-insert-directory) (tramp-sh-handle-expand-file-name) (tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-sh-handle-write-region) (tramp-sh-handle-file-notify-add-watch) (tramp-sh-gio-monitor-process-filter) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter) (tramp-sh-handle-file-system-info, tramp-maybe-send-script) (tramp-find-executable, tramp-open-shell, tramp-find-shell) (tramp-open-connection-setup-interactive-shell) (tramp-find-inline-encoding, tramp-call-local-coding-command) (tramp-compute-multi-hops, tramp-maybe-open-connection) (tramp-convert-file-attributes) (tramp-make-copy-program-file-name, tramp-get-remote-locale) (tramp-get-test-nt-command, tramp-get-remote-stat) (tramp-get-inline-coding): * lisp/net/tramp-smb.el (tramp-smb-handle-directory-files) (tramp-smb-action-get-acl, tramp-smb-handle-file-attributes) (tramp-smb-handle-file-name-all-completions) (tramp-smb-handle-file-system-info) (tramp-smb-handle-file-writable-p) (tramp-smb-handle-insert-directory) (tramp-smb-handle-make-directory) (tramp-smb-handle-make-directory-internal) (tramp-smb-handle-start-file-process, tramp-smb-get-localname) (tramp-smb-read-file-entry): Use `string-match-p' and `looking-at-p'. Remove superfluous `save-match-data'. Apply `eval-when-compile' on constant concat data. * lisp/net/tramp-compat.el (tramp-compat-file-name-quoted-p-p): Use `string-prefix-p'. (tramp-compat-file-name-unquote): Do not use match data.
2018-12-06 16:00:05 +01:00
(if (string-match-p "(so)$" tramp-gvfs-mountlocation-signature)
Major rewrite due to changed D-Bus interface of GVFS 1.14. * 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.
2013-03-09 12:06:23 +01:00
(with-tramp-dbus-call-method vec nil
:session tramp-gvfs-service-daemon tramp-gvfs-path-mounttracker
tramp-gvfs-interface-mounttracker tramp-gvfs-mountlocation
(tramp-gvfs-mount-spec vec)
`(:struct :string ,(dbus-get-unique-name :session)
:object-path ,object-path))
(with-tramp-dbus-call-method vec nil
:session tramp-gvfs-service-daemon tramp-gvfs-path-mounttracker
tramp-gvfs-interface-mounttracker tramp-gvfs-mountlocation
(tramp-gvfs-mount-spec vec)
:string (dbus-get-unique-name :session) :object-path object-path))
;; We must wait, until the mount is applied. This will be
;; indicated by the "mounted" signal, i.e. the "fuse-mountpoint"
;; file property.
(with-timeout
Sync with Tramp repository * doc/misc/tramp.texi (Configuration): Note, that Tramp must be required prior changing its configuration. (Connection caching, Predefined connection information) (Remote shell setup): Fix typos. (Predefined connection information): Describe, how to overwrite parameters of `tramp-methods'. (Remote programs, Remote processes, Traces and Profiles): Simplify example. (Remote programs): Remove superfluous comment. * doc/misc/trampver.texi: Update release number. * lisp/net/tramp-cache.el (tramp-connection-properties): Adapt docstring. * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file): New defun. (tramp-gvfs-handle-copy-file, tramp-gvfs-handle-rename-file): Use it. (tramp-gvfs-handle-make-directory): Reimplement PARENTS handling, "gvfs-mkdir -p ..." does not work robust. (tramp-gvfs-maybe-open-connection): Adapt `tramp-get-method-parameter' call. * lisp/net/tramp-sh.el (tramp-methods): Add `tramp-remote-shell-login' parameter where it fits. (tramp-get-remote-path): Use it. (tramp-make-copy-program-file-name): Fix quoting for "psftp" method. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/tramp.el (tramp-methods): Adapt docstring. (tramp-get-method-parameter): Replace argument METHOD by VEC. Check also for hits in `tramp-connection-properties'. Adapt docstring. (tramp-get-remote-tmpdir): Cache only the local name of tmpdir. (all): Adapt `tramp-get-method-parameter' calls. * lisp/net/trampver.el Update release number. * test/automated/tramp-tests.el (tramp--instrument-test-case): Add "^make-symbolic-link not supported$" to `debug-ignored-errors'. (tramp-test13-make-directory, tramp--test-adb-p) (tramp--test-smb-or-windows-nt-p): Simplify. (tramp--test-ftp-p, tramp--test-gvfs-p): New defuns. (tramp--test-special-characters): Fix docstring. Add gvfs and ftp tests. (tramp--test-utf8): Fix docstring.
2015-07-21 14:59:18 +02:00
((or (tramp-get-method-parameter vec 'tramp-connection-timeout)
tramp-connection-timeout)
(if (zerop (length (tramp-file-name-user vec)))
(tramp-error
vec 'file-error
"Timeout reached mounting %s using %s" host method)
2009-06-22 21:04:49 +00:00
(tramp-error
vec 'file-error
"Timeout reached mounting %s@%s using %s" user host method)))
(while (not (tramp-get-file-property vec "/" "fuse-mountpoint" nil))
(read-event nil nil 0.1)))
;; If `tramp-gvfs-handler-askquestion' has returned "No", it
;; is marked with the fuse-mountpoint "/". We shall react.
(when (string-equal
(tramp-get-file-property vec "/" "fuse-mountpoint" "") "/")
(tramp-error vec 'file-error "FUSE mount denied"))
;; Save the password.
(ignore-errors
(and (functionp tramp-password-save-function)
(funcall tramp-password-save-function)))
;; Mark it as connected.
(tramp-set-connection-property
Rearrange detecting remote uid and gid in Tramp * 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-rclone.el (tramp-rclone-file-name-handler-alist): * lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist): Add `tramp-get-remote-gid' and 'tramp-get-remote-uid'. * lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler-alist): Add `file-ownership-preserved-p'. (tramp-crypt-add-directory): Check, that NAME is not quoted. (tramp-crypt-handle-file-ownership-preserved-p): New defun. (tramp-crypt-handle-insert-directory): Fix docstring. * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add `tramp-get-remote-gid' and 'tramp-get-remote-uid'. (tramp-gvfs-handle-file-readable-p): Call `tramp-get-remote-uid'. (tramp-gvfs-handle-get-remote-uid) (tramp-gvfs-handle-get-remote-gid): Rename from `tramp-gvfs-get-remote-{uid,gid}'. Do not cache result. (tramp-gvfs-maybe-open-connection): No special handling for remote uid and gid. * lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist): Add `tramp-get-remote-gid' and 'tramp-get-remote-uid'. (tramp-sh-handle-get-remote-uid, tramp-sh-handle-get-remote-gid): Rename from `tramp-get-remote-{uid,gid}'. Do not cache result. (tramp-sh-handle-file-ownership-preserved-p): Distinguish by GROUP when caching. * lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler-alist): Add `tramp-get-remote-gid' and 'tramp-get-remote-uid'. (tramp-sudoedit-handle-get-remote-uid) (tramp-sudoedit-handle-get-remote-gid): Rename from `tramp-sudoedit-get-remote-{uid,gid}'. Do not cache result. (tramp-sudoedit-handle-set-file-uid-gid) (tramp-sudoedit-handle-write-region): Call `tramp-get-remote-uid' and `tramp-get-remote-gid'. (tramp-sudoedit-maybe-open-connection): No special handling for remote uid and gid. * lisp/net/tramp.el (tramp-file-name-for-operation): Add `tramp-get-remote-gid' and 'tramp-get-remote-uid'. (tramp-handle-write-region, tramp-check-cached-permissions): Call `tramp-get-remote-uid' and `tramp-get-remote-gid'. (tramp-get-remote-uid, tramp-get-remote-gid): New defuns. (tramp-local-host-p): Simplify `tramp-get-remote-uid' call. * test/lisp/net/tramp-tests.el (tramp-test17-dired-with-wildcards) Skip if needed.
2020-06-14 15:31:17 +02:00
(tramp-get-connection-process vec) "connected" t)))))
2009-06-22 21:04:49 +00:00
(defun tramp-gvfs-gio-tool-p (vec)
"Check, whether the gio tool is available."
(with-tramp-connection-property vec "gio-tool"
(zerop (tramp-call-process vec "gio" nil nil nil "version"))))
(defun tramp-gvfs-send-command (vec command &rest args)
"Send the COMMAND with its ARGS to connection VEC.
COMMAND is a command from the gvfs-* utilities. It is replaced
by the corresponding gio tool call if available. `call-process'
is applied, and it returns t if the return code is zero."
Sync with Tramp repository. * lisp/net/tramp-adb.el (tramp-adb-handle-start-file-process): * lisp/net/tramp-sh.el (tramp-sh-handle-start-file-process) * lisp/net/tramp-smb.el (tramp-smb-handle-start-file-process): Create BUFFER if it doesn't exist. Reported by Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com>. * lisp/net/tramp-gvfs.el (tramp-gvfs-file-attributes) (tramp-gvfs-file-attributes-with-gvfs-ls-regexp) (tramp-gvfs-file-attributes-with-gvfs-info-regexp): New defconst. (tramp-gvfs-get-directory-attributes) (tramp-gvfs-get-root-attributes) (tramp-gvfs-get-file-attributes): New defun. (tramp-gvfs-handle-file-attributes) (tramp-gvfs-handle-file-name-all-completions): Use them. (tramp-gvfs-handle-file-directory-p): Use `file-truename'. (tramp-gvfs-maybe-open-connection): Set :noquery flag for process. (tramp-gvfs-send-command): Add locale settings to `process-environment'. (top): Suppress D-Bus error messages during zeroconf initialization. * lisp/net/tramp.el (tramp-unknown-id-string) (tramp-unknown-id-integer): New defconst. (tramp-check-cached-permissions) * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-attributes) * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls) (tramp-convert-file-attributes, tramp-get-remote-uid) (tramp-get-remote-gid): Use them. * lisp/net/tramp-sh.el (tramp-display-escape-sequence-regexp): Rename from `tramp-color-escape-sequence-regexp'. (tramp-sh-handle-insert-directory) (tramp-convert-file-attributes): Adapt callees. (tramp-device-escape-sequence-regexp): New defconst. (tramp-wait-for-output): Use it. Reported by Matthías Páll Gissurarson <icetritlo@gmail.com>. * lisp/net/tramp-smb.el (tramp-smb-handle-file-name-all-completions): Simplify. * test/lisp/net/tramp-tests.el (tramp-test26-process-file) (tramp-test28-shell-command): Use `tramp-display-escape-sequence-regexp'.
2016-05-28 12:14:58 +02:00
(let* ((locale (tramp-get-local-locale vec))
(process-environment
(append
`(,(format "LANG=%s" locale)
,(format "LANGUAGE=%s" locale)
,(format "LC_ALL=%s" locale))
process-environment)))
(when (tramp-gvfs-gio-tool-p vec)
;; Use gio tool.
(setq args (cons (cdr (assoc command tramp-gvfs-gio-mapping))
(delq nil args))
command "gio"))
Sync with Tramp repository. * lisp/net/tramp-adb.el (tramp-adb-handle-start-file-process): * lisp/net/tramp-sh.el (tramp-sh-handle-start-file-process) * lisp/net/tramp-smb.el (tramp-smb-handle-start-file-process): Create BUFFER if it doesn't exist. Reported by Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com>. * lisp/net/tramp-gvfs.el (tramp-gvfs-file-attributes) (tramp-gvfs-file-attributes-with-gvfs-ls-regexp) (tramp-gvfs-file-attributes-with-gvfs-info-regexp): New defconst. (tramp-gvfs-get-directory-attributes) (tramp-gvfs-get-root-attributes) (tramp-gvfs-get-file-attributes): New defun. (tramp-gvfs-handle-file-attributes) (tramp-gvfs-handle-file-name-all-completions): Use them. (tramp-gvfs-handle-file-directory-p): Use `file-truename'. (tramp-gvfs-maybe-open-connection): Set :noquery flag for process. (tramp-gvfs-send-command): Add locale settings to `process-environment'. (top): Suppress D-Bus error messages during zeroconf initialization. * lisp/net/tramp.el (tramp-unknown-id-string) (tramp-unknown-id-integer): New defconst. (tramp-check-cached-permissions) * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-attributes) * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls) (tramp-convert-file-attributes, tramp-get-remote-uid) (tramp-get-remote-gid): Use them. * lisp/net/tramp-sh.el (tramp-display-escape-sequence-regexp): Rename from `tramp-color-escape-sequence-regexp'. (tramp-sh-handle-insert-directory) (tramp-convert-file-attributes): Adapt callees. (tramp-device-escape-sequence-regexp): New defconst. (tramp-wait-for-output): Use it. Reported by Matthías Páll Gissurarson <icetritlo@gmail.com>. * lisp/net/tramp-smb.el (tramp-smb-handle-file-name-all-completions): Simplify. * test/lisp/net/tramp-tests.el (tramp-test26-process-file) (tramp-test28-shell-command): Use `tramp-display-escape-sequence-regexp'.
2016-05-28 12:14:58 +02:00
(with-current-buffer (tramp-get-connection-buffer vec)
(tramp-gvfs-maybe-open-connection vec)
(erase-buffer)
(or (zerop (apply #'tramp-call-process vec command nil t nil args))
;; Remove information about mounted connection.
Extend tramp-cache.el interface * lisp/net/tramp.el (tramp-handle-add-name-to-file) (tramp-handle-dired-uncache): * lisp/net/tramp-adb.el (tramp-adb-handle-make-directory) (tramp-adb-handle-delete-directory, tramp-adb-handle-delete-file) (tramp-adb-handle-write-region, tramp-adb-handle-set-file-modes) (tramp-adb-handle-set-file-times, tramp-adb-handle-copy-file) (tramp-adb-handle-rename-file, tramp-adb-handle-process-file) (tramp-adb-handle-start-file-process, tramp-adb-get-device) (tramp-adb-maybe-open-connection): * lisp/net/tramp-cache.el (tramp-flush-file-properties) (tramp-flush-directory-properties, tramp-flush-file-function): * lisp/net/tramp-cmds.el (tramp-cleanup-connection): * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file) (tramp-gvfs-handle-delete-directory, tramp-gvfs-handle-delete-file) (tramp-gvfs-handle-file-system-info, tramp-gvfs-handle-make-directory) (tramp-gvfs-handle-write-region, tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-send-command): * lisp/net/tramp-sh.el (tramp-sh-handle-make-symbolic-link) (tramp-sh-handle-set-file-modes, tramp-sh-handle-set-file-times) (tramp-sh-handle-set-file-selinux-context, tramp-sh-handle-set-file-acl) (tramp-sh-handle-add-name-to-file, tramp-sh-handle-copy-directory) (tramp-do-copy-or-rename-file, tramp-do-copy-or-rename-file-out-of-band) (tramp-sh-handle-make-directory, tramp-sh-handle-delete-directory) (tramp-sh-handle-delete-file, tramp-sh-handle-dired-compress-file) (tramp-process-sentinel, tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-sh-handle-write-region): * lisp/net/tramp-smb.el (tramp-smb-handle-add-name-to-file) (tramp-smb-handle-copy-directory, tramp-smb-handle-copy-file) (tramp-smb-handle-delete-directory, tramp-smb-handle-delete-file) (tramp-smb-handle-file-acl, tramp-smb-handle-make-directory-internal) (tramp-smb-handle-make-symbolic-link, tramp-smb-handle-process-file) (tramp-smb-handle-rename-file, tramp-smb-handle-set-file-acl) (tramp-smb-handle-set-file-modes, tramp-smb-handle-start-file-process) (tramp-smb-handle-write-region, tramp-smb-maybe-open-connection): Use them. * lisp/net/tramp-cache.el (tramp-flush-file-properties) (tramp-flush-directory-properties, tramp-flush-connection-properties): Rename from `tramp-flush-file-property',`tramp-flush-directory-property' and `tramp-flush-connection-property', respectively. (tramp-flush-file-property, tramp-flush-connection-property): New defuns.
2017-12-12 15:46:17 +01:00
(and (tramp-flush-file-properties vec "/") nil)))))
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
;; GNOME Online Accounts functions.
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
(defun tramp-get-goa-account (vec)
"Transform VEC into a `tramp-goa-account' structure."
(when (tramp-file-name-p vec)
(make-tramp-goa-account
:method (tramp-file-name-method vec)
:user (tramp-file-name-user vec)
:host (tramp-file-name-host vec)
:port (tramp-file-name-port vec))))
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
(defun tramp-get-goa-accounts (vec)
"Retrieve GNOME Online Accounts, and cache them.
The hash key is a `tramp-goa-account' structure. The value is an
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
alist of the properties of `tramp-goa-interface-account' and
`tramp-goa-interface-files' of the corresponding GNOME Online
Account. Additionally, a property \"prefix\" is added.
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
VEC is used only for traces."
(with-tramp-connection-property nil "goa-accounts"
(dolist
(object-path
(mapcar
#'car
(tramp-dbus-function
vec #'dbus-get-all-managed-objects
`(:session ,tramp-goa-service ,tramp-goa-path))))
(let* ((account-properties
(with-tramp-dbus-get-all-properties vec
:session tramp-goa-service object-path
tramp-goa-interface-account))
(files-properties
(with-tramp-dbus-get-all-properties vec
:session tramp-goa-service object-path
tramp-goa-interface-files))
(identity
(or (cdr (assoc "PresentationIdentity" account-properties)) ""))
key)
;; Only accounts which matter.
(when (and
(not (cdr (assoc "FilesDisabled" account-properties)))
(member
(cdr (assoc "ProviderType" account-properties))
'("google" "owncloud"))
(string-match tramp-goa-identity-regexp identity))
(setq key (make-tramp-goa-account
:method (cdr (assoc "ProviderType" account-properties))
:user (match-string 1 identity)
:host (match-string 2 identity)
:port (match-string 3 identity)))
(when (string-equal (tramp-goa-account-method key) "google")
(setf (tramp-goa-account-method key) "gdrive"))
(when (string-equal (tramp-goa-account-method key) "owncloud")
(setf (tramp-goa-account-method key) "nextcloud"))
;; Cache all properties.
(dolist (prop (nconc account-properties files-properties))
(tramp-set-connection-property key (car prop) (cdr prop)))
;; Cache "prefix".
(tramp-message
vec 10 "%s prefix %s" key
(tramp-set-connection-property
key "prefix"
(directory-file-name
(url-filename
(url-generic-parse-url
(tramp-get-connection-property key "Uri" "file:///")))))))))
;; Mark, that goa accounts have been cached.
"cached"))
Add new Tramp connection method "owncloud" * doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly. (Using GNOME Online Accounts based methods): Rename from "Using Google Drive". Add `owncloud'. (GVFS based methods): Add `owncloud'. * etc/NEWS: Add Tramp connection method "owncloud". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud". Remove goa methods if not supported. (tramp-goa-methods, tramp-goa-service, tramp-goa-path) (tramp-goa-path-accounts, tramp-goa-interface-documents) (tramp-goa-interface-printers, tramp-goa-interface-files) (tramp-goa-interface-contacts, tramp-goa-interface-calendar) (tramp-goa-interface-oauth2based) (tramp-goa-interface-account, tramp-goa-identity-regexp) (tramp-goa-interface-mail, tramp-goa-interface-chat) (tramp-goa-interface-photos, tramp-goa-path-manager) (tramp-goa-interface-documents) (tramp-gvfs-owncloud-default-prefix) (tramp-gvfs-owncloud-default-prefix-regexp): New defconst. (tramp-goa-name): New defstruct. (tramp-gvfs-stringify-dbus-message): Handle all consp messages. (tramp-dbus-function, tramp-gvfs-get-remote-prefix) (tramp-get-goa-accounts): New defun. (with-tramp-dbus-call-method): Use it. (with-tramp-dbus-get-all-properties): New defmacro. (tramp-gvfs-url-file-name) (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Map between "owncloud" and "davs". (tramp-gvfs-maybe-open-connection): Set "vector" connection property. * test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion): Suppress run in tests. (tramp--test-owncloud-p): New defun. (tramp-test11-copy-file, tramp-test12-rename-file): Use it.
2018-01-05 21:04:39 +01:00
(defun tramp-parse-goa-accounts (service)
"Return a list of (user host) tuples allowed to access.
It checks for registered GNOME Online Accounts."
;; SERVICE might be encoded as a DNS-SD service.
(and (string-match tramp-dns-sd-service-regexp service)
(setq service (match-string 1 service)))
(mapcar
(lambda (key)
(and (tramp-goa-account-p key)
(string-equal service (tramp-goa-account-method key))
(list (tramp-goa-account-user key)
(tramp-goa-account-host key))))
(hash-table-keys tramp-cache-data)))
;; Media devices functions.
(defun tramp-get-media-device (vec)
"Transform VEC into a `tramp-media-device' structure.
Check, that respective cache values do exist."
(if-let ((media (tramp-get-connection-property vec "media-device" nil))
(prop (tramp-get-connection-property media "vector" nil)))
media
(tramp-get-media-devices vec)
(tramp-get-connection-property vec "media-device" nil)))
(defun tramp-get-media-devices (vec)
"Retrieve media devices, and cache them.
The hash key is a `tramp-media-device' structure.
VEC is used only for traces."
(let (devices)
(dolist (method tramp-media-methods)
(dolist (volume (cadr (with-tramp-dbus-call-method vec t
:session (tramp-gvfs-service-volumemonitor method)
tramp-gvfs-path-remotevolumemonitor
tramp-gvfs-interface-remotevolumemonitor "List")))
(let* ((uri (url-generic-parse-url (nth 5 volume)))
(vec (make-tramp-file-name
:method "mtp"
;; A host name cannot contain spaces.
:host (tramp-compat-string-replace " " "_" (nth 1 volume))))
(media (make-tramp-media-device
:method method
:host (tramp-gvfs-url-host (nth 5 volume))
:port (and (url-portspec uri)
(number-to-string (url-portspec uri))))))
(push (tramp-file-name-host vec) devices)
(tramp-set-connection-property vec "activation-uri" (nth 5 volume))
(tramp-set-connection-property vec "media-device" media)
(tramp-set-connection-property media "vector" vec))))
;; Adapt default host name, supporting /mtp:: when possible.
(setq tramp-default-host-alist
(append
`(("mtp" nil ,(if (= (length devices) 1) (car devices) "")))
(delete
(assoc "mtp" tramp-default-host-alist)
tramp-default-host-alist)))))
(defun tramp-parse-media-names (service)
"Return a list of (user host) tuples allowed to access.
It checks for mounted media devices."
;; SERVICE might be encoded as a DNS-SD service.
(and (string-match tramp-dns-sd-service-regexp service)
(setq service (match-string 1 service)))
(mapcar
(lambda (key)
(and (tramp-media-device-p key)
(string-equal service (tramp-media-device-method key))
(tramp-get-connection-property key "vector" nil)
(list nil (tramp-file-name-host
(tramp-get-connection-property key "vector" nil)))))
(hash-table-keys tramp-cache-data)))
2009-06-22 21:04:49 +00:00
;; D-Bus zeroconf functions.
(defun tramp-zeroconf-parse-device-names (service)
2009-06-22 21:04:49 +00:00
"Return a list of (user host) tuples allowed to access."
(mapcar
(lambda (x)
(let ((host (zeroconf-service-host x))
(port (zeroconf-service-port x))
(text (zeroconf-service-txt x))
user)
(when port
(setq host (format "%s%s%d" host tramp-prefix-port-regexp port)))
;; A user is marked in a TXT field like "u=guest".
(while text
(when (string-match "u=\\(.+\\)$" (car text))
(setq user (match-string 1 (car text))))
(setq text (cdr text)))
(list user host)))
(zeroconf-list-services service)))
(defun tramp-gvfs-parse-device-names (service)
"Return a list of (user host) tuples allowed to access.
This uses \"avahi-browse\" in case D-Bus is not enabled in Avahi."
(let ((result
(ignore-errors
Tramp requires Emacs 24.4 * doc/misc/tramp.texi (Frequently Asked Questions): Use `with-eval-after-load'. in example. * doc/misc/trampver.texi: Set variable emacsver. * lisp/net/tramp.el (tramp-send-string, tramp-call-process) (tramp-call-process-region, tramp-process-lines): * lisp/net/tramp-adb.el (tramp-adb-handle-file-truename) (tramp-adb-sh-fix-ls-output, tramp-adb-maybe-open-connection): * lisp/net/tramp-gvfs.el (tramp-gvfs-get-directory-attributes) (tramp-gvfs-handle-file-notify-add-watch) * lisp/net/tramp-sh.el (tramp-sh-handle-file-truename) (tramp-do-copy-or-rename-file-out-of-band) (tramp-sh-handle-file-notify-add-watch, tramp-find-executable) (tramp-set-remote-path) (tramp-open-connection-setup-interactive-shell) (tramp-maybe-open-connection, tramp-send-command): * 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) (tramp-smb-maybe-open-connection): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-set-file-acl): (tramp-sudoedit-send-command): Use `string-join' and `string-empty-p'. * lisp/net/tramp-adb.el: * lisp/net/tramp-archive.el: * lisp/net/tramp-integration.el: * lisp/net/tramp-ftp.el: Use `with-eval-after-load'. * lisp/net/tramp-cmds.el (tramp-cleanup-connection) (tramp-cleanup-all-connections): Cancel timer. * lisp/net/tramp-compat.el (subr-x): Require. (default-toplevel-value): Don't make it a defalias. * lisp/net/tramp-gvfs.el: Use `dbus-event-error-functions'. Do not special handle `split-string'. * lisp/net/tramp.el: Require Emacs 24.4. (tramp-password-prompt-regexp): Use `password-word-equivalents'. (tramp-user-error): Use `user-error'. (tramp-replace-environment-variables): Use `substitute-env-vars'. (tramp-wait-for-regexp): Rearrange `with-current-buffer' call. (tramp-get-local-gid): Use `group-gid'. * lisp/net/trampver.el: Check for Emacs 24.4. * test/lisp/net/tramp-tests.el (tramp-test02-file-name-dissect) (tramp-test02-file-name-dissect-simplified) (tramp-test02-file-name-dissect-separate) (tramp-test03-file-name-host-rules) (tramp-test03-file-name-method-rules): Don't check for `user-error'.
2019-06-28 16:32:12 +02:00
(split-string
(shell-command-to-string (format "avahi-browse -trkp %s" service))
"[\n\r]+" 'omit "^\\+;.*$"))))
Remove XEmacs compatibility in Tramp * doc/misc/tramp.texi: Replace flags by their hard coded name. Remove unused flags and the enclosed alternative text for XEmacs. * doc/misc/trampver.texi: Use "Tramp" CamelCase. Rename "emacs" and "xemacs" flags to "unified" and "separate". Remove flags "emacsgw", "emacsname", "emacsdir", "ftppackagename", "emacsothername", "emacsotherdir" and "emacsotherfilename". (trampver): * lisp/net/trampver.el (tramp-version): Set to "2.3.0-pre". * lisp/net/tramp.el (bkup-backup-directory-info) (directory-sep-char, ls-lisp-use-insert-directory-program) (outline-regexp, tramp-backup-directory-alist) (tramp-default-method, tramp-shell-prompt-pattern, tramp-syntax) (tramp-file-name-regexp-unified) (tramp-file-name-regexp-separate) (tramp-completion-file-name-regexp-unified) (tramp-completion-file-name-regexp-separate, tramp-chunksize) (tramp-get-method-parameter, tramp-find-method, tramp-find-user) (tramp-debug-message, tramp-progress-reporter-update) (with-tramp-progress-reporter) (tramp-rfn-eshadow-setup-minibuffer) (rfn-eshadow-setup-minibuffer-hook, tramp-unload-hook) (tramp-rfn-eshadow-update-overlay) (rfn-eshadow-update-overlay-hook, tramp-default-file-modes) (tramp-file-name-for-operation) (tramp-completion-file-name-handler) (tramp-autoload-file-name-handler, tramp-completion-mode-p) (tramp-handle-directory-files) (tramp-handle-directory-files-and-attributes) (tramp-handle-dired-uncache, tramp-handle-find-backup-file-name) (tramp-handle-insert-file-contents, tramp-handle-load) (tramp-handle-shell-command) (tramp-handle-verify-visited-file-modtime) (tramp-handle-file-notify-valid-p, tramp-accept-process-output) (tramp-check-for-regexp, tramp-wait-for-regexp) (tramp-send-string, tramp-mode-string-to-int) (tramp-get-local-gid, tramp-check-cached-permissions) (tramp-get-remote-tmpdir, tramp-make-tramp-temp-file) (auto-save-file-name-transforms) (tramp-handle-make-auto-save-file-name, tramp-read-passwd) (tramp-clear-passwd, tramp-time-diff): * lisp/net/tramp-adb.el (directory-listing-before-filename-regexp) (directory-sep-char, tramp-adb-file-name-handler-alist) (tramp-adb-parse-device-names) (tramp-adb-handle-expand-file-name) (tramp-adb-handle-file-truename, tramp-adb--gnu-switches-to-ash) (tramp-adb-handle-file-local-copy) (tramp-adb-handle-write-region, tramp-adb-handle-set-file-modes) (tramp-adb-handle-rename-file, tramp-adb-handle-process-file) (tramp-adb-handle-shell-command) (tramp-adb-handle-start-file-process, tramp-adb-get-device) (tramp-adb-maybe-open-connection): * lisp/net/tramp-cache.el (tramp-persistency-file-name) (tramp-cache-print): * lisp/net/tramp-cmds.el (tramp-cleanup-all-connections) (tramp-bug, tramp-reporter-dump-variable) (tramp-load-report-modules, tramp-append-tramp-buffers): * lisp/net/tramp-compat.el (tramp-compat-funcall) (tramp-advice-file-expand-wildcards) (tramp-compat-temporary-file-directory) (tramp-compat-make-temp-file, tramp-compat-copy-file) (tramp-compat-delete-directory, ) (tramp-compat-process-running-p): * lisp/net/tramp-ftp.el (tramp-methods) <ftp>: (tramp-default-method-alist, tramp-foreign-file-name-handler-alist): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) (tramp-gvfs-do-copy-or-rename-file, tramp-gvfs-handle-copy-file) (tramp-gvfs-handle-file-local-copy) (tramp-gvfs-handle-file-name-all-completions) (tramp-gvfs-handle-file-notify-add-watch) (tramp-gvfs-monitor-file-process-filter) (tramp-gvfs-handle-file-readable-p) (tramp-gvfs-handle-rename-file, tramp-gvfs-handle-write-region) (tramp-gvfs-file-name, tramp-gvfs-handler-askquestion) (tramp-gvfs-maybe-open-connection) (tramp-gvfs-parse-device-names): * lisp/net/tramp-gw.el (tramp-gw-aux-proc-sentinel) (tramp-gw-open-connection, tramp-gw-open-network-stream): * lisp/net/tramp-sh.el (directory-sep-char) (tramp-sh-file-name-handler-alist) (tramp-sh-handle-file-truename) (tramp-sh-handle-set-visited-file-modtime) (tramp-sh-handle-verify-visited-file-modtime) (tramp-sh-handle-set-file-modes, tramp-sh-handle-set-file-times) (tramp-sh-handle-file-acl) (tramp-sh-handle-file-name-all-completions) (tramp-sh-handle-copy-file, tramp-sh-handle-rename-file) (tramp-do-copy-or-rename-file-directly) (tramp-do-copy-or-rename-file-out-of-band) (dired-compress-file-suffixes, dired-remove-file) (tramp-sh-handle-dired-compress-file) (tramp-sh-handle-insert-directory) (tramp-sh-handle-expand-file-name) (tramp-sh-handle-start-file-process) (tramp-sh-handle-process-file, tramp-sh-handle-file-local-copy) (tramp-sh-handle-write-region, tramp-sh-handle-vc-registered) (tramp-sh-handle-file-notify-add-watch) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter, tramp-maybe-send-script) (tramp-find-executable) (tramp-open-connection-setup-interactive-shell) (tramp-find-inline-encoding, tramp-compute-multi-hops) (tramp-maybe-open-connection, tramp-convert-file-attributes) (tramp-get-remote-path, tramp-get-remote-touch): * lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist) (tramp-smb-handle-copy-directory, tramp-smb-handle-copy-file) (tramp-smb-handle-delete-directory) (tramp-smb-handle-directory-files, tramp-smb-handle-file-acl) (tramp-smb-handle-make-directory-internal) (tramp-smb-handle-process-file, tramp-smb-handle-rename-file) (tramp-smb-handle-set-file-acl, tramp-smb-handle-set-file-modes) (tramp-smb-handle-write-region, tramp-smb-get-file-entries) (tramp-smb-get-cifs-capabilities) (tramp-smb-maybe-open-connection): * lisp/net/trampver.el (tramp-repository-get-version): Remove XEmacs compat code. * lisp/net/tramp-cmds.el (mml-mode, mml-insert-empty-tag) (reporter-dump-variable): Declare functions. * lisp/net/tramp.el (tramp-bkup-backup-directory-info) (tramp-advice-minibuffer-electric-separator) (tramp-advice-minibuffer-electric-tilde) (tramp-handle-unhandled-file-name-directory): * lisp/net/tramp-compat.el (tramp-compat-with-temp-message) (tramp-compat-font-lock-add-keywords) (tramp-compat-load, tramp-compat-number-sequence) (tramp-compat-split-string, tramp-compat-delete-dups): * lisp/net/tramp-sh.el (tramp-sh-handle-insert-file-contents-literally): Remove. * lisp/net/tramp-sh.el (tramp-methods) <psftp>: This does not work recursively.
2016-01-14 14:12:17 +01:00
(delete-dups
(mapcar
(lambda (x)
(let* ((list (split-string x ";"))
(host (nth 6 list))
Tramp requires Emacs 24.4 * doc/misc/tramp.texi (Frequently Asked Questions): Use `with-eval-after-load'. in example. * doc/misc/trampver.texi: Set variable emacsver. * lisp/net/tramp.el (tramp-send-string, tramp-call-process) (tramp-call-process-region, tramp-process-lines): * lisp/net/tramp-adb.el (tramp-adb-handle-file-truename) (tramp-adb-sh-fix-ls-output, tramp-adb-maybe-open-connection): * lisp/net/tramp-gvfs.el (tramp-gvfs-get-directory-attributes) (tramp-gvfs-handle-file-notify-add-watch) * lisp/net/tramp-sh.el (tramp-sh-handle-file-truename) (tramp-do-copy-or-rename-file-out-of-band) (tramp-sh-handle-file-notify-add-watch, tramp-find-executable) (tramp-set-remote-path) (tramp-open-connection-setup-interactive-shell) (tramp-maybe-open-connection, tramp-send-command): * 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) (tramp-smb-maybe-open-connection): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-set-file-acl): (tramp-sudoedit-send-command): Use `string-join' and `string-empty-p'. * lisp/net/tramp-adb.el: * lisp/net/tramp-archive.el: * lisp/net/tramp-integration.el: * lisp/net/tramp-ftp.el: Use `with-eval-after-load'. * lisp/net/tramp-cmds.el (tramp-cleanup-connection) (tramp-cleanup-all-connections): Cancel timer. * lisp/net/tramp-compat.el (subr-x): Require. (default-toplevel-value): Don't make it a defalias. * lisp/net/tramp-gvfs.el: Use `dbus-event-error-functions'. Do not special handle `split-string'. * lisp/net/tramp.el: Require Emacs 24.4. (tramp-password-prompt-regexp): Use `password-word-equivalents'. (tramp-user-error): Use `user-error'. (tramp-replace-environment-variables): Use `substitute-env-vars'. (tramp-wait-for-regexp): Rearrange `with-current-buffer' call. (tramp-get-local-gid): Use `group-gid'. * lisp/net/trampver.el: Check for Emacs 24.4. * test/lisp/net/tramp-tests.el (tramp-test02-file-name-dissect) (tramp-test02-file-name-dissect-simplified) (tramp-test02-file-name-dissect-separate) (tramp-test03-file-name-host-rules) (tramp-test03-file-name-method-rules): Don't check for `user-error'.
2019-06-28 16:32:12 +02:00
(text (split-string (nth 9 list) "\" \"" 'omit "\""))
user)
;; A user is marked in a TXT field like "u=guest".
(while text
(when (string-match "u=\\(.+\\)$" (car text))
(setq user (match-string 1 (car text))))
(setq text (cdr text)))
(list user host)))
result))))
2009-06-22 21:04:49 +00:00
(when tramp-gvfs-enabled
;; Suppress D-Bus error messages and Tramp traces.
(let (;; Sometimes, it fails with "Variable binding depth exceeds
;; max-specpdl-size". Shall be fixed in Emacs 27.
(max-specpdl-size (* 2 max-specpdl-size))
(tramp-verbose 0)
tramp-gvfs-dbus-event-vector fun)
;; Add completion functions for services announced by DNS-SD.
;; See <http://www.dns-sd.org/ServiceTypes.html> for valid service types.
Sync with Tramp repository. * lisp/net/tramp-adb.el (tramp-adb-handle-start-file-process): * lisp/net/tramp-sh.el (tramp-sh-handle-start-file-process) * lisp/net/tramp-smb.el (tramp-smb-handle-start-file-process): Create BUFFER if it doesn't exist. Reported by Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com>. * lisp/net/tramp-gvfs.el (tramp-gvfs-file-attributes) (tramp-gvfs-file-attributes-with-gvfs-ls-regexp) (tramp-gvfs-file-attributes-with-gvfs-info-regexp): New defconst. (tramp-gvfs-get-directory-attributes) (tramp-gvfs-get-root-attributes) (tramp-gvfs-get-file-attributes): New defun. (tramp-gvfs-handle-file-attributes) (tramp-gvfs-handle-file-name-all-completions): Use them. (tramp-gvfs-handle-file-directory-p): Use `file-truename'. (tramp-gvfs-maybe-open-connection): Set :noquery flag for process. (tramp-gvfs-send-command): Add locale settings to `process-environment'. (top): Suppress D-Bus error messages during zeroconf initialization. * lisp/net/tramp.el (tramp-unknown-id-string) (tramp-unknown-id-integer): New defconst. (tramp-check-cached-permissions) * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-attributes) * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls) (tramp-convert-file-attributes, tramp-get-remote-uid) (tramp-get-remote-gid): Use them. * lisp/net/tramp-sh.el (tramp-display-escape-sequence-regexp): Rename from `tramp-color-escape-sequence-regexp'. (tramp-sh-handle-insert-directory) (tramp-convert-file-attributes): Adapt callees. (tramp-device-escape-sequence-regexp): New defconst. (tramp-wait-for-output): Use it. Reported by Matthías Páll Gissurarson <icetritlo@gmail.com>. * lisp/net/tramp-smb.el (tramp-smb-handle-file-name-all-completions): Simplify. * test/lisp/net/tramp-tests.el (tramp-test26-process-file) (tramp-test28-shell-command): Use `tramp-display-escape-sequence-regexp'.
2016-05-28 12:14:58 +02:00
(zeroconf-init tramp-gvfs-zeroconf-domain)
(when (setq fun (or (and (zeroconf-list-service-types)
#'tramp-zeroconf-parse-device-names)
(and (executable-find "avahi-browse")
#'tramp-gvfs-parse-device-names)))
(when (member "afp" tramp-gvfs-methods)
(tramp-set-completion-function
"afp" `((,fun "_afpovertcp._tcp"))))
(when (member "dav" tramp-gvfs-methods)
(tramp-set-completion-function
"dav" `((,fun "_webdav._tcp")
(,fun "_webdavs._tcp"))))
(when (member "davs" tramp-gvfs-methods)
(tramp-set-completion-function
"davs" `((,fun "_webdav._tcp")
(,fun "_webdavs._tcp"))))
(when (member "ftp" tramp-gvfs-methods)
(tramp-set-completion-function
"ftp" `((,fun "_ftp._tcp"))))
(when (member "http" tramp-gvfs-methods)
(tramp-set-completion-function
"http" `((,fun "_http._tcp")
(,fun "_https._tcp"))))
(when (member "https" tramp-gvfs-methods)
(tramp-set-completion-function
"https" `((,fun "_http._tcp")
(,fun "_https._tcp"))))
(when (member "sftp" tramp-gvfs-methods)
(tramp-set-completion-function
"sftp" `((,fun "_sftp-ssh._tcp")
(,fun "_ssh._tcp")
(,fun "_workstation._tcp"))))
(when (member "smb" tramp-gvfs-methods)
(tramp-set-completion-function
"smb" `((,fun "_smb._tcp")))))
;; Add completion functions for GNOME Online Accounts.
(tramp-get-goa-accounts nil)
(dolist (method tramp-goa-methods)
(when (member method tramp-gvfs-methods)
(tramp-set-completion-function
method `((tramp-parse-goa-accounts ,(format "_%s._tcp" method))))))
;; Add completion functions for media devices.
(tramp-get-media-devices nil)
(tramp-set-completion-function
"mtp"
(mapcar
(lambda (method) `(tramp-parse-media-names ,(format "_%s._tcp" method)))
tramp-media-methods))))
2009-06-22 21:04:49 +00:00
Migrate to Tramp 2.2. Rearrange load dependencies. (Bug#1529, Bug#5448, Bug#5705) * Makefile.in (TRAMP_DIR, TRAMP_SRC): New variables. ($(TRAMP_DIR)/tramp-loaddefs.el): New target. (LOADDEFS): Add $(lisp)/net/tramp-loaddefs.el. * net/tramp.el (top): Remove all other tramp-* loads except tramp-compat.el. Remove all changes to tramp-unload-hook for other tramp-* packages. Rearrange defun order. Change calls of `tramp-compat-call-process', `tramp-compat-decimal-to-octal', `tramp-compat-octal-to-decimal' to new function names. (tramp-terminal-type, tramp-initial-end-of-output) (tramp-methods, tramp-foreign-file-name-handler-alist) (tramp-tramp-file-p, tramp-completion-mode-p) (tramp-send-command-and-check, tramp-get-remote-path) (tramp-get-remote-tmpdir, tramp-get-remote-ln) (tramp-shell-quote-argument): Set tramp-autoload cookie. (with-file-property, with-connection-property): Move to tramp-cache.el. (tramp-local-call-process, tramp-decimal-to-octal) (tramp-octal-to-decimal): Move to tramp-compat.el. (tramp-handle-shell-command): Do not require 'shell. (tramp-compute-multi-hops): No special handling for tramp-gw-* symbols. (tramp-unload-tramp): Do not call `tramp-unload-file-name-handlers'. * net/tramp-cache.el (top): Require 'tramp. Add to `tramp-unload-hook'. (tramp-cache-data, 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-flush-connection-property) (tramp-cache-print, tramp-list-connections): Set tramp-autoload cookie. (with-file-property, with-connection-property): New defuns, moved from tramp.el. (tramp-flush-file-function): Use `with-parsed-tramp-file-name' macro. * net/tramp-cmds.el (top): Add to `tramp-unload-hook'. (tramp-version): Set tramp-autoload cookie. * net/tramp-compat.el (top): Require 'tramp-loaddefs. Remove all changes to tramp-unload-hook for other tramp-* packages. Add to `tramp-unload-hook'. (tramp-compat-decimal-to-octal, tramp-compat-octal-to-decimal) (tramp-compat-call-process): New defuns, moved from tramp.el. * net/tramp-fish.el (top) Require just 'tramp. Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. Change call of `tramp-compat-decimal-to-octal' to new function name. (tramp-fish-method): Make it a defconst. (tramp-fish-file-name-p): Make it a defsubst. (tramp-fish-method, tramp-fish-file-name-handler) (tramp-fish-file-name-p): Set tramp-autoload cookie. * net/tramp-ftp.el (top) Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. (tramp-ftp-method): Make it a defconst. (tramp-ftp-file-name-p): Make it a defsubst. (tramp-ftp-method, tramp-ftp-file-name-handler) (tramp-ftp-file-name-p): Set tramp-autoload cookie. * net/tramp-gvfs.el (top) Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. Change checks, whether package can be loaded. (tramp-gvfs-file-name-p): Make it a defsubst. (tramp-gvfs-methods, tramp-gvfs-file-name-handler) (tramp-gvfs-file-name-p): Set tramp-autoload cookie. (tramp-gvfs-handle-file-directory-p): New defun. (tramp-gvfs-file-name-handler-alist): Use it. * net/tramp-gw.el (top) Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. (tramp-gw-tunnel-method, tramp-gw-default-tunnel-port) (tramp-gw-socks-method, tramp-gw-default-socks-port): Make it a defconst. (tramp-gw-tunnel-method, tramp-gw-socks-method) (tramp-gw-open-connection): Set tramp-autoload cookie. * net/tramp-imap.el (top) Require just 'tramp. Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. Change checks, whether package can be loaded. (tramp-imap-file-name-p): Make it a defsubst. (tramp-imap-method, tramp-imaps-method) (tramp-imap-file-name-handler) (tramp-imap-file-name-p): Set tramp-autoload cookie. * net/tramp-smb.el (top) Require just 'tramp. Add objects to `tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add to `tramp-unload-hook'. Change checks, whether package can be loaded. Change call of `tramp-compat-decimal-to-octal' to new function name. (tramp-smb-tunnel-method): Make it a defconst. (tramp-smb-file-name-p): Make it a defsubst. (tramp-smb-method, tramp-smb-file-name-handler) (tramp-smb-file-name-p): Set tramp-autoload cookie. * net/tramp-uu.el (top) Add to `tramp-unload-hook'. (tramp-uuencode-region): Set tramp-autoload cookie. * net/trampver.el (top) Add to `tramp-unload-hook'. (tramp-version, tramp-bug-report-address): Set tramp-autoload cookie. Update release number.
2010-09-08 16:42:54 +02:00
(add-hook 'tramp-unload-hook
(lambda ()
(unload-feature 'tramp-gvfs 'force)))
2009-06-22 21:04:49 +00:00
(provide 'tramp-gvfs)
;;; TODO:
;; * (Customizable) unmount when exiting Emacs. See tramp-archive.el.
;;
;; * Host name completion for existing mount points (afp-server,
;; smb-server) or via smb-network or network.
;;
;; * Check, how two shares of the same SMB server can be mounted in
2009-06-22 21:04:49 +00:00
;; parallel.
;;
;; * What's up with ftps dns-sd afc admin computer?
2009-06-22 21:04:49 +00:00
;;; tramp-gvfs.el ends here