Created
March 13, 2018 19:27
-
-
Save juergenhoetzel/8107a01039df08ea3f1c208494ddd7bf to your computer and use it in GitHub Desktop.
Faster external package indexing for go-mode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun go-packages-find () | |
(sort | |
(delete-dups | |
(cl-mapcan (lambda (topdir) | |
(let ((pkgdir (concat topdir "/pkg"))) | |
(mapcar (lambda (file) | |
(let ((sub (substring file 0 -2))) | |
(mapconcat #'identity (cdr (split-string sub "/")) "/"))) | |
(split-string (shell-command-to-string | |
(format "find \"%s\" -not -path \"%s/tool*\" -not -path \"%s/obj/*\" -name \"*.a\" -printf \"%%P\\n\"" | |
pkgdir pkgdir pkgdir)))))) | |
(go-root-and-paths))) | |
#'string<)) | |
(setq go-packages-function 'go-packages-find) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment