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

flycheck-temp-file-system problem in windows editing code from orgmode #983

Closed
guivho opened this Issue Jun 5, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@guivho

guivho commented Jun 5, 2016

This is a Windows only problem, though I hope that the fix is harmless to non-windows environments.
I am running Windows 10 and flymake-21060605.407 in GNU Emacs 25.0.92.1 (x86_64-w64-mingw32) of 2016-03-03.

Flymake works like a charm (thank you guys) a.o. to check .el, .js, .php et al. files.

However, my emacs.el file is generated from an emacs-guivho.org file. When I issue C-' to edit an elisp code block, flycheck barks at me:

Error while checking syntax automatically: (file-error "Opening output file" "Invalid argument" "c:/Users/guivh/emacs-guivho/.flycheck_emacs-guivho.org[*Org Src emacs-guivho.org[ emacs-lisp ]*]")

The problem seems to be the asterisks. I am told that this can easily be fixed by calling convert-standard-filename on the generated tempfile name.

For testing i went to change flycheck-temp-file-system in flycheck.el so that it reads

(setq tempfile (convert-standard-filename (expand-file-name
(file-name-nondirectory filename)
           directory)))

rather than the original

(setq tempfile (expand-file-name (file-name-nondirectory filename)
           directory))

I than edebugged the flycheck-temp-file-system with the "c:/Users/guivh/emacs-guivho/.flycheck_emacs-guivho.org[Org Src emacs-guivho.org[ emacs-lisp ]]") filename, and it nicely produced a tempfile where the '*'s are replaced by '!'s.

Still, when editing elisp blocks from my elisp.org files, I keep hitting the '*' problem...

Would it be possible that such a change could be incorporated into flycheck? The description of convert-standard-filename states that it just returns the given filename in non-windows environments. It would solve the problem for us windows users though.

TIA,

Guido

@lunaryorn

This comment has been minimized.

Contributor

lunaryorn commented Jun 5, 2016

@guivho Thanks for reporting this issue. While we normally don't try and fix Windows issues the fix you proposed looks simple enough, and I've applied it to master.

I can't test it, obviously; please tell me whether the fix works.

Another thing: In future please use Github's Markdown markup to format your posts and comments on Github. Adding markup to code and error messages preserves formatting and indentation—which is particularly important for source code and backtraces—and makes posts easier to read overall.

@guivho

This comment has been minimized.

guivho commented Jun 5, 2016

Thanks
Wildo

Guido

@guivho

This comment has been minimized.

guivho commented Jun 6, 2016

@lunaryorn,

installed version 20160606 and it no longer complains aboout filenames, works like a charm!

Thank you so much!

Guido

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment