]> Cypherpunks repositories - gostls13.git/commitdiff
misc/emacs: bug fix: use UTF-8 when invoking gofmt as a subprocess.
authorSameer Ajmani <ajmani@gmail.com>
Fri, 13 May 2011 15:05:03 +0000 (11:05 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 13 May 2011 15:05:03 +0000 (11:05 -0400)
Without this, Unicode characters are stripped out by M-x gofmt.

R=rsc, amdragon
CC=golang-dev
https://golang.org/cl/4523065

misc/emacs/go-mode-load.el
misc/emacs/go-mode.el

index 0ace46dfa99221c852c0c18a85f1168a906d92b1..d453166a45c2a10c48d0312aeef57cad445c89b1 100644 (file)
@@ -19,7 +19,7 @@
 
 \f
 ;;;### (autoloads (gofmt-before-save gofmt go-mode) "go-mode" "go-mode.el"
-;;;;;;  (19847 61431))
+;;;;;;  (19917 17808))
 ;;; Generated autoloads from go-mode.el
 
 (autoload 'go-mode "go-mode" "\
index 692cabfe583859bee1f5fa4691191f977e577962..532f464ed9479ad157d68ecc70e30dee876eaa95 100644 (file)
@@ -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