-
Notifications
You must be signed in to change notification settings - Fork 62
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
Jcompost/mu 1.12 support with backward compatibility #184
base: master
Are you sure you want to change the base?
Jcompost/mu 1.12 support with backward compatibility #184
Conversation
This addresses Issue #177. Signed-off-by: Jeremy Compostella <[email protected]>
704856a
to
466f816
Compare
mu keeps changing the prefix of their function breaking org-msg in the process. This should address issues #182 and #176. This commit introduces helper functions looking for the right function names as an attempt to support mu 1.12 while offering backward compatibility. Signed-off-by: Jeremy Compostella <[email protected]>
466f816
to
cc25647
Compare
Testing this; after sending an email I get |
I think a number of bits of functionality have been shifted to use Gnus's message mode, which is why some old mu4e functions seem to have disappeared without replacements. |
I have a work-around for the "Text is read-only" error, but haven't yet identified the best plave to fix the problem in the code itself. The cause is that As this problem doesn't occur when using The workaround is to add some advice around (defun `my--ensure-text-not-read-only` (orig &rest args)
(let ((inhibit-read-only t))
(remove-text-properties (point-min) (point-max) '(read-only nil))
(apply orig args)))
(advice-add 'message-send :around #'my--ensure-text-not-read-only) EDIT: Oh - I also had to comment out a line in org-msg-edit-mode which adds undo to message-sent-hook, as this was barfing on the undo being to a non-visible part of the buffer. I'm not sure what this undo does (or undoes, I suppose), but things seem to be working without it. Probably removing undo from the hook in some advice on org-msg-edit-mode would be better. The buffer gets destroyed anyway, so I can't figure out why the undo is needed. Once I've done some more testing to check that things are working correctly (for me, at least), I'll try and figure out a patch that does the same couple of fixes, without interfering with any code shared with the other MUAs. |
Also, it seems that |
Yes - I meant that the read-only property must get over-ridden when using vanilla mu4e - because the "text is read-only" error doesn't happen then - but that doesn't happen when using org-msg. I've not yet been able to find where the critical difference is. |
I see this delimit/undelimit function is added to before/after-save hooks, maybe it's related. |
I'll have to look at it again, but I think that still gets called when using org-msg, although maybe not, as it's on the save hook. But you're likely right and that is the function that stops the error with plain mu4e. I guess adding that function to the before-save-hook in org-msg could work then. |
I couldn't work out how to get that delimit/undelimit function to fix the read-only error. I guess it's probably possible, and I didn't try very hard - I'm pretty tired this evening. Instead, I went back to my sledgehammer of simply removing all read-only text properties from the buffer. And, I couldn't figure out what was causing the undo in I guess both of these decisions could cause problems if, for example, the message aborts before sending. I'm not sure how I can best simulate that. But, I just wanted things to work. I'm going to test some more tomorrow, to see that things are working. Then I'll create a PR, over the weekend possibly. It's just occured to me that the undo might be failing because |
with mu4e shifting more and more functionality to re-use Gnus' Message-mode, to what extent can org-msg's current Message mode support be leverage? |
No description provided.