Skip to content

Commit 2d9d62b

Browse files
committed
Add new Tramp method "media"
* doc/misc/tramp.texi (Quick Start Guide, GVFS-based methods): Add media devices. * etc/NEWS: Mention new Tramp method "media". * lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "media" method. (tramp-goa-methods): Add tramp-autoload cookie. (tramp-media-methods): New defvar. (tramp-gvfs-service-volumemonitor): New defsubst. (top): Remove media methods if not supported. Add defaults for `tramp-default-host-alist'. (tramp-goa-account): Rename from `tramp-goa-name'. Adapt all callees. (tramp-gvfs-service-afc-volumemonitor) (tramp-gvfs-service-goa-volumemonitor) (tramp-gvfs-service-gphoto2-volumemonitor) (tramp-gvfs-service-mtp-volumemonitor) (tramp-gvfs-path-remotevolumemonitor) (tramp-gvfs-interface-remotevolumemonitor): New defconsts. (tramp-media-device): New defstruct. (tramp-gvfs-activation-uri): New defun. (tramp-gvfs-url-file-name): Use it. (tramp-gvfs-handler-mounted-unmounted) (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec): Handle "media" method. (tramp-get-goa-account): Rename from `tramp-make-goa-name'. Adapt all callees. (tramp-get-goa-accounts): Adapt docstring. Cache with nil key. (tramp-parse-goa-accounts, tramp-get-media-device) (tramp-get-media-devices) (tramp-parse-media-names): New defuns. (top): Rework completion function registration. * lisp/net/tramp.el (tramp-dns-sd-service-regexp): New defconst. (tramp-set-completion-function): Use it.
1 parent 1a2a5a1 commit 2d9d62b

File tree

4 files changed

+487
-101
lines changed

4 files changed

+487
-101
lines changed

doc/misc/tramp.texi

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -557,13 +557,16 @@ of the local file name is the share exported by the remote host,
557557
@cindex method @option{davs}
558558
@cindex @option{dav} method
559559
@cindex @option{davs} method
560+
@cindex method @option{media}
561+
@cindex @option{media} method
560562

561563
On systems, which have installed @acronym{GVFS, the GNOME Virtual File
562564
System}, its offered methods could be used by @value{tramp}. Examples
563565
are @file{@trampfn{sftp,user@@host,/path/to/file}},
564566
@file{@trampfn{afp,user@@host,/path/to/file}} (accessing Apple's AFP
565-
file system), @file{@trampfn{dav,user@@host,/path/to/file}} and
566-
@file{@trampfn{davs,user@@host,/path/to/file}} (for WebDAV shares).
567+
file system), @file{@trampfn{dav,user@@host,/path/to/file}},
568+
@file{@trampfn{davs,user@@host,/path/to/file}} (for WebDAV shares) and
569+
@file{@trampfn{media,device,/path/to/file}} (for media devices).
567570

568571

569572
@anchor{Quick Start Guide: GNOME Online Accounts based methods}
@@ -1126,7 +1129,8 @@ Emacs.
11261129
@value{tramp} does not require a host name part of the remote file
11271130
name when a single Android device is connected to @command{adb}.
11281131
@value{tramp} instead uses @file{@trampfn{adb,,}} as the default name.
1129-
@command{adb devices} shows available host names.
1132+
@command{adb devices}, run in a shell outside Emacs, shows available
1133+
host names.
11301134

11311135
@option{adb} method normally does not need user name to authenticate
11321136
on the Android device because it runs under the @command{adbd}
@@ -1243,6 +1247,26 @@ Since Google Drive uses cryptic blob file names internally,
12431247
could produce unexpected behavior in case two files in the same
12441248
directory have the same @code{display-name}, such a situation must be avoided.
12451249

1250+
@item @option{media}
1251+
@cindex method @option{media}
1252+
@cindex @option{media} method
1253+
@cindex media
1254+
1255+
Media devices, like cell phones, tablets, cameras, can be accessed via
1256+
the @option{media} method. Just the device name is needed in order to
1257+
specify the remote part of file name. However, the device must
1258+
already be connected via USB, before accessing it.
1259+
1260+
Depending on the device type, the access could be read-only. Some
1261+
devices are accessible under different names in parallel, offering
1262+
different parts of their file system.
1263+
1264+
@c @value{tramp} does not require a device name as part of the remote
1265+
@c file name when a single media device is connected. @value{tramp}
1266+
@c instead uses @file{@trampfn{media,,}} as the default name.
1267+
@c @c @command{adb devices}, run in a shell outside Emacs, shows available
1268+
@c @c host names.
1269+
12461270
@item @option{nextcloud}
12471271
@cindex method @option{nextcloud}
12481272
@cindex @option{nextcloud} method
@@ -1267,11 +1291,11 @@ that for security reasons refuse @command{ssh} connections.
12671291
@defopt tramp-gvfs-methods
12681292
This user option is a list of external methods for @acronym{GVFS}@.
12691293
By default, this list includes @option{afp}, @option{dav},
1270-
@option{davs}, @option{gdrive}, @option{nextcloud} and @option{sftp}.
1271-
Other methods to include are @option{ftp}, @option{http},
1272-
@option{https} and @option{smb}. These methods are not intended to be
1273-
used directly as @acronym{GVFS}-based method. Instead, they are added
1274-
here for the benefit of @ref{Archive file names}.
1294+
@option{davs}, @option{gdrive}, @option{media}, @option{nextcloud} and
1295+
@option{sftp}. Other methods to include are @option{ftp},
1296+
@option{http}, @option{https} and @option{smb}. These methods are not
1297+
intended to be used directly as @acronym{GVFS}-based method. Instead,
1298+
they are added here for the benefit of @ref{Archive file names}.
12751299

12761300
If you want to use @acronym{GVFS}-based @option{ftp} or @option{smb}
12771301
methods, you must add them to @code{tramp-gvfs-methods}, and you must

etc/NEWS

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ Pango instead of libXFT for font support. Since Pango 1.44 has
3131
removed support for bitmapped fonts, this may require you to adjust
3232
your font settings.
3333

34-
Note also that 'FontBackend' settings in .Xdefaults or .Xresources, or
35-
'font-backend' frame parameter settings in your init files, may need
34+
Note also that 'FontBackend' settings in ".Xdefaults" or ".Xresources",
35+
or 'font-backend' frame parameter settings in your init files, may need
3636
to be adjusted, as 'xft' is no longer a valid backend when using
3737
Cairo. Use 'ftcrhb' if your Emacs was built with HarfBuzz support,
3838
and 'ftcr' otherwise. You can determine this by checking
@@ -75,7 +75,7 @@ This file was a compatibility kludge which is no longer needed.
7575
---
7676
** 'lisp-mode' now uses 'common-lisp-indent-function'.
7777
To revert to the previous behaviour,
78-
(setq lisp-indent-function 'lisp-indent-function) from 'lisp-mode-hook'.
78+
'(setq lisp-indent-function 'lisp-indent-function)' from 'lisp-mode-hook'.
7979

8080
** Edebug
8181

@@ -84,6 +84,12 @@ To revert to the previous behaviour,
8484
unconditionally aborts the current edebug instrumentation with the
8585
supplied error message.
8686

87+
** Tramp
88+
89+
+++
90+
*** New connection method "media", which allows accessing media devices
91+
like cell phones, tablets or cameras.
92+
8793

8894
* New Modes and Packages in Emacs 28.1
8995

0 commit comments

Comments
 (0)