Skip to content

Instantly share code, notes, and snippets.

@sluchin
Created April 9, 2013 06:04
Show Gist options
  • Save sluchin/5343312 to your computer and use it in GitHub Desktop.
Save sluchin/5343312 to your computer and use it in GitHub Desktop.
;;; タグ検索
;; GNU Global
;; wget http://tamacom.com/global/global-6.2.8.tar.gz
;; タグファイル作成するコマンド (gtags -v)
(defun make-gtags ()
"Make GTAGS file."
(interactive)
(if (and (executable-find "global") (executable-find "gtags"))
(let* ((default default-directory)
(dir (read-string "Directory: "
default nil default)))
(if (and (file-directory-p dir) (file-readable-p dir))
(let (out
(cmd
(if (file-readable-p
(concat (file-name-as-directory dir) "GTAGS"))
(concat "global -uv")
(concat "gtags -v"))))
(setq out (shell-command-to-string cmd))
(message "%s" cmd)
(unless (string= out "") (message "%s" out)))
(message "no such directory: %s" dir)))
(message "not found gtags")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment