         (shrink-window-if-larger-than-buffer w)
         (set-window-point w (point-min))))))
 
+(defun go-guru--insert-modified-files ()
+  "Insert the contents of each modified Go buffer into the
+current buffer in the format specified by guru's -modified flag."
+  (mapc #'(lambda (b)
+	    (and (buffer-modified-p b)
+		 (buffer-file-name b)
+		 (string= (file-name-extension (buffer-file-name b)) "go")
+		 (progn
+		   (insert (format "%s\n%d\n"
+				   (buffer-file-name b)
+				   (buffer-size b)))
+		   (insert-buffer-substring b))))
+	(buffer-list)))
+
 (defun go-guru-callees ()
   "Show possible callees of the function call at the current point."
   (interactive)

			 (1- (position-bytes (point))))))
         (env-vars (go-root-and-paths))
         (goroot-env (concat "GOROOT=" (car env-vars)))
         (gopath-env (concat "GOPATH=" (mapconcat #'identity (cdr env-vars) ":"))))
    (with-current-buffer (get-buffer-create "*go-guru*")
      (setq buffer-read-only nil)
      (erase-buffer)
      (insert "Go Guru\n")
      (let ((args (list go-guru-command nil t nil
			"-scope" go-guru-scope mode posn)))
        ;; Log the command to *Messages*, for debugging.
        (message "Command: %s:" args)
        (message nil) ; clears/shrinks minibuffer

        (message "Running guru...")
        ;; Use dynamic binding to modify/restore the environment
        (let ((process-environment (list* goroot-env gopath-env process-environment)))
            (apply #'call-process args)))
      (insert "\n")
      (compilation-mode)
      (setq compilation-error-screen-columns nil)

file name with a small hyperlink.  Display the result."
  (if (not buffer-file-name)
      (error "Cannot use guru on a buffer without a file name"))
  (and need-scope
       (string-equal "" go-guru-scope)
       (go-guru-set-scope))
