diff .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
line wrap: on
line diff
--- a/.elisp/settings/80.go.el
+++ b/.elisp/settings/80.go.el
@@ -9,15 +9,19 @@
 
 (defun af-get-go-elisp-location ()
   (let* ((gobinary (shell-command-to-string "which go"))
-         (gobin (substring (file-name-directory gobinary) 0  -1))
+         (gobin (substring (let ((x (file-name-directory gobinary)))
+                             (if x x "z")) 0  -1))
          (goroot (file-name-directory gobin)))
-    (concat goroot "misc/emacs")))
+    (if goroot (concat goroot "misc/emacs") "")))
 
 (defun af-get-gocode-elisp-location ()
   (let* ((binary (shell-command-to-string "which gocode"))
-         (bin (substring (file-name-directory binary) 0 -1))
+         (bin (substring (let ((x (file-name-directory binary)))
+                               (if x x "z")) 0 -1))
          (basedir (file-name-directory bin)))
-    (concat basedir "src/github.com/nsf/gocode/emacs-company/")))
+    (if basedir
+        (concat basedir "src/github.com/nsf/gocode/emacs-company/")
+      "")))
 
 (let* ((goloc (af-get-go-elisp-location))
        (goel (concat goloc "/go-mode.el")))