cmd/oracle: emacs: look for oracle on $PATH and nowhere else
Change-Id: Ifbc8e3ff6fe22a56e29fe7ba8004510cb0cee343 Reviewed-on: https://go-review.googlesource.com/9687 Reviewed-by: Dominik Honnef <dominik@honnef.co> Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
parent
fb47c16287
commit
d00f0cb57d
|
@ -22,25 +22,8 @@
|
||||||
"Options specific to the Go oracle."
|
"Options specific to the Go oracle."
|
||||||
:group 'go)
|
:group 'go)
|
||||||
|
|
||||||
(defcustom go-oracle-command
|
(defcustom go-oracle-command "oracle"
|
||||||
(let* ((dirs (go-root-and-paths))
|
"The Go oracle command."
|
||||||
(gopath (cdr dirs))
|
|
||||||
(gobin (getenv "GOBIN"))
|
|
||||||
(goroot-cmd (concat (car dirs) "/bin/oracle"))
|
|
||||||
cmd)
|
|
||||||
(if gobin
|
|
||||||
(let ((gobin-cmd (concat gobin "/oracle")))
|
|
||||||
(if (file-executable-p gobin-cmd)
|
|
||||||
(setq cmd gobin-cmd)))) ; use $GOBIN/oracle if executable
|
|
||||||
(and (null cmd)
|
|
||||||
gopath
|
|
||||||
(let ((gopath-cmd (concat (car gopath) "/bin/oracle")))
|
|
||||||
(if (file-executable-p gopath-cmd)
|
|
||||||
(setq cmd gopath-cmd)))) ; use GOPATH[0]/bin if executable
|
|
||||||
(or cmd goroot-cmd)) ; use $GOROOT/bin by default
|
|
||||||
"The Go oracle command. The following directories are
|
|
||||||
searched: (1) $GOBIN; (2) dir/bin, where dir is the first
|
|
||||||
directory on $GOPATH; (3) $GOROOT/bin."
|
|
||||||
:type 'string
|
:type 'string
|
||||||
:group 'go-oracle)
|
:group 'go-oracle)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue