Improve behavior of calling reply command when point is on username using "Elemental" message format
To reproduce:
- Open the room list
- Enter a room
- Attempt to use
S-RETorM-x ement-room-write-replyto reply to a message point
This fails with the following trace:
Debugger entered--Lisp error: (cl-assertion-failed ((ement-event-p (ewoc-data (ewoc-locate ement-ewoc))) nil))
cl--assertion-failed((ement-event-p (ewoc-data (ewoc-locate ement-ewoc))))
ement-room-write-reply()
#<subr funcall-interactively>(ement-room-write-reply)
apply(#<subr funcall-interactively> ement-room-write-reply)
funcall-interactively(ement-room-write-reply)
#<subr call-interactively>(ement-room-write-reply nil nil)
apply(#<subr call-interactively> (ement-room-write-reply nil nil))
explain-pause--wrap-call-interactively(#<subr call-interactively> ement-room-write-reply nil nil)
apply(explain-pause--wrap-call-interactively #<subr call-interactively> (ement-room-write-reply nil nil))
call-interactively(ement-room-write-reply nil nil)
command-execute(ement-room-write-reply)
Specifically, I am using Nix's emacs29-pgtk package.
The backtrace would seem to indicate that you called the command to write a reply when point was not on a message event.
Yes, I must have thought that the username associated with a message is included in the region defined as the message. I'll close this now.
Though is it perhaps worthwhile to add a catch for such an error? So far nothing else while using ement has spit such an ugly message at me.
Yes, I must have thought that the username associated with a message is included in the region defined as the message. I'll close this now.
The default message display format puts the usernames and timestamps in the margins; the point can't move into the margins. Point can be in the message body, reactions, etc.
Though is it perhaps worthwhile to add a catch for such an error? So far nothing else while using ement has spit such an ugly message at me.
What you saw was the catch, the assertion. I don't understand how you could have tried to call that command thinking point was on a username shown in a margin, though.
Maybe it should be improved, but this is the first I've heard of this problem, and at least a few hundred people are using Ement now, so we'll see.
I maybe should have clarified: the issue only appears while in the "Elemental" room format: with ement-room-message-format-spec set to "%B%r%R%t".
Ok, that makes sense, yes. Probably point was on the username rather than the message below it. I'll repurpose this issue to improve that behavior. Thanks.