-
Notifications
You must be signed in to change notification settings - Fork 42
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
Getting error Invalid coding system: auto-save-coding
when running recover-this-file
on certain files
#10
Comments
Same here. |
Same also, Ubuntu w/ Emacs 24.5.3 and wakatime 1.0.2 |
Same here, Gentoo, Emacs 25.2.1 |
So the issue appears to be in how wakatime calls out to the shell from an auto-save buffer during restore. However, there's no reason to log time spent in those buffers, so just excluding from consideration seems to resolve the issue e.g.: ;; override package functions to avoid auto-save buffers and auto-save-coding issue
(defun wakatime-ping ()
"Send ping notice to WakaTime."
(when (and
(buffer-file-name (current-buffer))
(not (auto-save-file-name-p (buffer-file-name (current-buffer)))))
(wakatime-call nil)))
(defun wakatime-save ()
"Send save notice to WakaTime."
(when (and
(buffer-file-name (current-buffer))
(not (auto-save-file-name-p (buffer-file-name (current-buffer)))))
(wakatime-call t))) I'll put in a PR when I have time. |
Added the change with 2531cb5. |
I just ran into this. Wakatime version 1.0.2 so I'm not sure if I have the latest commit. Installed through Melpa. |
I ran into this just now. The commit mentioned above is included in my |
Yea, it must be related to something else. Maybe a race condition and the above commit just reduces the chances of it triggering? |
Running into this issue as well. |
'auto-save-coding is a pseudo-coding-system used in (recover-file FILE). This error occurs when attempting to evaluate it as a coding-system outside of the recover-file function.
|
@h2oota Have you submitted a pull request yet? I have not tested it yet, because it would dirty wakatime-mode's source tree in my package management system. |
Added the patch with aa04a55. |
Thanks @alanhamlett! |
Thanks @alanhamlett!. It works perfectory. BTW, I don't think 2531cb5 is necessary. It should be reverted. The only situation where the conditional expression for this modification would hold is if you opened the autosave file directly, in which case the action that we opened the autosave file should be recorded. |
Thanks, reverted it with 25fb775. |
Sometimes when I try to run
recover-this-file
I get an errorInvalid coding system: auto-save-coding
which prevents the file from being recovered. I had to manually find the autosave file and copy contents. After some debugging efforts, I discovered that if I disable wakatime then this wouldn't happen on the same file, when I switch it on again it happens again, so I currently think this is a bug of wakatime. Strangely it doesn't happen to all of myrecover-this-file
attempts and I'm not sure what's different in the problematic files from the rest.I'm using Emacs 24.5 on OS X Yosemite, with Spacemacs
The text was updated successfully, but these errors were encountered: