Created
January 1, 2015 19:13
-
-
Save signalpillar/49fe83b16644de5fff7d to your computer and use it in GitHub Desktop.
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 rebuild-python-tags () | |
| "Rebuild TAGS for the current projectile project and chosen venv. | |
| Dependencies: projectile, elpy, etags (shell command)." | |
| (interactive) | |
| (call-interactively 'pyvenv-workon) | |
| (let ((python-files-locations (list (projectile-project-root) pyvenv-virtual-env)) | |
| (output-file-path (concat (projectile-project-root) "TAGS"))) | |
| (message (format "Remove initial TAGS file: %s" output-file-path)) | |
| (shell-command (format "rm %s| true" output-file-path)) | |
| (loop for base-dir in python-files-locations collect | |
| (let ((cmd (format | |
| "find %s -type f -name '*.py' | xargs etags --append --language=python --output=%s" | |
| base-dir output-file-path))) | |
| (message cmd) | |
| (shell-command cmd))) | |
| (message "Regenerated %s!" output-file-path))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment