1
0
mirror of https://github.com/golang/go synced 2024-11-25 06:57:58 -07:00

misc/emacs: bug fix: use UTF-8 when invoking gofmt as a subprocess.

Without this, Unicode characters are stripped out by M-x gofmt.

R=rsc, amdragon
CC=golang-dev
https://golang.org/cl/4523065
This commit is contained in:
Sameer Ajmani 2011-05-13 11:05:03 -04:00 committed by Russ Cox
parent 05a1b7ec41
commit cc5ac676da
2 changed files with 4 additions and 2 deletions

View File

@ -19,7 +19,7 @@
;;;### (autoloads (gofmt-before-save gofmt go-mode) "go-mode" "go-mode.el" ;;;### (autoloads (gofmt-before-save gofmt go-mode) "go-mode" "go-mode.el"
;;;;;; (19847 61431)) ;;;;;; (19917 17808))
;;; Generated autoloads from go-mode.el ;;; Generated autoloads from go-mode.el
(autoload 'go-mode "go-mode" "\ (autoload 'go-mode "go-mode" "\

View File

@ -507,7 +507,9 @@ Replace the current buffer on success; display errors on failure."
(let ((srcbuf (current-buffer))) (let ((srcbuf (current-buffer)))
(with-temp-buffer (with-temp-buffer
(let ((outbuf (current-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 errbuf (erase-buffer))
(with-current-buffer srcbuf (with-current-buffer srcbuf
(save-restriction (save-restriction