go.tools/cmd/oracle: cosmetic tweaks to Emacs.

1. call display-buffer after the postprocessing step to avoid display glitch.
2. suppress the postprocessing progress message---it's too verbose.
   (instead I should just make the postprocessing loop faster)

Also: rename channel-peers to just peers for consistency with other commands and documentation.

R=dominik.honnef
CC=golang-dev
https://golang.org/cl/13388044
This commit is contained in:
Alan Donovan 2013-09-03 15:41:05 -04:00
parent d2cdbefbfc
commit 48d14ded32
1 changed files with 8 additions and 7 deletions

View File

@ -106,10 +106,6 @@ result."
(insert "\n") (insert "\n")
(compilation-mode) (compilation-mode)
(setq compilation-error-screen-columns nil) (setq compilation-error-screen-columns nil)
(let ((w (display-buffer (current-buffer))))
(balance-windows)
(shrink-window-if-larger-than-buffer w)
(set-window-point w (point-min)))
;; Hide the file/line info to save space. ;; Hide the file/line info to save space.
;; Replace each with a little widget. ;; Replace each with a little widget.
@ -121,7 +117,7 @@ result."
(while (not (null p)) (while (not (null p))
(let ((np (compilation-next-single-property-change p 'compilation-message))) (let ((np (compilation-next-single-property-change p 'compilation-message)))
;; TODO(adonovan): this can be verbose in the *Messages* buffer. ;; TODO(adonovan): this can be verbose in the *Messages* buffer.
(message "Post-processing link (%d%%)" (/ (* p 100) (point-max))) ;; (message "Post-processing link (%d%%)" (/ (* p 100) (point-max)))
(if np (if np
(when (equal (line-number-at-pos p) (line-number-at-pos np)) (when (equal (line-number-at-pos p) (line-number-at-pos np))
;; np is (typically) the space following ":"; consume it too. ;; np is (typically) the space following ":"; consume it too.
@ -129,7 +125,12 @@ result."
(goto-char np) (goto-char np)
(insert " "))) (insert " ")))
(setq p np))) (setq p np)))
(message nil))))) (message nil))
(let ((w (display-buffer (current-buffer))))
(balance-windows)
(shrink-window-if-larger-than-buffer w)
(set-window-point w (point-min))))))
(defun go-oracle-callees () (defun go-oracle-callees ()
"Show possible callees of the function call at the current point." "Show possible callees of the function call at the current point."
@ -168,7 +169,7 @@ containing the current point."
(interactive) (interactive)
(go-oracle--run "freevars")) (go-oracle--run "freevars"))
(defun go-oracle-channel-peers () (defun go-oracle-peers ()
"Enumerate the set of possible corresponding sends/receives for "Enumerate the set of possible corresponding sends/receives for
this channel receive/send operation." this channel receive/send operation."
(interactive) (interactive)