Created
April 18, 2011 09:09
-
-
Save dkruchinin/925042 to your computer and use it in GitHub Desktop.
gnu global incremental update
This file contains 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 gtags-root-dir () | |
"Returns GTAGS root directory or nil if doesn't exist." | |
(with-temp-buffer | |
(if (zerop (call-process "global" nil t nil "-pr")) | |
(buffer-substring (point-min) (1- (point-max))) | |
nil))) | |
(defun gtags-update () | |
"Make GTAGS incremental update" | |
(call-process "global" nil nil nil "-u")) | |
(defun gtags-update-hook () | |
(when (gtags-root-dir) | |
(gtags-update))) | |
(add-hook 'after-save-hook #'gtags-update-hook) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment