On 23/09/2023 17:28, Ihor Radchenko wrote:
Visuwesh writes:
+ (let* ((ext (symbol-name (mailcap-mime-type-to-extension mimetype)))
+ (iname (read-string "Insert filename for image: "))
It would be nice if we auto-generate the file name here by default. It
is what I would expect from yanking an image at least.
Certainly it would be great to provide some default value allowing user
to override it. However it may be not so trivial. Clipboard content may
be just copy region from some graphics editor or a screenshot tool, so
not associated with a file yet. In X11 xprop may be used to get
clipboard owner application and its title. Wayland may be less permissive.
I have tried to copy an image in Firefox. There is a chance to find file
name (it may be image.php?id=1324 though) in text/html clipboard
content, but it requires parsing of HTML
xclip -selection clipboard -o -t text/html