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

Draft message body becomes read-only/uneditable sometimes #128

Open
analyticd opened this issue Nov 18, 2019 · 0 comments
Open

Draft message body becomes read-only/uneditable sometimes #128

analyticd opened this issue Nov 18, 2019 · 0 comments

Comments

@analyticd
Copy link

analyticd commented Nov 18, 2019

System: MacOS High Sierra using the latest Mew from the git repo and Emacs 26.2.

Problem:

Intermittently, but consistently once it first happens (until a restart of Emacs), when creating a mail message, new or in reply etc, I am getting a read only error when attempting to edit the body of the resulting draft message. I can edit the header of the email, however, just not the body of the draft.
There seem to be two ways this problem can manifest:

  1. (In a minimal Emacs config with only Mew loaded) After a long series of replies with perhaps the first 10 to 20 working fine.

Details for this case:

At least once, I found the problem first manifests when you try to create a draft, say in reply to an email or via 'w', and that goes fine. You C-c C-c to send it, and then the minibuffer returns 'nil' (despite prior sends succeeding) and the draft does not go away, i.e., you stay in its buffer. Subsequent check reveals that it wasn't sent. All subsequent attempts to edit the body portion of any message (header is still editable) for this draft or any other draft fails with a message in the minibuffer about the text being read-only.

With mew-debug set to t, here is a Messages buffer log excerpt from the aforementioned failing sequence of events. In this particular case, I can edit the draft body successfully, but I get this error when I attempt to send the message via C-c C-c and 'y':

   Connecting to the IMAP server...done
    Communicating with the IMAP server...
    Retrieving 1 message in background...
    1 message retrieved
    (New file)             <--------- Here is create a reply to the newly received message
    Saving file /Users/username/Mail/mew/draft/1...
    Wrote /Users/username/Mail/mew/draft/1
    Draft is prepared
    Really send this message? (y or n) y
    Saving file /Users/username/Mail/mew/draft/1...
    Wrote /Users/username/Mail/mew/draft/1
    Making a message...
    let*: Text is read-only   <--- This, apparently, is where the issue occurs. Not sure in Mew's code where this occurs. 

  1. (In my usual maximal Emacs config with evil-mode, org-mode, etc. loaded) Right away in the first reply to an email most times.

Relevant output of Messages log:

Draft is prepared
funcall-interactively: Text is read-only [2 times]

I've bisected my config with respect to (2) trying to identify which package may be interacting to cause this issue and haven't found an obvious offender if there is one at all. Indeed, manifestion (1), above, has happened to me with just Mew loaded and nothing else.

How to reproduce the problem:

Not sure honestly. But, since I'd think we'd want Mew to work with lots of common packages like evil-mode and org-mode, load at least evil-mode and org-mode and then test Mew. If no one else was getting this issue, say, even after a long test reply thread (as I tested between a couple of my own email accounts), then I would have more info to try to debug.

Other possibly not relevant information:

Permissions when this happens look like (notice draft, inbox, postq, queue - all folders that Mew creates - username is a placeholder for my real username):

    /Users/username/Mail/mew:
    total used in directory 40K available 56550100
    drwxr-xr-x  8 username staff  256 Nov 17 16:22  #imap
    drwxr-xr-x 10 username staff  320 Nov 17 16:32 .
    drwxr-xr-x 27 username staff  864 Nov 18 10:43 ..
    drwxr-xr-x  2 username staff   64 Nov 17 12:47  attach
    drwxr-xr-x 79 username staff 2.5K Nov 18 10:31  backup
    drwx------ 12 username staff  384 Nov 18 10:43  draft
    drwx------  4 username staff  128 Nov 18 10:30  inbox
    drwx------  2 username staff   64 Oct 18 18:28  postq
    drwx------  8 username staff  256 Nov 18 10:31  queue
    drwxr-xr-x 79 username staff 2.5K Nov 18 10:26  trash

and within the draft folder, after several failed draft edits and/or sends things look like:

  /Users/username/Mail/mew/draft:
  total used in directory 128K available 47213328
  drwx------ 33 username staff 1.1K Nov 22 12:29 .
  drwxr-xr-x 10 username staff  320 Nov 17 16:32 ..
  -rw-r--r--  1 username staff 1.7K Nov 18 13:38  #1
  -rw-r--r--  1 username staff  679 Nov 18 13:54  #2
  -rw-r--r--  1 username staff  683 Nov 18 13:55  #3
  -rw-r--r--  1 username staff  428 Nov 21 21:19  #4
  -rw-r--r--  1 username staff  428 Nov 21 21:19  #5
  -rw-r--r--  1 username staff  378 Nov 21 21:20  #6
  -rw-r--r--  1 username staff  107 Nov 22 11:30  #7
  -rw-r--r--  1 username staff  342 Nov 22 12:29  #8
  -rw-------  1 username staff   15 Nov 22 12:29  .mew-mtime
  -rw-------  1 username staff   10 Nov 18 13:31  .mew-sinfo
  -rw-------  1 username staff   51 Nov 18 13:31  .mew-sinfo.old
  -rw-------  1 username staff    0 Nov 18 13:31  .mew-summary
  -rw-------  1 username staff 1.7K Nov 18 13:38  1
  -rw-------  1 username staff  170 Nov 18 13:38  1.mdi
  -rw-r--r--  1 username staff  284 Nov 18 08:44  1~
  -rw-------  1 username staff  679 Nov 18 13:54  2
  -rw-------  1 username staff  172 Nov 18 13:54  2.mdi
  -rw-r--r--  1 username staff  385 Nov 18 10:42  2~
  -rw-------  1 username staff  683 Nov 18 13:55  3
  -rw-------  1 username staff  172 Nov 18 13:55  3.mdi
  -rw-------  1 username staff  428 Nov 21 21:19  4
  -rw-------  1 username staff   69 Nov 21 21:19  4.mdi
  -rw-------  1 username staff  428 Nov 21 21:19  5
  -rw-------  1 username staff   69 Nov 21 21:19  5.mdi
  -rw-------  1 username staff  378 Nov 21 21:20  6
  -rw-------  1 username staff   69 Nov 21 21:20  6.mdi
  -rw-------  1 username staff  107 Nov 22 11:30  7
  -rw-------  1 username staff   69 Nov 22 11:30  7.mdi
  -rw-------  1 username staff  342 Nov 22 12:29  8
  -rw-------  1 username staff   69 Nov 22 12:29  8.mdi
  -rw-------  1 username staff  107 Nov 22 11:32  8~

Update & workaround for now:

For now, I launch another Emacs that loads a minimalist config with just Mew (no evil-mode, no org-mode, etc.):

#!/bin/bash
~/.nix-profile/Applications/Emacs.app/Contents/MacOS/Emacs -q -l slim-init.el

As per (1), this still does not resolve the issue permanently, but does allow me to use Mew mostly without issues. The problem is intermittent with either my regular config or the minimal config (takes longer too manifest in the minimal config as opposed to immediately in my usual config) and therefore difficult to debug. If the problem manifests, I can usually restart Emacs and then Mew will behave properly for some unknown amount of time.

I also have Gnus and notmuch working fine, but I really like Mew!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant