bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#77731: [PATCH] Add yank-media-handler for copied files from file man


From: Visuwesh
Subject: bug#77731: [PATCH] Add yank-media-handler for copied files from file manager
Date: Fri, 11 Apr 2025 14:58:32 +0530
User-agent: Gnus/5.13 (Gnus v5.13)

[ This has been sitting in my drafts folder for many months now.  ]

Attached patch adds a yank-media-handler to message-mode to attach files
copied/cut from a file manager.  I tested this patch using pcmanfm and
xfe.  The regexp for the media-type was chosen after the blogpost [1],
pcmanfm in particular sets the media-type to
x-special/gnome-copied-files.

I strip the null byte in the split-string call in the handler because
pcmanfm adds a null byte at the end of clipboard selection.  I don't
know if this is the case with other file managers.

I also cannot find the spec of this clipboard type but [2] and pcmanfm
suggests that the selection is

    OPERATION
    file://FILE1
    file://FILE2...

where OPERATION is either cut or copy, and the rest of the lines are
links to the files.  I do the same as what Org does to parse the above.

1. https://larsee.com/blog/2019/05/clipboard-files/
2. https://indigo.re/posts/2021-12-21-clipboard-data.html

In GNU Emacs 30.0.50 (build 7, x86_64-pc-linux-gnu, X toolkit, Xaw
 scroll bars) of 2023-09-10 built on astatine
Repository revision: af1e860570191014d94484d6944348b1766ba59f
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101008
System Description: Debian GNU/Linux trixie/sid

Configured using:
 'configure --with-sound=alsa --with-x-toolkit=lucid --with-json
 --without-xaw3d --without-gconf --without-libsystemd --without-cairo'

Attachment: 0001-Add-yank-media-handler-for-copied-files-from-file-ma.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]