]> Cypherpunks repositories - gostls13.git/commit
misc/emacs: Rewrite gofmt to use own function for applying patch instead of using...
authorDominik Honnef <dominik.honnef@gmail.com>
Thu, 7 Mar 2013 18:12:37 +0000 (13:12 -0500)
committerAlan Donovan <adonovan@google.com>
Thu, 7 Mar 2013 18:12:37 +0000 (13:12 -0500)
commit77ddbf1ff0278f7399509014b7078a3364248f67
tree68beca6192e0ad5b945e592fcc110252f701e7cf
parentb000f2286c3c9d462cf390084e1ea4ae16649fe9
misc/emacs: Rewrite gofmt to use own function for applying patch instead of using diff-mode.

    Instead of relying on gofmt's diff output (which is a unified
    diff), we manually invoke diff -n and produce an RCS format diff,
    which can easily be parsed in Emacs, with the go--apply-rcs-patch
    function.

    This fixes undocumented issues with the old implementation such as
    skipping over hunks of changes, and it fixes the documented issue
    of not being able to handle file names that include whitespace.

    It can also apply the patch on a buffer that has no file name
    attached at all.

    Last but not least, it greatly simplifies the gofmt function
    itself.

Fixes #4766.
Fixes #4475.

R=adonovan, cw, patrick.allen.higgins, sameer
CC=golang-dev
https://golang.org/cl/7516046
misc/emacs/go-mode.el