目标:
1)生成索引文件时可以包含java文件;
2)cscope.in.out和cscope.po.out文件,加快cscope的索引速度
3)生成索引文件时,不搜索/usr/include目录
解决方案:
修改cscope-index脚本
#注释原来的代码!
find $DIR \( -type f -o -type l \)
fi
) | \
# egrep -i '\.([chly](xx|pp)*|cc|hh)$' | \
egrep -i '\.([chly](xx|pp)*|cc|hh|java)$' | \
sed -e '/\/CVS\//d' -e '/\/RCS\//d' -e 's/^\.\///' | \
sort > $LIST_FILE
if [ "X$VERBOSE" != "X" ]
then
echo "Creating list of files to index ... done"
fi
if [ "X$LIST_ONLY" != "X" ]
then
exit 0
fi
if [ "X$VERBOSE" != "X" ]
then
echo "Indexing files ..."
fi
#cscope -b -i $LIST_FILE -f $DATABASE_FILE
cscope -bkq -i $LIST_FILE -f $DATABASE_FILE
在emacs中使用时需在.emacs中添加
;;xcscope
(load-file "~/dev-tool/cscope-15.8a/contrib/xcscope/xcscope.el")
(require 'xcscope)
;;设置java文件也可以使用xcscope
(add-hook 'java-mode-hook (function cscope:hook))