Comments (5)
from xcscope.el.
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.
from xcscope.el.
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.
This was merged a while back in b9bd846. Closing.
from xcscope.el.
Related Issues (20)
- xcscope have problem on emacs-w32, on windows, compiled by MinGW. HOT 6
- Getting nonsense results HOT 11
- GNU Global support requires version 5.9 HOT 4
- does xcscope support symbolic link file ? HOT 1
- search bug in *cscope* buffer with multiple cscope databases HOT 2
- xcscope.el and user-reserved keybindings collision HOT 3
- "display-buffer" fallbacks to "display-buffer-fallback-action" HOT 1
- MacOS: xcscope.el can't be run within emacs 22.1.1 HOT 2
- "Cscope" does not show in the menu bar of Emacs 26.1 or Emacs 25.3.1 HOT 3
- How to change the default bindings of xcscope HOT 2
- multiple "cscope: cannot find file ..." in *cscope* buffer HOT 1
- "<file> is not readable or exists" when using xcscope over TRAMP HOT 6
- Completion for input tag HOT 3
- Tramp support HOT 2
- Support for inline functions HOT 1
- How to change the behavior of quitting cscope display buffer HOT 5
- failed to parse filename HOT 14
- xcscope don't work with sub-directories HOT 7
- Add multiple databases to search list. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xcscope.el.