unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#14436: 24.3.50; cscope + compilation-mode
@ 2013-05-22  6:27 Jambunathan K
  2013-05-22 20:12 ` Glenn Morris
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jambunathan K @ 2013-05-22  6:27 UTC (permalink / raw)
  To: 14436

[-- Attachment #1: Type: text/plain, Size: 845 bytes --]


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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-diff, Size: 512 bytes --]

=== 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


[-- Attachment #3: Type: text/plain, Size: 1484 bytes --]



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 mituharu@math.s.chiba-u.ac.jp-20130520031520-pq1c1qjertan94kq
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-11-15  4:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-22  6:27 bug#14436: 24.3.50; cscope + compilation-mode Jambunathan K
2013-05-22 20:12 ` Glenn Morris
2013-05-25 16:48 ` Jambunathan K
2013-11-15  4:48 ` Jambunathan K

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).