Skip to content

Instantly share code, notes, and snippets.

@dkruchinin
Created April 18, 2011 09:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dkruchinin/925042 to your computer and use it in GitHub Desktop.
Save dkruchinin/925042 to your computer and use it in GitHub Desktop.
gnu global incremental update
(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