GithubHelp home page GithubHelp logo

Comments (5)

dkogan avatar dkogan commented on June 25, 2024

from xcscope.el.

bertogg avatar bertogg commented on June 25, 2024

Hi, from the cscope(1) manual page:

Filenames  in the namefile that contain whitespace have to be
enclosed in "double quotes".   Inside  such  quoted  filenames,
any double-quote and backslash characters have to be escaped
by backslashes.

(this is from cscope version 15.9)

I tried this quick change to xcscope.el and I confirm that it works:

--- xcscope.el.orig     2020-08-27 12:59:35.756439407 +0200
+++ xcscope.el  2020-08-27 12:59:42.340456818 +0200
@@ -2736,7 +2736,7 @@
                     "(" "-type" "f" "-o" "-type" "l" ")"
 
                     ;; if we made it here, take the result
-                    "-print"))))
+                    "-printf" "\"%p\"\n"))))
 
     (let ((findcmds
            (concat "echo 'Creating list of files to index ...'\n"

This also removes all the annoying "cannot find file ..." that I was getting all the time.

Problems:

  • This works for white spaces but if the file name contains other special characters they would need to be escaped. I don't care about e.g double quotes or backslashes on file names (I think they are extremely rare), but white spaces are relatively common.
  • xcscope still cannot parse the output so if I use cscope-find-global-definition I get the results on the Emacs buffer but I cannot click on them ("File does not have expected format"). In my particular case I don't care so much about those files so my goal is simply to remove the "cannot find file" warnings.

from xcscope.el.

dkogan avatar dkogan commented on June 25, 2024

from xcscope.el.

bertogg avatar bertogg commented on June 25, 2024

I was having a closer look at this and I created a new patch that hopefully quotes all filenames correctly.

I gave it a try with files named one two.c , one"two"three.c and one\two.c and it seems to work fine now.

Now the index is generated correctly. If you search a symbol that is inside a file with a whitespace in the name cscope still complains a bit and does not work 100%, but at least it does work partially (that's a cscope bug, not a problem with the Emacs elisp file). Files with double quotes or backslashes seem to work fine.

See #23 for more details.

And here are related discussion for cscope: https://sourceforge.net/p/cscope/bugs/282/ and https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=579531

from xcscope.el.

dkogan avatar dkogan commented on June 25, 2024

This was merged a while back in b9bd846. Closing.

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.