Coder Social home page Coder Social logo

xcscope.el's Introduction

Overview

This is an emacs interface to the ‘cscope’ source cross-referencing tool (http://cscope.sf.net). It can answer such questions as

  • Where is this variable used?
  • What is the value of this preprocessor symbol?
  • Where is this function in the source files?
  • What functions call this function?
  • What functions are called by this function?
  • Where does the message “out of space” come from?
  • Where is this source file in the directory structure?
  • What files include this header file?
  • Where was this variable assigned-to?

The ‘cscope’ tool does the actual searching and lookup, while xcscope.el provides a convenient interface.

GNU Global support

GNU global (http://www.gnu.org/s/global/) is another source indexer much like cscope. It’s better than cscope in some ways and worse in others. It also provides a compatibility interface to allow it to be used just like cscope. This means that xcscope.el can be used as a front-end to GNU Global. To do that, simply evaluate

(setq cscope-program “gtags-cscope”)

Usage

Quick-start

  1. Install xcscope.el through your system package manager or MELPA, or simply evaluate xcscope.el.
  2. Evaluate
  • (require ‘xcscope)
  • (cscope-setup)

Done! cscope-minor-mode is now hooked to C, C++ and dired modes. Default bindings are all prefixed with C-c s. So, for instance, to find a symbol do C-c s s. This is analogous to the M-. of tags. All results are shown in a new cscope buffer which pops up when needed.

More-detailed usage instructions

When xcscope.el is active, you can just use the keybindings (described below) when looking at source. You can also use the Cscope menu or a mouse pop-up menu (button 3).

When a search is performend, by default xcscope.el will traverse the directory hierarchy upwards, looking for the cscope database. If it doesn’t find it, a new database will be made in the current directory. To create the database in a different (higher) directory, explicitly invoke C-c s I. A currently-existing database can be removed simply by deleting cscope.*. By default, cscope updates the database with every search. This is very convenient, but can be too slow for very large source trees.

The third mouse button is bound to a popup menu for cscope. Shift-mouse button 3 invokes the last find command again. E.g. if you look for the symbol ‘main’ and afterwards you want to look for another symbol, just press Shift and click the third button.

Search results are displayed in a cscope buffer, which pops up when results are available. You can then use button 2 (the middle button) on the mouse to edit the selected file, or you can move the text cursor over a selection and press [Enter]. You can also press [space] to show the result in the other window (cscope buffer stays focused). Alternately, the navigation commands invoked with n/p, show the results too.

Each cscope search adds its results to the cscope buffer. Thus this buffer contains a history of all past searches. These sets of results can be navigated and manupulated similar to patches in diff-mode:

  • n/p navigates over individual results
  • k kills individual results
  • N/P or M-n/M-p navigates over file results
  • M-k kills file results
  • M-N/M-P navigates over result sets
  • M-K kills result sets
  • Navigation from outside the cscope buffer (C-c s n/p/N/P) is restricted to the result set at (point)

Any result set in the cscope buffer can be re-run with the ‘r’ key. This is useful if the sources changed

Keybindings:

All keybindings use the “C-c s” prefix:

C-c s sFind symbol.
C-c s =Find assignments to this symbol
C-c s dFind global definition.
C-c s gFind global definition (alternate binding).
C-c s GFind global definition without prompting.
C-c s cFind functions calling a function.
C-c s CFind called functions (list functions called from a function).
C-c s tFind text string.
C-c s eFind egrep pattern.
C-c s fFind a file.
C-c s iFind files #including a file.

These pertain to navigation through the search results:

C-c s bDisplay cscope buffer.
C-c s BAuto display cscope buffer toggle.
C-c s nNext symbol.
C-c s NNext file.
C-c s pPrevious symbol.
C-c s PPrevious file.
C-c s uPop mark.

These pertain to setting and unsetting the variable, `cscope-initial-directory’, (location searched for the cscope database directory):

C-c s aSet initial directory.
C-c s AUnset initial directory.

These pertain to cscope database maintenance:

C-c s LCreate list of files to index.
C-c s ICreate list and index.
C-c s EEdit list of files to index.
C-c s WLocate this buffer’s cscope directory (“W” –> “where”).
C-c s SLocate this buffer’s cscope directory. (alternate binding: “S” –> “show”).
C-c s TLocate this buffer’s cscope directory. (alternate binding: “T” –> “tell”).
C-c s DDired this buffer’s directory.

Interesting configuration variables:

  • cscope-truncate-lines

    This is the value of `truncate-lines’ to use in cscope buffers; the default is the current setting of `truncate-lines’. This variable exists because it can be easier to read cscope buffers with truncated lines, while other buffers do not have truncated lines.

  • cscope-use-relative-paths

    If non-nil, use relative paths when creating the list of files to index. The path is relative to the directory in which the cscope database will be created. If nil, absolute paths will be used. Absolute paths are good if you plan on moving the database to some other directory (if you do so, you’ll probably also have to modify `cscope-database-regexps’). Absolute paths may also be good if you share the database file with other users (you’ll probably want to specify some automounted network path for this).

  • cscope-index-recursively

    If non-nil, index files in the current directory and all subdirectories. If nil, only files in the current directory are indexed. This variable is only used when creating the list of files to index, or when creating the list of files and the corresponding cscope database.

  • cscope-name-line-width

    The width of the combined “function name:line number” field in the cscope results buffer. If negative, the field is left-justified.

  • cscope-option-….

    Various options passed to the ‘cscope’ process. Controls things like include directories, database compression, database type, etc.

  • cscope-display-cscope-buffer

    If non-nil, display the cscope buffer after each search (default). This variable can be set in order to reduce the number of keystrokes required to navigate through the matches.

Provenance

This is a continuation of the xcscope.el (by Darryl Okahata) that ships in the CVS tree of cscope itself. The code in the cscope tree is stable, so this tree expands on the original source, fixing various bugs and adding features.

New features relative to the cscope CVS tree

  • (cscope-setup) must be called to enable cscope-minor-mode in C and C++ major modes
  • New searches are appended to the cscope buffer, instead of overwriting. The user thus sees a history of cscope search results in this buffer, and is able to navigate through all of them. There is a size limit to keep the buffer from growing out of control.
  • The cscope buffer can be navigated and edited similarly to emacs Diff buffers:
    • n/p navigates over individual results
    • k kills individual results
    • N/P or M-n/M-p navigates over file results
    • M-k kills file results
    • M-N/M-P navigates over result sets
    • M-K kills result sets
    • Navigation from outside the cscope buffer (C-c s n/p/N/P) is restricted to the result set at (point)
  • Previous searches can be re-run with the ‘r’ key in the cscope buffer. These are written in-place, overwriting the older results.
  • Fuzzy matching is now enabled/disabled for specific types of searches. This was implemented earlier, but the implementation had a bug and wasn’t working
  • xcscope.el can now work remotely over TRAMP
  • The cscope-index output now goes to the echo area instead of an explicit new buffer that the user must deal with
  • Fuzzy searching now works for non-trivial regex searches
  • The mouse face respects cscope-use-face
  • Better mouse support:
    • button3 opens a popup menu that runs prompt-less searches
    • shift-button3 reruns the last search on the point. This is thus even more prompt-less
  • Shift-return or Shift-mouse2 now open the result in the same window as the cscope buffer
  • Some bold highlighting in the cscope results: the sought term, the search directory
  • Removed the external ‘cscope-indexer’ script; this is now handled inside xcscope.el. Additionally the list of source directories to ignore and the list of filename extensions to index are now customizable in the emacs customization interface
  • Various cscope options (kernel mode, inverted index, etc) can now be accessed through the emacs variables

License and authorship

xcscope.el was written by Darryl Okahata, with patches contributed by Triet H. Lai and Steven Elliott. Dima Kogan added some features.

xcscope.el is distributed under the terms of version 2 (or later) of the GNU General Public License

Contact

The maintainer is Dima Kogan <[email protected]>

xcscope.el's People

Contributors

asn-d6 avatar bertogg avatar dkogan avatar dme avatar jaalto avatar ptrv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xcscope.el's Issues

navigating function call hierarchy

while tracing a function call flow, we can go up the call-stack via the "cscope-pop-mark", once that is done, the popped mark is lost.

it would be nice if we could have a 'queue' kind of semantics where the call chain can be traversed backwards and forwards as well.

xcscope.el and user-reserved keybindings collision

According to http://www.gnu.org/software/emacs/manual/html_node/elisp/Key-Binding-Conventions.html
C-c , letter being [A-Za-z] are reserved for users.

The keybinding prefix C-c s collides with this convention.

I suggest that this prefix is changed to something else (and perhaps the C-c s binding is kept
as deprecated alternative in case user has not defined C-c s herself), and information is added
how user can re-map C-c s to this keymap if she so chooses (it is reserved for her, anyway).

failed to parse filename

Looks like a regression of commit [b9bd846]:(b9bd846)

I use "emacs -nw" with gtags as cscope backend.
My cpp source file has :

...
// kkk" before void WtRaw::Convert()
#define ConvertFpN(...) 0  // kkk
...

When I try to search text "kkk", I got:
image

While if I revert commit b9bd84, I got correct output:
image

Getting nonsense results

I work on a large codebase, with my cscope database updated nightly. My xcscope is configured only with '(cscope-option-do-not-update-database t).

When I search for a C symbol in xcscope (C-c s s, or M-x cscope-find-this-symbol), I get something like this:

Finding symbol: ODT_SYSTEM_VERSION_ID
Database directory: /home/jlargentaye/trees/b/nvos/
*** nv/cli/def/exe/ip_show_community_list.h:
<global>[31963]                [no] [<UI32>] (p) deny tcp <IP6ADDR> <IP6MASK> neq <UI32> any neq <UI32>

*** nv/lib/odt/rr/.gitignore:
0),[83250]                     (int64_t)(LLONG_MAX),
,[83317]                       (int )(INT_MIN),
Search complete.  Search time = 0.09 seconds.

(there are actually 7 results for this specific search, whittled down for this example)

If I run cscope from the cli (as cscope -d to avoid refreshing the database!), the results are valid:

C symbol: ODT_SYSTEM_VERSION_ID

  File              Function                            Line
0 version_show.h    <global>                               14 cmo_obj_id = ODT_SYSTEM_VERSION_ID);
1 odt_id_exe.h      <global>                              214 #define ODT_SYSTEM_VERSION_ID 1048776
2 cli_parse.c       <global>                            26416 6 ODT_SYSTEM_VERSION_ID

(again, results shortened for this example)

Both xcscope and cli cscope use the same database.

Any hints on how I could debug this? Elisp unfortunately remains mostly opaque to me, and I couldn't immediately find debugging hooks or prints in xcscope.el.

How to change the behavior of quitting cscope display buffer

When press q, the cscope display buffer is closed and replaced with a second source code buffer. Therefore, there are two buffers for the source code and I have to manually kill one of them.

I hope, when press q, the cscope display buffer can be completely closed and return the focus to source code buffer. I think this can be customized by modifying cscope-display-buffer-args, do you have any idea about how to change and achieve this feature?

xcscope don't work with sub-directories

I've read the docs, but still can't make xcscope.el work with sources in sub-directories.

files in the directory:

cscope.out
[...]
got/
lib/

I start emacs got/got.c, then point cursor to the function, which is defined in file inside lib/ directory, and press C-s c d, and I get:

Finding global definition: got_worktree_open
Database directory: /home/misha/work/got/

cscope: no source files found


Search complete.  Search time = 0.02 seconds.

If I patch xcscope.el with the following:

--- xcscope.el.orig     Sun Mar 13 22:34:38 2022
+++ xcscope.el  Sun Mar 13 22:34:47 2022
@@ -2500,7 +2500,7 @@
     (save-excursion
       (catch 'finished
        (set-buffer outbuf)
-       (setq options '("-L"))
+       (setq options '("-LR"))
        (while (and (not done) cscope-search-list)
          (setq next-item (car cscope-search-list)
                cscope-search-list (cdr cscope-search-list)

everything starts working, and I get window with function name, and can jump to file inside lib/ directory.

I can't imagine that I'm first person, who has source files in different sub-directories. Am I missing something obvious?

OS: OpenBSD current
Cscope: cscope-15.9p0

MacOS: xcscope.el can't be run within emacs 22.1.1

I just downloaded xcscope.el and add the below 2 lines to my .emacs on my own MacOS.

(load-file "~/xcscope/xcscope.el")
(require 'xcscope)

My emacs version is 22.1.1.

However when I run # emacs --debug-init, I met the below error.

Debugger entered--Lisp error: (error "Unknown keyword :risky")
signal(error ("Unknown keyword :risky"))
error("Unknown keyword %s" :risky)
custom-handle-keyword(cscope-keymap-prefix :risky t custom-variable)
custom-declare-variable(cscope-keymap-prefix "^Cs" "Prefix for key bindings of cscope-minor-mode'.\n\nChanging this variable outside Customize does not have any\neffect. To change the keymap prefix from Lisp, you need to\nexplicitly re-define the prefix key:\n\n (define-key cscope-minor-mode-keymap cscope-keymap-prefix nil)\n (setq cscope-keymap-prefix (kbd \"C-c ,\"))\n (define-key cscope-minor-mode-keymap cscope-keymap-prefix\n cscope-command-map)" :group cscope :type string :risky t :set (lambda (variable key) (when (and ... ...) (define-key cscope-minor-mode-keymap ... nil) (define-key cscope-minor-mode-keymap key cscope-command-map)) (set-default variable key))) (defcustom cscope-keymap-prefix "^Cs" "Prefix for key bindings of cscope-minor-mode'.\n\nChanging this variable outside Customize does not have any\neffect. To change the keymap prefix from Lisp, you need to\nexplicitly re-define the prefix key:\n\n (define-key cscope-minor-mode-keymap cscope-keymap-prefix nil)\n (setq cscope-keymap-prefix (kbd "C-c ,"))\n (define-key cscope-minor-mode-keymap cscope-keymap-prefix\n cscope-command-map)" :group (quote cscope) :type (quote string) :risky t :set (lambda (variable key) (when ... ... ...) (set-default variable key)))
eval-buffer(#<buffer load<2>> nil "/Users/zhuangyan/xcscope/xcscope.el" nil t) ; Reading at buffer position 50383
load-with-code-conversion("/Users/zhuangyan/xcscope/xcscope.el" "/Users/zhuangyan/xcscope/xcscope.el" nil nil)
load("/Users/zhuangyan/xcscope/xcscope.el" nil nil t)
load-file("/xcscope/xcscope.el")
eval-buffer(#<buffer load> nil "/Users/zhuangyan/.emacs" nil t) ; Reading at buffer position 8630
load-with-code-conversion("/Users/zhuangyan/.emacs" "/Users/zhuangyan/.emacs" t t)
load("
/.emacs" t t)
#[nil "^H<85>¾^@ Æ=<83>^Q^@Ç^HÈQ<82>A^@ É=<83>3^@ÊÇËÌ#<83>#^@Í<82>A^@ÊÇËÎ#<83>/^@Ï<82>A^@Í<82>A^@ Ð=<83>=^@Ñ<82>A^@Ç^HÒQ^ZÓ^SÔ\nÓ<89>#<88>^KÓ=<83>i^@ÕÖ×Ç^HØQ!"^\Ô\fÓ<89>#<88>^KÓ=<83>h^@\n^S)^K<83>®^@Ù^K!Ú<9a><83>®^@Û^K!<89>^]ÜP^^$Ý^N$!<83><8a>^@^N$<82><95>^@Ý^M!<83><94>^@^M<82><95>^@Ë<89>^U<83>­^@Þ^M^K"<83>«^@ßà^M^K#<88>áâ!<88>^M^S*^N%?<85>½^@Ë^^&ÔãÓ<89>#))<87>" [init-file-user system-type user-init-file-1 user-init-file otherfile source ms-dos "" "/_emacs" windows-nt directory-files nil "^\.emacs\(\.elc?\)?$" "/.emacs" "^_emacs\(\.elc?\)?$" "~/_emacs" vax-vms "sys$login:.emacs" "/.emacs" t load expand-file-name "init" file-name-as-directory "/.emacs.d" file-name-extension "elc" file-name-sans-extension ".el" file-exists-p file-newer-than-file-p message "Warning: %s is newer than %s" sit-for 1 "default" alt inhibit-default-init inhibit-startup-message] 7]()
command-line()
normal-top-level()

How to change the default bindings of xcscope

There are two default bindings in xcscope.el:

C-c s g -- cscope-find-global-definition
C-c s G -- cscope-find-global-definition-no-prompting

But most of time I just use C-c s G which is cscope-find-global-definition-no-prompting, since G is Shift-g, so how can switch the bindings to

C-c s g -- cscope-find-global-definition-no-prompting
C-c s G -- cscope-find-global-definition

========================

And I notice that a lot of cscope-* functions will prompt, but most of time I just call cscope functions for the current word where my point is, so I come up two solutions:

1. define a variable that I can choose to prompt or not prompt for all `cscope-*` functions
2. give every cscope function a prefix such as `C-u`, with `C-u`, all the functions will prompt, otherwise all of them will not prompt.

I think the 2nd solution is better.

Support for inline functions

Hello there,

I found cscope is a great tool to navigate in a large project. Using it since a long time.1 issue I am facing is if a function is defined as inline, then cscope-find-global-definition doesn't show that function. Please add this functionality. Thanks.

does xcscope support symbolic link file ?

I use scope-index to generate the TAGS file cscope configure file.

but it will produce following errors :

cscope: cannot find file lib/inets/test/httpc_SUITE_data/cgi_echo.c

which is a symbolic link to other file :

gi_echo.c -> ../httpd_SUITE_data/cgi_echo.c

the file is exist.

so I am not sure does this error cause by symbolic link file not supported by xcscope ?

multiple "cscope: cannot find file ..." in *cscope* buffer

Hi, when I tried to use xcscope to find definition or something, it prints multiple lines of

cscope: cannot find file path/to/file

and I notice that the path/to/file is symbolic link file, I know this issue was posted #8 and it is the issue of cscope itself, but could you please remove those lines from the cscope buffer, that would be better, since I use cscope command from terminal, there is no such "cannot find" line from the result of cscope.

Refactoring using cscope

As xcscope can be used to find symbol references, it is useful to allow xcscope to refactor:

  • First, it finds all the references of a particular symbol
  • Then, it allows to replace all the symbols with new symbol entered by user.

This can be done either with an open cscope buffer, or directly through an interactive command, i.e. xcsope-refactor.

Tramp support

Hi,

I've been using xcscope for awhile locally. I recently started to use Tramp and was interested in using xcscope over Tramp, but don't really know how to set it up. Wondering if you can point me to some instructions on how to get it working.

Thanks!

xcscope have problem on emacs-w32, on windows, compiled by MinGW.

Hi,

I use this on ubuntu, every thing is awesome, and when I turn to windows, it's not work.
I found the root case is the code slip on xcscope.el
"(shell-quote-argument cscope-program)"
it's make wrong result on windows,
(setq cscope-program "cscope") ; set the cscope
(shell-quote-argument cscope-program) ; generate a ""cscope"", which is not a valid executable file name.
and I replace all "(shell-quote-argument cscope-program)" to "cscope-program", it's worked.

Please check this and improve it.
Thank you.

Add multiple databases to search list.

I have multiple cscope databases to refer to at once. Is there any way in which I can add all the database to the search list? Basically, I want to add multiple directories to cscope-set-initial-directory, but once I add a new directory, only that directory remains, and the previous ones are discarded. Same functionality can be achieved in vim by the command :cscope add <path to database>

Please excuse if this is a rookie question as I'm not very familiar with lisp.

How to use cscope-database-regexps

am using emacs 24.3 with xcscope. I need help in setting cscope-database-regexps. I am trying to setup so that it will look for code in this order

/home/mike/Src/master1/child1/child1
/home/mike/Src/master2/child2/child2
/home/mike/Src/master1
/home/mike/Src/master2

So in .emacs I did the following, but it does not work. I don't see cscope.out get created in each of the directories I listed above.

I put /home/mike/Src/master1/child1/child1 and /home/mike/Src/master2/child2/child2 since they are my primary area of my work. If a search is not found that, I want to expand to the rest of the tree. Hence I have my priorities. I want to know how can I do that with xcscope.

Thank you.

(setq cscope-database-regexps
'(
( "^/home/mike/Src/master1/child1/child1"
t
)
( "^/home/mike/Src/master1//"
t
)
( "^/home/mike/Src/master2/child2/child2"
t
)
( "^/home/mike/Src/master2/"
t
)
)
)

GNU Global support requires version 5.9

It seems that GNU Global support doesn't work over TRAMP... gtags-cscope works fine locally, but when I set the active directory to the same project (with a GTAGS file) remotely no results are returned.

I'll try to dig down into this later when I have some time, but I wanted to at least make a note here in the mean time.

"display-buffer" fallbacks to "display-buffer-fallback-action"

Parentheses are missed here:
(defvar cscope-display-buffer-args (and (not cscope-running-in-xemacs) (>= emacs-major-version 24) '(display-buffer-use-some-window (inhibit-same-window . t)))

Should be:
(defvar cscope-display-buffer-args (and (not cscope-running-in-xemacs) (>= emacs-major-version 24) '((display-buffer-use-some-window (inhibit-same-window . t))))

search bug in *cscope* buffer with multiple cscope databases

With this code

[bwong@curiosity ~]$ ls adir bdir
adir:
a.c  cscope.files  cscope.out

bdir:
b.c  cscope.files  cscope.out
[bwong@curiosity ~]$ tail adir/*.c bdir/*.c
==> adir/a.c <==
void a(void) {
    b();
    c();
}

==> bdir/b.c <==
void b(void) {
    a();
    c();
}
[bwong@curiosity ~]$ 

and this cscope-database-regexps

(setq cscope-database-regexps
  '(
    ( "^/home/bwong/adir"
      (t)
      ( "/home/bwong/bdir" ))))

After finding functions calling c, *cscope* looks like:

===============================================================================
Finding functions calling: c
Database directory: /home/bwong/adir/

*** a.c:
a[3]                           c();

Database directory: /home/bwong/bdir/

*** b.c:
b[3]                           c();

Search complete.  Search time = 0.01 seconds.

With the cursor on a search for a:

===============================================================================
Finding functions calling: c
Database directory: /home/bwong/adir/

*** a.c:
a[3]                           c();

Database directory: /home/bwong/bdir/

*** b.c:
b[3]                           c();

Search complete.  Search time = 0.01 seconds.
===============================================================================
Finding global definition: a
Database directory: /home/bwong/bdir/

 --- No matches were found ---

Search complete.  Search time = 0.00 seconds.

The above used:

[bwong@curiosity xcscope-el]$ git log -1
commit d845a033058ccb83e32dd9648885e8f608bb6258
Author: Dima Kogan <[email protected]>
Date:   Sat May 10 14:37:18 2014 -0700

    removed an unneeded instance of shell-quote-argument
[bwong@curiosity xcscope-el]$ 

This works with:

;
; File:         xcscope.el
; RCS:          $RCSfile: xcscope.el,v $ $Revision: 1.14 $ $Date: 2002/04/10 16:59:00 $ $Author: darrylo $
; Description:  cscope interface for (X)Emacs
; Author:       Darryl Okahata
; Created:      Wed Apr 19 17:03:38 2000
; Modified:     Thu Apr  4 17:22:22 2002 (Darryl Okahata) [email protected]
; Language:     Emacs-Lisp
; Package:      N/A
; Status:       Experimental
;
; (C) Copyright 2000, 2001, 2002, Darryl Okahata <[email protected]>,
;     all rights reserved.
; GNU Emacs enhancements (C) Copyright 2001,
;         Triet H. Lai <[email protected]>
; Fuzzy matching and navigation code (C) Copyright 2001,
;         Steven Elliott <[email protected]>
Finding functions calling: c

Database directory: /home/bwong/adir/
-------------------------------------------------------------------------------
*** a.c:
a[3]                           c();
-------------------------------------------------------------------------------

Database directory: /home/bwong/bdir/
-------------------------------------------------------------------------------
*** b.c:
b[3]                           c();
-------------------------------------------------------------------------------

Search complete.  Search time = 0.01 seconds.

With the cursor on a search for a:

Finding global definition: a

Database directory: /home/bwong/adir/
-------------------------------------------------------------------------------
*** a.c:
a[1]                           void a(void ) {
-------------------------------------------------------------------------------

Search complete.  Search time = 0.01 seconds.

"Cscope" does not show in the menu bar of Emacs 26.1 or Emacs 25.3.1

Hi Dima,

I did the two test cases on my own iMac.

Case A

  1. I downloaded Emacs Mac Port which uses Gnu Emacs 26.1
    https://github.com/railwaycat/homebrew-emacsmacport
  • Use xcscope.el provided here

(load-file "~/bin/xcscope.el")
(require 'xcscope)

  1. Then I ran emacs and "Cscope" is not shown in the menu bar.

screen shot 2018-04-19 at 9 51 26 am

So when I click "Control C S S", "s" character is input.

Case B:

  1. Install emacs via brew
    brew install emacs // to get Emacs 25.3.1
  • Use xcscope.el provided here

(load-file "~/bin/xcscope.el")
(require 'xcscope)

  1. Then I ran emacs and I met the same issue as case A, "Cscope" does not show in the menu bar.

Regards,
Andrew

"<file> is not readable or exists" when using xcscope over TRAMP

When using xcscope over TRAMP, the database can be found and the query results shown correctly. However, the results cannot be jumped to with a message "<file> is not readable or exists". It seems that xcscope tries the filename on my local machine.

More specifically,

  • I was at a file /scp:val17:/home/yf/src/qemu-git/migration/ram.c.
  • I used cscope-find-global-definition to find the definition of memory_global_dirty_log_start
  • The *cscope* buffer showed the global definition correctly
    Finding global definition: memory_global_dirty_log_start
    Database directory: /scp:val17:/home/yf/src/qemu-git/
    
    *** /home/yf/src/qemu-git/memory.c:
    memory_global_dirty_log_start[2568] void memory_global_dirty_log_start(void )
    
    Search complete.  Search time = 0.76 seconds.
  • But I could not jump to the entry. A message shows "/home/yf/src/qemu-git/memory.c is not readable or exists

It seems that xcscope tried the filename (/home/yf/src/qemu-git/memory.c) on my local machine instead on remote.

Completion for input tag

Thank you for the package.
Switched to this one from ggtags because of much better performance and more search options.
It seems xcscope lacks tag completion feature.
Any plans to implement it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.