         (error "You must specify a non-empty scope for the Go oracle"))
     (setq go-oracle-scope scope)))
 
-(defun go-oracle--run (mode)
+(defun go-oracle--run (mode &optional need-scope)
   "Run the Go oracle in the specified MODE, passing it the
-selected region of the current buffer.  Process the output to
-replace each file name with a small hyperlink.  Display the
-result."
+selected region of the current buffer.  If NEED-SCOPE, prompt for
+a scope if not already set.  Process the output to replace each
+file name with a small hyperlink.  Display the result."
   (if (not buffer-file-name)
       (error "Cannot use oracle on a buffer without a file name"))
   ;; It's not sufficient to save a modified buffer since if

  "Enumerate the set of possible corresponding sends/receives for
this channel receive/send operation."
  (interactive)
  (go-oracle--run "peers"))

(defun go-oracle-referrers ()
  "Enumerate all references to the object denoted by the selected
identifier."
  (interactive)
  (go-oracle--run "referrers"))

(defun go-oracle-whicherrs ()
  "Show globals, constants and types to which the selected
expression (of type 'error') may refer."
  (interactive)
  (go-oracle--run "whicherrs"))

;; TODO(dominikh): better docstring
(define-minor-mode go-oracle-mode "Oracle minor mode for go-mode

Keys specific to go-oracle-mode:
\\{go-oracle-mode-map}"
  nil " oracle" go-oracle-mode-map)

(provide 'go-oracle)

  ;; disturb the selected region.
  (if (buffer-modified-p)
      (error "Please save the buffer before invoking go-oracle"))
  (and need-scope
       (string-equal "" go-oracle-scope)
       (go-oracle-set-scope))
  (let* ((filename (file-truename buffer-file-name))
         (posflag (if (use-region-p)
                      (format "-pos=%s:#%d,#%d"
