Closed berkan closed 7 years ago
Thanks. I support this in principle, but there are a couple of small issues with the PR:
xor
, with-suppressed-message
are invalid names, because they lack the mandatory namespace prefix.window-start
and window-end
are not what you want: use point-min
, point-max
unwind-protect
to ensure it gets cleaned up.Hope that helps!
(Also xor
is unused, so should be removed in any case.)
I'm playing with this a bit locally. The use of get-buffer
was wrong, and broke in situations where the elm source is in a subdir, because then file
passed to elm-compile--temporary
is a relative path, and that doesn't match the buffer name -- in general you absolutely cannot assume that the buffer name for a file with a given name will be the same as the name of the file.
In any case, I've fixed this up accordingly and merged it. Thanks for your contribution!
I wanted to be able to add annotations and clean imports without first having to save the buffer.
For example: if I start writing a new function and want
elm-make
to automatically add its annotation, I need to remember to save the file first. I rather I didn't have to do that (nor be prompted to do that).With this change,
elm-compile-clean-imports
andelm-compile-add-annotations
work on unsaved buffer contents:Berkan