]> Cypherpunks repositories - gostls13.git/commitdiff
misc/emacs: Fix a failure when /tmp/<file>.go exists.
authorJean-Marc Eurin <jmeurin@google.com>
Wed, 13 Jun 2012 14:25:00 +0000 (10:25 -0400)
committerSameer Ajmani <sameer@golang.org>
Wed, 13 Jun 2012 14:25:00 +0000 (10:25 -0400)
R=sameer
CC=golang-dev
https://golang.org/cl/6296060

misc/emacs/go-mode.el

index c7506965128664789532215c554ccc7d682f4d92..214c196850474ae02053563fd2d1a682086c1242 100644 (file)
@@ -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)