aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Eurin <jmeurin@google.com>2012-06-13 16:25:00 -0400
committerSameer Ajmani <sameer@golang.org>2012-06-13 16:25:00 -0400
commit4a0549ffc6612f0b2490e552120ece5d24b70b09 (patch)
tree362414901f06c18078b8bfe1421f7c444f289f3e
parent95c8f44f3a25542f2c1800f1b50a3ee582620d49 (diff)
downloadgo-4a0549ffc6612f0b2490e552120ece5d24b70b09.tar.gz
go-4a0549ffc6612f0b2490e552120ece5d24b70b09.zip
[release-branch.go1] misc/emacs: Fix a failure when /tmp/<file>.go exists.
««« backport 903a3cdd92cf misc/emacs: Fix a failure when /tmp/<file>.go exists. R=sameer CC=golang-dev https://golang.org/cl/6296060 »»»
-rw-r--r--misc/emacs/go-mode.el9
1 files changed, 3 insertions, 6 deletions
diff --git a/misc/emacs/go-mode.el b/misc/emacs/go-mode.el
index c750696512..214c196850 100644
--- a/misc/emacs/go-mode.el
+++ b/misc/emacs/go-mode.el
@@ -817,13 +817,10 @@ Replace the current buffer on success; display errors on failure."
(defun gofmt-apply-patch (filename srcbuf patchbuf)
(require 'diff-mode)
- ;; apply all the patch hunks and restore the mark and point
+ ;; apply all the patch hunks
(with-current-buffer patchbuf
- (let ((filename (file-name-nondirectory filename))
- (min (point-min)))
- (replace-string gofmt-stdin-tag filename nil min (point-max))
- (replace-regexp "^--- /tmp/gofmt[0-9]*" (concat "--- /tmp/" filename)
- nil min (point-max)))
+ (replace-regexp "^--- /tmp/gofmt[0-9]*" (concat "--- " filename)
+ nil (point-min) (point-max))
(condition-case nil
(while t
(diff-hunk-next)