mirror of
https://github.com/golang/go
synced 2024-11-21 21:24:45 -07:00
misc/emacs: Fix a failure when /tmp/<file>.go exists.
R=sameer CC=golang-dev https://golang.org/cl/6296060
This commit is contained in:
parent
bb3af7554a
commit
44a3a58e45
@ -817,13 +817,10 @@ Replace the current buffer on success; display errors on failure."
|
|||||||
|
|
||||||
(defun gofmt-apply-patch (filename srcbuf patchbuf)
|
(defun gofmt-apply-patch (filename srcbuf patchbuf)
|
||||||
(require 'diff-mode)
|
(require 'diff-mode)
|
||||||
;; apply all the patch hunks and restore the mark and point
|
;; apply all the patch hunks
|
||||||
(with-current-buffer patchbuf
|
(with-current-buffer patchbuf
|
||||||
(let ((filename (file-name-nondirectory filename))
|
(replace-regexp "^--- /tmp/gofmt[0-9]*" (concat "--- " filename)
|
||||||
(min (point-min)))
|
nil (point-min) (point-max))
|
||||||
(replace-string gofmt-stdin-tag filename nil min (point-max))
|
|
||||||
(replace-regexp "^--- /tmp/gofmt[0-9]*" (concat "--- /tmp/" filename)
|
|
||||||
nil min (point-max)))
|
|
||||||
(condition-case nil
|
(condition-case nil
|
||||||
(while t
|
(while t
|
||||||
(diff-hunk-next)
|
(diff-hunk-next)
|
||||||
|
Loading…
Reference in New Issue
Block a user