unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Richard Stallman <rms@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: `M-x yank-media'
Date: Mon, 08 Nov 2021 05:55:24 +0100	[thread overview]
Message-ID: <87mtmfb60z.fsf@gnus.org> (raw)
In-Reply-To: <E1mjv0a-0005rn-Ke@fencepost.gnu.org> (Richard Stallman's message of "Sun, 07 Nov 2021 22:07:44 -0500")

Richard Stallman <rms@gnu.org> writes:

> It sounds exciting -- could you say a little more about how
> it behaves?

From the manual:

@node Yanking Media
@section Yanking Media

  If you choose, for instance, ``Copy Image'' in a web browser, that
image is put onto the clipboard, and Emacs can access it via
@code{gui-get-selection}.  But in general, inserting image data into
an arbitrary buffer isn't very useful---you can't really do much with
it by default.

  So Emacs has a system to let modes register handlers for these
``complicated'' selections.

@defun yank-media-handler types handler
@var{types} can be a @acronym{MIME} media type symbol, a regexp to
match these, or a list of these symbols and regexps.  For instance:

@example
(yank-media-handler 'text/html #'my-html-handler)
(yank-media-handler "image/.*" #'my-image-handler)
@end example

A mode can register as many handlers as required.

  The @var{handler} function is called with two parameters: The
@acronym{MIME} media type symbol and the data (as a string).  The
handler should then insert the object into the buffer, or save it, or
do whatever is appropriate for the mode.
@end defun

  The @code{yank-media} command will consult the registered handlers in
the current buffer, compare that with the available media types on the
clipboard, and then pass on the matching selection to the handler (if
any).  If there's more than one matching selection, the user is
queried first.



-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



  reply	other threads:[~2021-11-08  4:55 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-06 21:05 `M-x yank-media' Lars Ingebrigtsen
2021-11-06 23:09 ` H. Dieter Wilhelm
2021-11-07  3:05   ` [External] : " Drew Adams
2021-11-07  1:23 ` T.V Raman
2021-11-07 10:02 ` Eli Zaretskii
2021-11-07 13:12   ` Lars Ingebrigtsen
2021-11-07 13:21     ` Eli Zaretskii
2021-11-07 13:32       ` Lars Ingebrigtsen
2021-11-07 13:38         ` Po Lu
2021-11-07 13:45           ` Lars Ingebrigtsen
2021-11-08  0:56             ` Po Lu
2021-11-08  1:10               ` Lars Ingebrigtsen
2021-11-08  2:12                 ` Po Lu
2021-11-07 13:42         ` Eli Zaretskii
2021-11-07 13:48           ` Lars Ingebrigtsen
2021-11-07 13:57             ` Eli Zaretskii
2021-11-07 14:04               ` Lars Ingebrigtsen
2021-11-07 14:08                 ` Stefan Monnier
2021-11-07 14:11                   ` Lars Ingebrigtsen
2021-11-07 14:09                 ` Eli Zaretskii
2021-11-07 14:13                   ` Lars Ingebrigtsen
2021-11-23 23:42         ` Alan Third
2021-11-24  7:14           ` Lars Ingebrigtsen
2021-11-24 10:59             ` Alan Third
2021-11-24 16:45               ` Lars Ingebrigtsen
2021-11-25  0:53                 ` Po Lu
2021-11-25 13:37                   ` Lars Ingebrigtsen
2021-11-08  3:07 ` Richard Stallman
2021-11-08  4:55   ` Lars Ingebrigtsen [this message]
2021-11-08  5:09 ` Lars Ingebrigtsen
2021-11-08 14:29   ` Eli Zaretskii
2021-11-09  3:39     ` Lars Ingebrigtsen
2021-11-08 16:56 ` Uwe Brauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mtmfb60z.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).