]> Cypherpunks repositories - gostls13.git/commitdiff
misc/emacs: Present "godoc" documentation buffers using view-mode.
authorSteven Elliot Harris <seharris@gmail.com>
Wed, 20 Feb 2013 22:42:37 +0000 (14:42 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 20 Feb 2013 22:42:37 +0000 (14:42 -0800)
Mimic the Emacs convention of presenting read-only files meant
for browsing using view-mode, rather than Fundamental mode
which mistakenly allows editing of the "godoc" content.
Fixes #4322.

R=golang-dev, bradfitz, sameer
CC=golang-dev
https://golang.org/cl/7231055

misc/emacs/go-mode.el

index a9d9ef5e00127784877083163fbed1486f24cfcb..6f680b24ada06debb58bfee1dbbd491afe05b172 100644 (file)
@@ -875,7 +875,7 @@ Replace the current buffer on success; display errors on failure."
   (with-current-buffer (process-buffer proc)
     (cond ((string= event "finished\n")  ;; Successful exit.
            (goto-char (point-min))
-           (display-buffer (current-buffer) 'not-this-window))
+           (view-buffer (current-buffer) 'kill-buffer))
           ((not (= (process-exit-status proc) 0))  ;; Error exit.
            (let ((output (buffer-string)))
              (kill-buffer (current-buffer))