dkogan / dkogan/xcscope.el

xcscope don't work with sub-directories

Open
#29 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Emacs Lisp
Stars
122
Forks
27
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in xcscope.el around the search option construction near the cscope-search-list loop, then reproduce the reported lookup with source files in got/ and lib/. Verify that finding a global definition works across sub-directories and that the resulting location can be opened in Emacs.

Written by the indexing model from the issue text.

Assessment

Tech stack
emacs-lisp
Domain
devtools
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.