X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/cc390e46c7ba95b76ea133d98fd386214cd01709..6e9ddbb313cf7db66550f93a74cbba12e39e93c0:/lisp/cedet/cedet-idutils.el diff --git a/lisp/cedet/cedet-idutils.el b/lisp/cedet/cedet-idutils.el index 44c325b78c..b35035a58b 100644 --- a/lisp/cedet/cedet-idutils.el +++ b/lisp/cedet/cedet-idutils.el @@ -1,6 +1,6 @@ ;;; cedet-idutils.el --- ID Utils support for CEDET. -;; Copyright (C) 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 2009-2012 Free Software Foundation, Inc. ;; Author: Eric M. Ludlam ;; Version: 0.2 @@ -44,6 +44,11 @@ :type 'string :group 'cedet) +(defcustom cedet-idutils-make-command "mkid" + "Command name for the ID Utils executable for creating token databases." + :type 'string + :group 'cedet) + (defun cedet-idutils-search (searchtext texttype type scope) "Perform a search with ID Utils, return the created buffer. SEARCHTEXT is text to find. @@ -79,7 +84,7 @@ Note: Scope is not yet supported." (defun cedet-idutils-fnid-call (flags) "Call ID Utils fnid with the list of FLAGS. -Return the created buffer with with program output." +Return the created buffer with program output." (let ((b (get-buffer-create "*CEDET fnid*")) (cd default-directory) ) @@ -105,6 +110,20 @@ Return the created buffer with with program output." flags) b)) +(defun cedet-idutils-mkid-call (flags) + "Call ID Utils mkid with the list of FLAGS. +Return the created buffer with program output." + (let ((b (get-buffer-create "*CEDET mkid*")) + (cd default-directory) + ) + (with-current-buffer b + (setq default-directory cd) + (erase-buffer)) + (apply 'call-process cedet-idutils-make-command + nil b nil + flags) + b)) + ;;; UTIL CALLS ;; (defun cedet-idutils-expand-filename (filename) @@ -144,8 +163,8 @@ the error code." (defun cedet-idutils-version-check (&optional noerror) "Check the version of the installed ID Utils command. -If optional programatic argument NOERROR is non-nil, then -instead of throwing an error if Global isn't available, then +If optional programmatic argument NOERROR is non-nil, +then instead of throwing an error if Global isn't available, return nil." (interactive) (require 'inversion) @@ -172,8 +191,13 @@ return nil." (message "ID Utils %s - Good enough for CEDET." rev)) t))))) +(defun cedet-idutils-create/update-database (&optional dir) + "Create an IDUtils database in DIR. +IDUtils must start from scratch when updating a database." + (interactive "DDirectory: ") + (let ((default-directory dir)) + (cedet-idutils-mkid-call nil))) (provide 'cedet-idutils) -;; arch-tag: 663ca082-5b3d-4384-8710-cc74f990b501 ;;; cedet-idutils.el ends here