summaryrefslogtreecommitdiff
path: root/misc/emacs/go-mode.el
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-06-30 15:34:22 +0200
committerOndřej Surý <ondrej@sury.org>2011-06-30 15:34:22 +0200
commitd39f5aa373a4422f7a5f3ee764fb0f6b0b719d61 (patch)
tree1833f8b72a4b3a8f00d0d143b079a8fcad01c6ae /misc/emacs/go-mode.el
parent8652e6c371b8905498d3d314491d36c58d5f68d5 (diff)
downloadgolang-upstream/58.tar.gz
Imported Upstream version 58upstream/58
Diffstat (limited to 'misc/emacs/go-mode.el')
-rw-r--r--misc/emacs/go-mode.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/misc/emacs/go-mode.el b/misc/emacs/go-mode.el
index 692cabfe5..03f0a2a8b 100644
--- a/misc/emacs/go-mode.el
+++ b/misc/emacs/go-mode.el
@@ -507,7 +507,9 @@ Replace the current buffer on success; display errors on failure."
(let ((srcbuf (current-buffer)))
(with-temp-buffer
(let ((outbuf (current-buffer))
- (errbuf (get-buffer-create "*Gofmt Errors*")))
+ (errbuf (get-buffer-create "*Gofmt Errors*"))
+ (coding-system-for-read 'utf-8) ;; use utf-8 with subprocesses
+ (coding-system-for-write 'utf-8))
(with-current-buffer errbuf (erase-buffer))
(with-current-buffer srcbuf
(save-restriction
@@ -521,7 +523,7 @@ Replace the current buffer on success; display errors on failure."
(erase-buffer)
(insert-buffer-substring outbuf)
(goto-char (min old-point (point-max)))
- (if old-mark (set-mark (min old-mark (point-max))))
+ (if old-mark (push-mark (min old-mark (point-max)) t))
(kill-buffer errbuf))
;; gofmt failed: display the errors