-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New emoji input features in Emacs 29 #199
Comments
@oantolin suggested this additional hack: (minibuffer-with-setup-hook
(lambda ()
(setq-local after-change-functions
(list (lambda (&rest _) (exit-minibuffer))))
(emoji-insert))
(read-string "Reaction: ")) |
Replacing the |
I have a demo implementation. It's not in a form applicable as a PR, but I could easily do that too, if there's interest. I mention it here so people can try out this UX idea and see if they like it:
|
@oantolin That does look useful, yes. If you have time to prepare a PR or draft PR, feel free. |
I was playing with a little tweak to jump directly to the "Recent" menu simply by having (defun my-ement-room-send-common-reaction (key position)
"Send a reaction."
(interactive
(list (minibuffer-with-setup-hook
(lambda ()
(activate-input-method 'emoji)
(push ?r unread-command-events)
(emoji-insert))
(read-string "Reaction: "))
(point)))
(ement-room-send-reaction key position)) It turned out that in Emacs 29 that "Recent" sub-menu is different to the others, not only in the fact that it builds the options dynamically, but also in being separate from the rest of the transient menu such that you can't 'back out' of that sub-menu with I didn't understand transient.el enough to figure out how to fix that, but when I tested in my build of Emacs 30 I found that the problem was fixed there. I then confirmed that emoji.el from my 30.0.50 build also worked in Emacs 29. So if you want to, you can just copy that version of the library and then my hack works quite nicely. |
I noticed that I'd updated that code since then (to ensure there is an event at point to react to), so here's what I'm currently using. Notes from the previous comment still apply. (defun my-ement-room-send-common-reaction (key position &optional event)
"Send a reaction."
(interactive
(let ((event (ewoc-data (ewoc-locate ement-ewoc))))
(unless (ement-event-p event)
(user-error "No event at point"))
(list (minibuffer-with-setup-hook
(lambda ()
(activate-input-method 'emoji)
(push ?r unread-command-events)
(call-interactively #'emoji-insert))
(read-string "Reaction: "))
(point)
event)))
(ement-room-send-reaction key position event)) |
@phil-s Forgive me, as I haven't grokked these new features yet: Do these "hacks" of yours need to be added to Ement itself to go with Omar's patch? Or are they just for interested users to add to their configs? |
My snippets were independent of #201. I haven't actually tried that PR so I'm not sure how it compares, but I expect it achieves much the same goal and that no one would need my code now that the PR has been merged. |
I've tried it now, and the only "advantage" of my code was that it automatically jumped into the "recent" emoji listing. But (a) I'd needed the emoji.el from Emacs 30 to make that work properly (I couldn't |
@phil-s posted this in the room, which seems to be a very clever solution:
The text was updated successfully, but these errors were encountered: