Function: yank-media-handler

yank-media-handler is an autoloaded and byte-compiled function defined in yank-media.el.gz.

Signature

(yank-media-handler TYPES HANDLER)

Documentation

Register HANDLER for dealing with yank-media actions for TYPES.

TYPES should be a MIME media type symbol, a regexp, or a list that can contain both symbols and regexps.

HANDLER is a function that will be called with two arguments: The MIME type (a symbol of the form image/png) and the selection data (a string).

View in manual

Source Code

;; Defined in /usr/src/emacs/lisp/yank-media.el.gz
;;;###autoload
(defun yank-media-handler (types handler)
  "Register HANDLER for dealing with `yank-media' actions for TYPES.
TYPES should be a MIME media type symbol, a regexp, or a list
that can contain both symbols and regexps.

HANDLER is a function that will be called with two arguments: The
MIME type (a symbol of the form `image/png') and the selection
data (a string)."
  (make-local-variable 'yank-media--registered-handlers)
  (dolist (type (ensure-list types))
    (setf (alist-get type yank-media--registered-handlers nil nil #'equal)
          handler)))