From a311de00bd4fb2ad467c955e1fa12fd5613b58b2 Mon Sep 17 00:00:00 2001 From: mousebot Date: Sat, 2 Oct 2021 00:27:57 +0200 Subject: add emojify-insert-emoji binding in mastodon new toot buffer --- lisp/mastodon-toot.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 0c3c784..fc8949a 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -31,6 +31,8 @@ (defvar mastodon-instance-url) +(declare-function #'emojify-insert-emoji "emojify") + (autoload 'mastodon-auth--user-acct "mastodon-auth") (autoload 'mastodon-http--api "mastodon-http") (autoload 'mastodon-http--post "mastodon-http") @@ -98,6 +100,8 @@ Valid values are \"direct\", \"private\" (followers-only), \"unlisted\", and \"p (define-key map (kbd "C-c C-n") #'mastodon-toot--toggle-nsfw) (define-key map (kbd "C-c C-v") #'mastodon-toot--change-visibility) (define-key map (kbd "C-c C-a") #'mastodon-toot--add-media-attachment) + (when (require 'emojify nil :noerror) + (define-key map (kbd "C-c C-e") #'mastodon-toot--insert-emoji)) map) "Keymap for `mastodon-toot'.") @@ -265,6 +269,10 @@ Remove MARKER if REMOVE is non-nil, otherwise add it." (interactive) (mastodon-toot--kill)) +(defun mastodon-toot--insert-emoji () + "Prompt to insert an emoji." + (emojify-insert-emoji)) + (defun mastodon-toot--remove-docs () "Get the body of a toot from the current compose buffer." (let ((header-region (mastodon-tl--find-property-range 'toot-post-header -- cgit v1.2.3