bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#14436: 24.3.50; cscope + compilation-mode


From: Jambunathan K
Subject: bug#14436: 24.3.50; cscope + compilation-mode
Date: Wed, 22 May 2013 11:57:03 +0530

Being a C programmer, I always missed not having support for cscope "out
of the box" in my vanilla Emacs.  It is unfortunate that xcscope.el is
not part of Emacs proper.

Here is a quick and dirty means to alleviate this drawback and make
cscope "one another" search engine (similar to rgrep etc).

This bug is a continuation of my earlier bug#13459.  Ideally I want to
be able to see the "function context" in search results.  See earlier
screenshot 

http://debbugs.gnu.org/cgi/bugreport.cgi?msg=5;filename=grep-proof-of-concept-cf-cscope.png;att=3;bug=13549

I have more ideas on how the symbol searches could be imporved in
Emacs.  I will document these in future bug reports.

----------------------------------------------------------------

For a first cut, the following works.  Update
`compilation-error-regexp-alist-alist' as below.

=== modified file 'lisp/progmodes/compile.el'
--- lisp/progmodes/compile.el   2013-04-24 13:50:22 +0000
+++ lisp/progmodes/compile.el   2013-05-22 06:03:23 +0000
@@ -447,7 +447,9 @@ File = \\(.+\\), Line = \\([0-9]+\\)\\(?
      ;;
      "^\\([^ \t\r\n(]+\\) (\\([0-9]+\\):\\([0-9]+\\)) "
      1 2 3)
-    )
+    (cscope
+     "^\\([^ \t]+\\)[ \t]+\\([^ \t]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\(.*\\)\n"
+     1 3))
   "Alist of values for `compilation-error-regexp-alist'.")
 
 (defcustom compilation-error-regexp-alist


While in ~/src/emacs/trunk/src, do

        M-! cscope -f cscope.out -L -0 interval_block

You will see the following in *Shell Command Output*.  Put that in
compilation mode and navigate through the search results the usual way.

--8<---------------cut here---------------start------------->8---
alloc.c <global> 1150 struct interval_block
alloc.c <global> 1154 struct interval_block *next;
alloc.c <global> 1160 static struct interval_block *interval_block;
alloc.c INTERVAL_BLOCK_SIZE 1145 ((1020 - sizeof (struct interval_block *)) / 
sizeof (struct interval))
alloc.c make_interval 1193 struct interval_block *newi
alloc.c make_interval 1196 newi->next = interval_block;
alloc.c make_interval 1197 interval_block = newi;
alloc.c make_interval 1201 val = 
&interval_block->intervals[interval_block_index++];
alloc.c gc_sweep 6227 register struct interval_block *iblk;
alloc.c gc_sweep 6228 struct interval_block **iprev = &interval_block;
alloc.c gc_sweep 6234 for (iblk = interval_block; iblk; iblk = *iprev)
--8<---------------cut here---------------end--------------->8---

In GNU Emacs 24.3.50.1 (i686-pc-linux-gnu, GTK+ Version 2.20.1)
 of 2013-05-20 on debian-6.05
Bzr revision: 112643 address@hidden
Windowing system distributor `The X.Org Foundation', version 11.0.10707000
Important settings:
  value of $LANG: en_IN
  locale-coding-system: iso-latin-1-unix
  default enable-multibyte-characters: t

Major mode: Fundamental

reply via email to

[Prev in Thread] Current Thread [Next in Thread]