Is the concept corect?
My apologies, I may just not understand the idea behind auto-sudoedit, but I do have difficulties understanding the idea behind it:
- I open a file that is rw-r--r-- root:root as user foo. Emacs opens it.
- I try to edit it, but emacs says it's only rw for root, foo can't edit it.
- I try to save it (without editing), emacs says "no need to save, no changes"
Shouldn't auto-sudoedit instead intercept the "find-file" function and say "hey, you won't be able to edit/save this file, do you want to open it as root via tramp instead"?
I can open it as user root.
-rw-r--r-- 1 root root 7 3月 22 16:16 foobar.txt
So I could not understand what the problem was there. It may be because my English skills are not good enough.
No problem, my English is also not very good :) I try again:
- I am user foo
- I open: -rw-r--r-- root root (...) /etc/hosts
- I can see the file contents: 127.0.0.1 localhost localhost.localdomain
- I want to edit the file. Emacs says: "Error! File is read only!"
- I want to save the file with C-x C-s. Emacs says "Error! No changes need to be saved"
How can I edit the file then? As step 3.1 I need to disable read-only-mode.
For "Auto-sudoedit", my idea was to change the algorithm:
- I am user foo
- I open: -rw-r--r-- root root (...) /etc/hosts
- auto-suedit checks:
- Can foo write to the file?
- Yes: Open it
- No: Use tramp sudo to open it
Sorry; is it more clear now?
For "Auto-sudoedit", my idea was to change the algorithm:
I think auto-sudoedit is currently working with that algorithm, so I don't know why it doesn't reopen.