GithubHelp home page GithubHelp logo

Comments (7)

dkogan avatar dkogan commented on July 23, 2024

from xcscope.el.

bsdmp avatar bsdmp commented on July 23, 2024

Thank you for the fast reply. I've tried C-c s I and got the following:

Creating cscope index `cscope.out' in:
        /home/misha/work/got/

===============================================================================
Creating list of files to index ...
find: -false: unknown option
Creating list of files to index ... done
Indexing files ...
cscope: no source files found
Indexing files ... done
===============================================================================

Indexing finished

It looks like -false is not defined in POSIX and is GNU extension.

I tried following command:
find . -name *.c -o -name *.h > cscope.files
and then
cscope -b
in /home/misha/work/got directory - after that everything started to work.

So, it looks like that the error was in not having cscope.files file and not build cscope.out out from it.

If you want to make creating cscope.files more POSIX friendly - I'm ready to test the patch, if not, I think, the bug can be closed. (Probably worth mentioning this behavior in docs, though)

from xcscope.el.

dkogan avatar dkogan commented on July 23, 2024

from xcscope.el.

bsdmp avatar bsdmp commented on July 23, 2024

I removed -o -false from the xcscope.el, cscope.files file is created, but it is empty, and building of cscope.out is failing because of it.

--- xcscope.el.orig     Sun Mar 13 23:11:36 2022
+++ xcscope.el  Mon Mar 14 14:43:55 2022
@@ -2734,16 +2734,14 @@
 
                     ;; apply -prune to any directory we're supposed to ignore
                     "(" "-type" "d" "("
-                    ,@(apply 'append (mapcar (lambda (dir) (list "-name" dir "-o") )
+                    ,@(apply 'append (mapcar (lambda (dir) (list "-name" dir) )
                                              cscope-indexer-ignored-directories))
-                    "-false"
                     ")" "-prune" ")" "-o"
 
                     ;; accept only files that match the patterns we want
                     "("
-                    ,@(apply 'append (mapcar (lambda (suffix) (list "-iname" suffix "-o"))
+                    ,@(apply 'append (mapcar (lambda (suffix) (list "-iname" suffix))
                                              cscope-indexer-suffixes))
-                    "-false"
                     ")"
 
                     ;; accept files and symlinks

Can you prompt me - how to debug what arguments are passed to find to execute them in a shell, and find the problem? I tried adding (message ...) to the code, but it is first time I use or see lisp, so my approach has failed.

from xcscope.el.

bsdmp avatar bsdmp commented on July 23, 2024

I did a little bit more investigation, it looks like you're doing cycle to build find string like this:

-iname <suffix> -o
-iname <suffix> -o
[...]
-iname <suffix> -o

and after that appen -false, so you don't leave last -o without argument.

My lisp skills definitely don't allow me to fix this now. Maybe it's really should be just mentioned in docs, that cscope.files need to be presented in root dir of the project and that cscope -b must be run manually to xcscope to work on non-GNU OSes.

from xcscope.el.

dkogan avatar dkogan commented on July 23, 2024

from xcscope.el.

bsdmp avatar bsdmp commented on July 23, 2024

I added printing of findargs with following code:

(message "findcmds: %s" findargs)

and it gives the following:

findcmds: (. \( -type d \( -name CVS -o -name RCS -o -name SCCS -o -name .git -o -name .hg -o -name .bzr -o -name .cdv -o -name .pc -o -name .svn -o -name _MTN -o -name _darcs -o -name _sgbak -o -name debian -o -false \) -prune \) -o \( -iname \*.\[chly] -o -iname \*.\[ch\]xx -o -iname \*.\[ch\]pp -o -iname \*.cc -o -iname \*.hh -o -false \) \( -type f -o -type l \) -print)

if I manually remove first ( and last ), and also remove two -o - false snippets and pass this to OpenBSD's find I successfully get expected results.

from xcscope.el.

Related Issues (20)

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.