From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Perry Smith Newsgroups: gmane.emacs.help Subject: Re: OT:cscope/tags Date: Tue, 5 Dec 2006 18:31:53 -0600 Message-ID: References: <03veksq9rj.fsf@gmail.com> NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1165365137 2453 80.91.229.10 (6 Dec 2006 00:32:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 6 Dec 2006 00:32:17 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 06 01:32:17 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1Grkhp-000603-ID for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Dec 2006 01:32:13 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Grkho-0001Mn-VE for geh-help-gnu-emacs@m.gmane.org; Tue, 05 Dec 2006 19:32:12 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Grkhc-0001Mi-Ik for help-gnu-emacs@gnu.org; Tue, 05 Dec 2006 19:32:00 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Grkhc-0001MO-2v for help-gnu-emacs@gnu.org; Tue, 05 Dec 2006 19:32:00 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Grkhc-0001MK-0Q for help-gnu-emacs@gnu.org; Tue, 05 Dec 2006 19:32:00 -0500 Original-Received: from [64.192.143.210] (helo=easeserver.easesoftware.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Grkhb-0007A3-Tb for help-gnu-emacs@gnu.org; Tue, 05 Dec 2006 19:32:00 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by easeserver.easesoftware.com (Postfix) with ESMTP id 3B5CE584B6B; Tue, 5 Dec 2006 18:31:59 -0600 (CST) Original-Received: from easeserver.easesoftware.com ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 09692-04; Tue, 5 Dec 2006 18:31:54 -0600 (CST) Original-Received: from [64.192.143.210] (easeserver.easesoftware.com [64.192.143.210]) by easeserver.easesoftware.com (Postfix) with ESMTP id B46FC584B45; Tue, 5 Dec 2006 18:31:54 -0600 (CST) In-Reply-To: Original-To: Hadron Quark X-Mailer: Apple Mail (2.752.2) X-Virus-Scanned: by amavisd-new at easesoftware.net X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:39274 Archived-At: On Dec 5, 2006, at 4:39 PM, Hadron Quark wrote: > Perry Smith writes: > >> cscope. To make the db I use -q. To invoke it via emacs, I use -q >> and -d: >> >> -d Do not update the cross-reference. >> >> -q Enable fast symbol lookup via an inverted > > Just for thread completeness, how do you add these options when > inviking > cscope from emacs? How are you accessing cscope from emacs? Which el > package do you use? Well, its a long story. I created my own cscope.el back in 1990. I'm happy to share it but it has lots of weird twisted gunk in it. I have the concept of an "inherited buffer". Each buffer has a buffer local variable that points back to its inherited buffer. In this way, different buffers can use different cscope's and not get confused between them. At the time, there was a lot of other things that were inherited besides just the cscope information (like build information and that sort of thing). I also have a script called cscope-front (I've appended it to the bottom). I doubt if it will do you much good either except just as a thought of calling cscope via a script and then that script can add and subtract arguments based upon a number of variables. This keeps the lisp code simpler -- I was more comfortable writing shell scripts than lisp code at the time. I create the cscope database via make. The makefile creates a list of files called cscope.files, (usually based upon various make variables), then it calls cscope as: cscope -q -b (The cscope I'm using defaults to looking in cscope.files for the list of files.) From emacs, I call cscope-front (using my cscope.el routines). As you can see, the script has debug output to /tmp/doggy. Here are some sample lines from doggy: /home/pedz/Eclipse/SATA/src a='' p='/home/pedz/Eclipse/SATA/src' /usr/local/bin/cscope -d -q -l -P /home/pedz/Eclipse/SATA/src -f cscope.out The last line is all the args I use to call cscope with. Hopefully, something in here will be useful to you. #!/usr/local/bin/bash # # First arg is the string to pass to setup, second arg is the # directory where the cscope should behave from # a=$1 p=$( echo $2 | sed -e 's%/$%%' ) CSCOPE=/usr/local/bin/cscope shift shift /bin/pwd >> /tmp/doggy echo "a='$a' p='$p'" >> /tmp/doggy if [ -n "$a" ] ; then source ~/.setup $a fi # # DFS permissions are weird and I can execute things even though the # file system says I can not. So I only check to see if the file # exists or not. # if [ -e cscope/bin/cscope ] ; then CSCOPE=cscope/bin/cscope elif [ -e ../cscope/bin/cscope ] ; then CSCOPE=../cscope/bin/cscope elif [ -e ../../cscope/bin/cscope ] ; then CSCOPE=../../cscope/bin/cscope fi echo $CSCOPE -d -q -l -P "$p" "$@" >> /tmp/doggy exec $CSCOPE -d -q -l -P "$p" "$@" 2>>/tmp/doggy # echo $CSCOPE -q -l -P "'$p'" "$@" >> /tmp/doggy # exec $CSCOPE -q -l -P "'$p'" "$@" 2>> /tmp/doggy # echo $CSCOPE -q -l >> /tmp/doggy # $CSCOPE -q -l 2>> /tmp/doggy # /afs/austin/aix/project/aix41C/cscope/bin/cscope -d -q -l \ # -f /afs/austin/aix/project/aix41C/cscope/bos.db # # -P /afs/austin/aix/project/aix41C/build/base