comparison .elisp/settings/80.go.el @ 288:e00b19603472

go.el: Fix some bugs exposed on a new machine.
author Augie Fackler <raf@durin42.com>
date Fri, 15 Jun 2012 15:43:51 -0500
parents d77b2e253e99
children a8caf664abdc
comparison
equal deleted inserted replaced
287:5d83e487611c 288:e00b19603472
7 (setq whitespace-style '(trailing lines-tail indentation trailing empty)) 7 (setq whitespace-style '(trailing lines-tail indentation trailing empty))
8 ) 8 )
9 9
10 (defun af-get-go-elisp-location () 10 (defun af-get-go-elisp-location ()
11 (let* ((gobinary (shell-command-to-string "which go")) 11 (let* ((gobinary (shell-command-to-string "which go"))
12 (gobin (substring (file-name-directory gobinary) 0 -1)) 12 (gobin (substring (let ((x (file-name-directory gobinary)))
13 (if x x "z")) 0 -1))
13 (goroot (file-name-directory gobin))) 14 (goroot (file-name-directory gobin)))
14 (concat goroot "misc/emacs"))) 15 (if goroot (concat goroot "misc/emacs") "")))
15 16
16 (defun af-get-gocode-elisp-location () 17 (defun af-get-gocode-elisp-location ()
17 (let* ((binary (shell-command-to-string "which gocode")) 18 (let* ((binary (shell-command-to-string "which gocode"))
18 (bin (substring (file-name-directory binary) 0 -1)) 19 (bin (substring (let ((x (file-name-directory binary)))
20 (if x x "z")) 0 -1))
19 (basedir (file-name-directory bin))) 21 (basedir (file-name-directory bin)))
20 (concat basedir "src/github.com/nsf/gocode/emacs-company/"))) 22 (if basedir
23 (concat basedir "src/github.com/nsf/gocode/emacs-company/")
24 "")))
21 25
22 (let* ((goloc (af-get-go-elisp-location)) 26 (let* ((goloc (af-get-go-elisp-location))
23 (goel (concat goloc "/go-mode.el"))) 27 (goel (concat goloc "/go-mode.el")))
24 (if (file-exists-p goel) 28 (if (file-exists-p goel)
25 (progn 29 (progn