From: Lars Ingebrigtsen Date: Mon, 8 Nov 2021 00:40:58 +0000 (+0100) Subject: Rename 'register-yank-media-handler' X-Git-Tag: emacs-29.0.90~3671^2~85 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cddd927d36ac70bdc7614190e649b3aed56ff97f;p=emacs.git Rename 'register-yank-media-handler' * lisp/textmodes/sgml-mode.el (html-mode): * lisp/gnus/message.el (message-mode): * doc/lispref/frames.texi (Yanking Media): Adjust. * lisp/yank-media.el (yank-media): Adjust doc string. (yank-media-handler): Rename from `register-' because that may cause confusion with register.el functions. --- diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index a0565130022..8a77fdef3fb 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -3936,13 +3936,13 @@ it by default. 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. diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index b7d98d52de5..77e8fcdfd16 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -3157,7 +3157,7 @@ Like `text-mode', but with these additional commands: (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)) diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 8985fe5cdf9..3b0c5d8b65c 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -2415,8 +2415,8 @@ To work around that, do: (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 diff --git a/lisp/yank-media.el b/lisp/yank-media.el index 6d0d0b1a181..2c79a14e7d3 100644 --- a/lisp/yank-media.el +++ b/lisp/yank-media.el @@ -33,7 +33,7 @@ "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)) @@ -89,7 +89,7 @@ the `register-yank-media-handler' mechanism." 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.