"Call godef, acquiring definition position and expression
description at POINT."
(if (go--xemacs-p)
- (message "godef does not reliably work in XEmacs, expect bad results"))
- (if (not buffer-file-name)
- (message "Cannot use godef on a buffer without a file name")
+ (error "godef does not reliably work in XEmacs, expect bad results"))
+ (if (not (buffer-file-name (go--coverage-origin-buffer)))
+ (error "Cannot use godef on a buffer without a file name")
(let ((outbuf (get-buffer-create "*godef*")))
(with-current-buffer outbuf
(erase-buffer))
- (call-process-region (point-min) (point-max) "godef" nil outbuf nil "-i" "-t" "-f" (file-truename buffer-file-name) "-o" (number-to-string (go--position-bytes (point))))
+ (call-process-region (point-min)
+ (point-max)
+ "godef"
+ nil
+ outbuf
+ nil
+ "-i"
+ "-t"
+ "-f"
+ (file-truename (buffer-file-name (go--coverage-origin-buffer)))
+ "-o"
+ (number-to-string (go--position-bytes (point))))
(with-current-buffer outbuf
(split-string (buffer-substring-no-properties (point-min) (point-max)) "\n")))))