From: Michael Albinus Date: Sat, 26 Dec 2020 11:39:10 +0000 (+0100) Subject: Rename Tramp method "media" to "mtp" (Bug#45402) X-Git-Tag: emacs-28.0.90~4552 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fd658b810056d41fad9edeba8bdba0594fc87867;p=emacs.git Rename Tramp method "media" to "mtp" (Bug#45402) * doc/misc/tramp.texi (Quick Start Guide, GVFS-based methods): Rename "media" to "mtp". (Bug#45402) * etc/NEWS: Rename Tramp method "media" to "mtp". Fix typos. * lisp/net/tramp-gvfs.el (tramp-gvfs-methods, tramp-media-methods) (tramp-gvfs-activation-uri) (tramp-gvfs-handler-volumeadded-volumeremoved) (tramp-get-media-devices, top): Rename "media" to "mtp". (Bug#45402) --- diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index dd350f10c0b..2133dfec35a 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -558,8 +558,8 @@ of the local file name is the share exported by the remote host, @cindex method @option{davs} @cindex @option{dav} method @cindex @option{davs} method -@cindex method @option{media} -@cindex @option{media} method +@cindex method @option{mtp} +@cindex @option{mtp} method On systems, which have installed @acronym{GVFS, the GNOME Virtual File System}, its offered methods could be used by @value{tramp}. Examples @@ -567,7 +567,7 @@ are @file{@trampfn{sftp,user@@host,/path/to/file}}, @file{@trampfn{afp,user@@host,/path/to/file}} (accessing Apple's AFP file system), @file{@trampfn{dav,user@@host,/path/to/file}}, @file{@trampfn{davs,user@@host,/path/to/file}} (for WebDAV shares) and -@file{@trampfn{media,device,/path/to/file}} (for media devices). +@file{@trampfn{mtp,device,/path/to/file}} (for media devices). @anchor{Quick Start Guide: GNOME Online Accounts based methods} @@ -1246,13 +1246,13 @@ Since Google Drive uses cryptic blob file names internally, could produce unexpected behavior in case two files in the same directory have the same @code{display-name}, such a situation must be avoided. -@item @option{media} -@cindex method @option{media} -@cindex @option{media} method +@item @option{mtp} +@cindex method @option{mtp} +@cindex @option{mtp} method @cindex media Media devices, like cell phones, tablets, cameras, can be accessed via -the @option{media} method. Just the device name is needed in order to +the @option{mtp} method. Just the device name is needed in order to specify the host in the file name. However, the device must already be connected via USB, before accessing it. Possible device names are visible via host name completion, @ref{File name completion}. @@ -1263,7 +1263,7 @@ different parts of their file system. @value{tramp} does not require a host name as part of the remote file name when a single media device is connected. @value{tramp} instead -uses @file{@trampfn{media,,}} as the default name. +uses @file{@trampfn{mtp,,}} as the default name. @item @option{nextcloud} @cindex method @option{nextcloud} @@ -1289,7 +1289,7 @@ that for security reasons refuse @command{ssh} connections. @defopt tramp-gvfs-methods This user option is a list of external methods for @acronym{GVFS}@. By default, this list includes @option{afp}, @option{dav}, -@option{davs}, @option{gdrive}, @option{media}, @option{nextcloud} and +@option{davs}, @option{gdrive}, @option{mtp}, @option{nextcloud} and @option{sftp}. Other methods to include are @option{ftp}, @option{http}, @option{https} and @option{smb}. These methods are not intended to be used directly as @acronym{GVFS}-based method. Instead, diff --git a/etc/NEWS b/etc/NEWS index a320acb5faf..d24d8b1f0a2 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -384,7 +384,7 @@ If your mouse or trackpad supports it, you can now scroll tabs when the mouse pointer is in the tab line by scrolling left or right. --- -*** New tab-line faces and options +*** New tab-line faces and options. The face 'tab-line-tab-special' is used for tabs whose buffers are special, i.e. not file-backed. The face 'tab-line-tab-inactive-alternate' is used to display inactive tabs @@ -890,7 +890,7 @@ preferred over the eudcb-mab.el backend. ** Tramp +++ -*** New connection method "media", which allows accessing media devices +*** New connection method "mtp", which allows accessing media devices like cell phones, tablets or cameras. +++ @@ -1465,7 +1465,7 @@ that makes it a valid button. --- *** New user option 'authinfo-hide-elements'. -This can be set to nil to inhibit hiding passwords in .authinfo files. +This can be set to nil to inhibit hiding passwords in ".authinfo" files. +++ *** A number of new string manipulation functions have been added. @@ -2009,7 +2009,7 @@ used in. +++ ** 'truncate-string-ellipsis' now uses '…' by default. Modes that use 'truncate-string-to-width' with non-nil, non-string -argument 'ellipsis', will now indicate truncation using '…' when +argument ELLIPSIS, will now indicate truncation using '…' when the selected frame can display it, and using "..." otherwise. +++ @@ -2046,7 +2046,7 @@ of its file argument. +++ ** New utility function 'directory-empty-p'. -This predicate tests whether a given filename is an accessible +This predicate tests whether a given file name is an accessible directory and whether it contains no other directories or files. +++ @@ -2221,7 +2221,7 @@ Until it is solved you could ignore such errors by performing +++ ** Buffers can now be created with certain hooks disabled. The functions 'get-buffer-create' and 'generate-new-buffer' accept a -new optional argument 'inhibit-buffer-hooks'. If non-nil, the new +new optional argument INHIBIT-BUFFER-HOOKS. If non-nil, the new buffer does not run the hooks 'kill-buffer-hook', 'kill-buffer-query-functions', and 'buffer-list-update-hook'. This avoids slowing down internal or temporary buffers that are never @@ -2231,9 +2231,9 @@ presented to users or passed on to other applications. ** 'start-process-shell-command' and 'start-file-process-shell-command' do not support the old calling conventions any longer. -** Functions operating on local filenames now check that the filenames +** Functions operating on local file names now check that the file names don't contain any NUL bytes. This avoids subtle bugs caused by -silently using only the part of the filename until the first NUL byte. +silently using only the part of the file name until the first NUL byte. ** New coding-systems for EBCDIC variants. New coding-systems 'ibm256', 'ibm273', 'ibm274', 'ibm277', 'ibm278', diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 1722c53be05..fa1a90bc844 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -49,12 +49,12 @@ ;; The user option `tramp-gvfs-methods' contains the list of supported ;; connection methods. Per default, these are "afp", "dav", "davs", -;; "gdrive", "media", "nextcloud" and "sftp". +;; "gdrive", "mtp", "nextcloud" and "sftp". ;; "gdrive" and "nextcloud" connection methods require a respective ;; account in GNOME Online Accounts, with enabled "Files" service. -;; The "media" connection method is responsible for media devices, +;; 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. @@ -131,7 +131,7 @@ ;;;###tramp-autoload (defcustom tramp-gvfs-methods - '("afp" "dav" "davs" "gdrive" "media" "nextcloud" "sftp") + '("afp" "dav" "davs" "gdrive" "mtp" "nextcloud" "sftp") "List of methods for remote files, accessed with GVFS." :group 'tramp :version "28.1" @@ -142,7 +142,7 @@ (const "gdrive") (const "http") (const "https") - (const "media") + (const "mtp") (const "nextcloud") (const "sftp") (const "smb")))) @@ -159,7 +159,7 @@ ;;;###tramp-autoload (defvar tramp-media-methods '("afc" "gphoto2" "mtp") - "List of GVFS methods which are covered by the \"media\" method. + "List of GVFS methods which are covered by the \"mtp\" method. They are checked during start up via `tramp-gvfs-interface-remotevolumemonitor'.") @@ -1639,7 +1639,7 @@ ID-FORMAT valid values are `string' and `integer'." (if (tramp-tramp-file-p filename) (with-parsed-tramp-file-name filename nil ;; Ensure that media devices are cached. - (when (string-equal method "media") + (when (string-equal method "mtp") (tramp-get-media-device v)) (with-tramp-connection-property v "activation-uri" (setq localname "/") @@ -1649,7 +1649,7 @@ ID-FORMAT valid values are `string' and `integer'." (setq method "davs" localname (concat (tramp-gvfs-get-remote-prefix v) localname))) - (when (string-equal "media" method) + (when (string-equal "mtp" method) (when-let ((media (tramp-get-connection-property v "media-device" nil))) (setq method (tramp-media-device-method media) @@ -2058,7 +2058,7 @@ and \"org.gtk.Private.RemoteVolumeMonitor.VolumeRemoved\" signals." (uri (url-generic-parse-url (nth 5 volume))) (method (url-type uri)) (vec (make-tramp-file-name - :method "media" + :method "mtp" ;; A host name cannot contain spaces. :host (tramp-compat-string-replace " " "_" (nth 1 volume)))) (media (make-tramp-media-device @@ -2363,7 +2363,7 @@ VEC is used only for traces." tramp-gvfs-interface-remotevolumemonitor "List"))) (let* ((uri (url-generic-parse-url (nth 5 volume))) (vec (make-tramp-file-name - :method "media" + :method "mtp" ;; A host name cannot contain spaces. :host (tramp-compat-string-replace " " "_" (nth 1 volume)))) (media (make-tramp-media-device @@ -2376,12 +2376,12 @@ VEC is used only for traces." (tramp-set-connection-property vec "media-device" media) (tramp-set-connection-property media "vector" vec)))) - ;; Adapt default host name, supporting /media:: when possible. + ;; Adapt default host name, supporting /mtp:: when possible. (setq tramp-default-host-alist (append - `(("media" nil ,(if (= (length devices) 1) (car devices) ""))) + `(("mtp" nil ,(if (= (length devices) 1) (car devices) ""))) (delete - (assoc "media" tramp-default-host-alist) + (assoc "mtp" tramp-default-host-alist) tramp-default-host-alist))))) (defun tramp-parse-media-names (service) @@ -2498,7 +2498,7 @@ This uses \"avahi-browse\" in case D-Bus is not enabled in Avahi." ;; Add completion functions for media devices. (tramp-get-media-devices nil) (tramp-set-completion-function - "media" + "mtp" (mapcar (lambda (method) `(tramp-parse-media-names ,(format "_%s._tcp" method))) tramp-media-methods))))