all repos — archive/dotfiles @ fcc0e0ed5dfe88cb84a5c56d786a062f64b1d78f

Superseded by nixfiles

Emacs: Check before loading oracle-mode
Alan Pearce alan@alanpearce.co.uk
Fri, 27 Mar 2015 14:10:19 +0000
commit

fcc0e0ed5dfe88cb84a5c56d786a062f64b1d78f

parent

03f8973d2c839dad617868338fe918ffc3f34ecb

1 files changed, 5 insertions(+), 4 deletions(-)

jump to
M tag-emacs/emacs.d/init.eltag-emacs/emacs.d/init.el
@@ -879,10 +879,11 @@ (req-package go-mode
   :mode (("\\.go\\'" . go-mode)))
 
-(req-package oracle
-  :load-path ,(expand-file-name "src/code.google.com/p/go.tools/cmd/oracle/oracle.el" (getenv "GOPATH"))
-  :init (progn
-          (add-hook 'go-mode-hook #'go-oracle-mode)))
+(when (file-exists-p "src/code.google.com/p/go.tools/cmd/oracle/oracle.el")
+  (req-package oracle
+    :load-path ,(expand-file-name "src/code.google.com/p/go.tools/cmd/oracle/oracle.el" (getenv "GOPATH"))
+    :init (progn
+            (add-hook 'go-mode-hook #'go-oracle-mode))))
 
 (req-package company-go
   :require go-mode