Skip to content
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

Read only error when running mu4e-view-rendered-hook #2500

Closed
thierryvolpiatto opened this issue Jun 8, 2023 · 2 comments
Closed

Read only error when running mu4e-view-rendered-hook #2500

thierryvolpiatto opened this issue Jun 8, 2023 · 2 comments
Labels
bug mu4e specific for mu4e new

Comments

@thierryvolpiatto
Copy link
Contributor

Describe the bug

The hook mu4e-view-rendered-hook runs outside the inhibit-read-only let body hence this error:

error in process filter: smiley-buffer: Buffer is read-only: #<buffer mu4e-article>

advising smiley-buffer which is added to mu4e-view-rendered-hook in my config fixes the bug.

How to Reproduce

Add smiley-buffer to mu4e-view-rendered-hook.

Environment

LinuxMint, emacs-28

Checklist

  • [ X] you are running either an 1.8.x/1.10.x release or master (otherwise please upgrade)
  • [ X] you can reproduce the problem without 3rd party extensions (including Doom/Evil, various extensions etc.)
  • [ X] you have read all of the above
@thierryvolpiatto thierryvolpiatto added bug mu4e specific for mu4e new labels Jun 8, 2023
@thierryvolpiatto
Copy link
Contributor Author

Probably this patch fixes it (fully not tested):

diff --git a/mu4e/mu4e-view.el b/mu4e/mu4e-view.el
index ce71d17a..0b0b31e0 100644
--- a/mu4e/mu4e-view.el
+++ b/mu4e/mu4e-view.el
@@ -651,7 +651,8 @@ As a side-effect, a message that is being viewed loses its
         (mu4e-error "Cannot get a message view"))
       (select-window mu4e~headers-view-win)))
   (with-current-buffer gnus-article-buffer
-    (run-hooks 'mu4e-view-rendered-hook)))
+    (let ((inhibit-read-only t))
+      (run-hooks 'mu4e-view-rendered-hook))))
 
 (defun mu4e-view-message-text (msg)
   "Return the pristine MSG as a string."

@djcb
Copy link
Owner

djcb commented Jun 8, 2023

Yeah, making it read-write is probably the more useful behavior. I'll push a fix.

@djcb djcb closed this as completed in 713bb4e Jun 8, 2023
djcb added a commit that referenced this issue Jun 22, 2023
Non-read-only is likely the expected behavior.

Fixes #2500.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mu4e specific for mu4e new
Projects
None yet
Development

No branches or pull requests

2 participants