|
Golang |
at Dec 1, 2012 at 12:49 am
|
⇧ |
| |
On Thursday, November 29, 2012 5:34:01 AM UTC-8, Luke Mauldin wrote:Dustin,
I just downloaded a version of the emacs plugin from TIP and I configured
my emacs version to use that plugin. I then followed the same steps I
followed before to edit the file and when I clicked save I still get the
"Gofmt patch" buffer as shown in the screenshot. Is there some command I
need to use to apply the changes or do I need to submit a bug report? I am
attaching a screenshot.
Luke
On Wednesday, November 28, 2012 10:16:09 PM UTC-6, Dustin wrote:Luke Mauldin <lukem...@gmail.com>
writes:
I added that code to my .emacs and now when I save, emacs invokes
gofmt and it shows me the differences but my question is, how do I
apply those differences to the file I am editing and save it? I am
sure there must be some command to do it but I have been unable to
find it.
You may have an older version of the emacs plugin. There was an issue
like this that was fixed a while back.
--
dustin
Answering an earlier question, you can run gofmt over your code in a buffer
as follows
control-x h This is mark-whole-buffer, which sets the region
to be the whole buffer.
control-u This is universal -argument, which alters the
next command
Escape | This is shell-command-on-region, it will prompt
you for a command, and you answer gofmt
This will take your buffer, pass it as stdin to the command, and put the
output back in place of the contents of the buffer. If something goes wrong
then you can just use control-underscore or control-x u or control-/ (or if
you have the menu then "undo" from the edit menu) to get your code back.
--