So Emacs has a system to let modes register handlers for these
``complicated'' selections.
-@defun register-yank-media-handler types handler
+@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
-(register-yank-media-handler 'text/html #'my-html-handler)
-(register-yank-media-handler "image/.*" #'my-image-handler)
+(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.
(setq-local message-checksum nil)
(setq-local message-mime-part 0)
(message-setup-fill-variables)
- (register-yank-media-handler "image/.*" #'message--yank-media-image-handler)
+ (yank-media-handler "image/.*" #'message--yank-media-image-handler)
(when message-fill-column
(setq fill-column message-fill-column)
(turn-on-auto-fill))
(setq-local css-id-list-function #'html-current-buffer-ids))
(setq imenu-create-index-function 'html-imenu-index)
- (register-yank-media-handler 'text/html #'html-mode--html-yank-handler)
- (register-yank-media-handler "image/.*" #'html-mode--image-yank-handler)
+ (yank-media-handler 'text/html #'html-mode--html-yank-handler)
+ (yank-media-handler "image/.*" #'html-mode--image-yank-handler)
(setq-local sgml-empty-tags
;; From HTML-4.01's loose.dtd, parsed with
"Yank media (images, HTML and the like) from the clipboard.
This command depends on the current major mode having support for
accepting the media type. The mode has to register itself using
-the `register-yank-media-handler' mechanism."
+the `yank-media-handler' mechanism."
(interactive)
(unless yank-media--registered-handlers
(user-error "The `%s' mode hasn't registered any handlers" major-mode))
data)))
;;;###autoload
-(defun register-yank-media-handler (types handler)
+(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.