diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2010-09-23 15:00:31 -0400 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2010-09-23 15:00:31 -0400 |
commit | 266a86bd7fedf743225c2497956b73ecb2245196 (patch) | |
tree | 7d0c8b128070eac293ce2606acb4e55de5843ba8 /lisp/cedet/cedet-cscope.el | |
parent | 29cdc13ed61e5a64ba30df1030029898a26b7947 (diff) | |
parent | af3ccb5cc061bccab1c9b024ea444d01c0767767 (diff) | |
download | emacs-266a86bd7fedf743225c2497956b73ecb2245196.tar.gz |
Merge changes from emacs-23 branch
Diffstat (limited to 'lisp/cedet/cedet-cscope.el')
-rw-r--r-- | lisp/cedet/cedet-cscope.el | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/lisp/cedet/cedet-cscope.el b/lisp/cedet/cedet-cscope.el index 18cb7071d5c..211c7fb4b01 100644 --- a/lisp/cedet/cedet-cscope.el +++ b/lisp/cedet/cedet-cscope.el @@ -73,6 +73,12 @@ SCOPE is the scope of the search, such as 'project or 'subdirs." ) (cedet-cscope-call (list "-d" "-L" idx searchtext)))) +(defun cedet-cscope-create (flags) + "Create a CScope database at the current directory. +FLAGS are additional flags to pass to cscope beyond the +options -cR." + (cedet-cscope-call (append (list "-cR") flags))) + (defun cedet-cscope-call (flags) "Call CScope with the list of FLAGS." (let ((b (get-buffer-create "*CEDET CScope*")) @@ -113,13 +119,19 @@ Return a fully qualified filename." If DIR is not supplied, use the current default directory. This works by running cscope on a bogus symbol, and looking for the error code." + (interactive "DDirectory: ") (save-excursion (let ((default-directory (or dir default-directory))) (set-buffer (cedet-cscope-call (list "-d" "-L" "-7" "moose"))) (goto-char (point-min)) - (if (looking-at "[^ \n]*cscope: ") - nil - t)))) + (let ((ans (looking-at "[^ \n]*cscope: "))) + (if (called-interactively-p 'interactive) + (if ans + (message "No support for CScope in %s" default-directory) + (message "CScope is supported in %s" default-directory)) + (if ans + nil + t)))))) (defun cedet-cscope-version-check (&optional noerror) "Check the version of the installed CScope command. @@ -151,6 +163,14 @@ return nil." (message "CScope %s - Good enough for CEDET." rev)) t))))) +(defun cedet-cscope-create/update-database (&optional dir) + "Create a CScope database in DIR. +CScope will automatically choose incremental rebuild if +there is already a database in DIR." + (interactive "DDirectory: ") + (let ((default-directory dir)) + (cedet-cscope-create nil))) + (provide 'cedet-cscope) ;; arch-tag: 9973f1ad-f13b-4399-bc67-7f488478d78d |