Skip to content

Commit

Permalink
Fix: (ement-room-send-reaction) Catch minibuffer exit, return value
Browse files Browse the repository at this point in the history
EXIT-MINIBUFFER throws EXIT, which wasn't being caught, so
EMOJI-SEARCH was signaling an error rather than returning the selected
emoji.

This seems to work with both EMOJI-SEARCH and EMOJI-INSERT.
  • Loading branch information
alphapapa committed Apr 1, 2024
1 parent a163a3b commit 72e7a07
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ement-room.el
Original file line number Diff line number Diff line change
Expand Up @@ -2278,12 +2278,16 @@ these all require at least version 29 of Emacs):
(list (minibuffer-with-setup-hook
(lambda ()
(setq-local after-change-functions
(list (lambda (&rest _) (exit-minibuffer))))
(list (lambda (&rest _)
(catch 'exit
(exit-minibuffer))
(throw 'selected (minibuffer-contents)))))
(use-local-map
(make-composed-keymap ement-room-reaction-map (current-local-map)))
(let ((enable-recursive-minibuffers t))
(funcall ement-room-reaction-picker)))
(read-string "Reaction: "))
(catch 'selected
(read-string "Reaction: ")))
(point))))
;; SPEC: MSC2677 <https://github.com/matrix-org/matrix-doc/pull/2677>
;; HACK: We could simplify this by storing the key in a text property...
Expand Down

0 comments on commit 72e7a07

Please sign in to comment.