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

[mu4e bug] mu4e-view-save-attachments directly overwrite files with the same name #2090

Closed
3 tasks
sdycjsj opened this issue Aug 16, 2021 · 10 comments · Fixed by #2093
Closed
3 tasks

[mu4e bug] mu4e-view-save-attachments directly overwrite files with the same name #2090

sdycjsj opened this issue Aug 16, 2021 · 10 comments · Fixed by #2093
Labels
bug mu4e specific for mu4e new

Comments

@sdycjsj
Copy link

sdycjsj commented Aug 16, 2021

Describe the bug
The function to save attachment in the new gnus view, mu4e-view-save-attachments, does not offer to change file name etc. when file with the same name exists, and just overwrite it.

To Reproduce
Open an email with an attachment; save the attachment; save for a second time.

Environment
Macos, Emacs 28, mu/mu4e 1.6.3

Checklist

  • you are running vanilla emacs (i.e. without Doom, Evil, Spacemacs etc.) (otherwise, please try to reproduce without those
  • you are running mu4e without any third-party extensions (otherwise, please try to reproduce without those)
  • you are running either the latest 1.4.x release, or a 1.5.11+ development release (otherwise, please upgrade).
@sdycjsj sdycjsj added bug mu4e specific for mu4e new labels Aug 16, 2021
@thierryvolpiatto
Copy link
Contributor

thierryvolpiatto commented Aug 16, 2021 via email

@djcb
Copy link
Owner

djcb commented Aug 16, 2021

I think simply replace mm-save-part-to-file with mm-save-part should do the trick, or?

@thierryvolpiatto
Copy link
Contributor

thierryvolpiatto commented Aug 16, 2021 via email

@sdycjsj
Copy link
Author

sdycjsj commented Aug 16, 2021

I think this is a good solution. Thanks.
The behavior in the old viewer is also good, i.e., selecting attachments by their numbers and asking when file with the same name exists.

@djcb
Copy link
Owner

djcb commented Aug 17, 2021

I prefer the latter behavior, that's also consistent with what A <n> s does (and similar to the old-viewer behavior).

@thierryvolpiatto
Copy link
Contributor

thierryvolpiatto commented Aug 17, 2021 via email

@sdycjsj
Copy link
Author

sdycjsj commented Aug 17, 2021

In my use case, in the old viewer, when file with the same name exists and I choose not to overwrite, I am brought back to edit the file name. Btw, I use ivy.

A bit of off topic, talking about ivy, with ivy and the new gnus viewer, there is no candidate to complete when saving attachments. Manually inputting some leading letters and hitting TAB works though.

@thierryvolpiatto
Copy link
Contributor

thierryvolpiatto commented Aug 17, 2021 via email

@djcb
Copy link
Owner

djcb commented Aug 21, 2021

Merged the commit -- thanks!

TBH, it's not my perfect solution, ideally I think mu4e should check whether the file is the same as the to-be-written file, and only in the rare case they're not the same, warn user. Some other day!

Anyway, numbering them at least avoid overwriting for now, so it is an improvement.

@djcb djcb closed this as completed Aug 21, 2021
djcb added a commit that referenced this issue Aug 21, 2021
…ttachments

Create numbered backup of attached file when already exists #2090
@thierryvolpiatto
Copy link
Contributor

thierryvolpiatto commented Aug 21, 2021 via email

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

Successfully merging a pull request may close this issue.

3 participants