ement.el icon indicating copy to clipboard operation
ement.el copied to clipboard

Editing a message in a compose buffer and manually calling M-x ement-room-compose-org results in a new message

Open phil-s opened this issue 2 years ago • 1 comments

If ement-room-compose-org is called automatically via ement-room-compose-hook then everything is fine, but it turns out there's a bug if M-x ement-room-compose-org is called interactively.

Recipe:

  • (setq ement-room-compose-hook nil)
  • Write a new message
  • Edit the message in the minibuffer
  • Type C-c ' to call ement-room-compose-from-minibuffer
  • Call M-x ement-room-compose-org
  • Type C-x C-s and submit the edit
  • Observe the the edit has actually become a new message

If I don't use M-x ement-room-compose-org, or if that is being called via ement-room-compose-hook, then the editing works as expected.

I haven't debugged this, but your comment in chat was:

Probably it's just a matter of the buffer-local variables that contain the metadata about the message being replied to getting killed when the major mode changes. If so, it's basically the same as https://github.com/alphapapa/ement.el/issues/130.

There are also dynamic let bindings in ement-room-edit-message and/or ement-room-compose-from-minibuffer which are in scope when ement-room-compose-hook runs, but not subsequently when invoking M-x ement-room-compose-org.

phil-s avatar Oct 05 '23 09:10 phil-s

Thanks. Not sure of the best way to solve this yet. Might end up deferring it for a few versions, because there are other things that seem more important right now.

alphapapa avatar Oct 07 '23 08:10 alphapapa