Comments (6)
Hi. Thanks for the report.
I'm somewhat mystified by this. xcscope has worked with TRAMP for years, and I use it this way all the time. Let's try to figure out what's going on before patching this.
First off, can you confirm that you're running xcscope.el from this repo (or from Debian or Ubuntu)? The copy the cscope project ships is ancient, and does not work with TRAMP.
If so, let's look at the properties on your end. In your *cscope*
buffer put the point on the m
in memory_global_dirty_log_start[2568]
and hit C-u C-x =
A new window will open up, telling you things. Towards the end it should say something like
There are text properties here:
cscope-file "/scp:val17:......."
Do you see that? Specifically, the cscope-file
property should contain the full TRAMP path. Does it?
from xcscope.el.
-
xcscope.el from MELPA (xcscope-20180426.712) was used. Though, I re-produced the issue using the xcscope.el from this repo (I used Emacs 25.2.2 and 26.2).
-
C-u C-x =
in my case shows
There are text properties here:
cscope-file "/home/yf/src/qemu-git/memory.c"
cscope-fuzzy-search-text-regexp "void\\s-*memory\\s-*_\\s-*global\\s-*_\\s-*dirty\\s-*_\\s-*log\\s-*_\\s-*start\\s-*(\\s-*void\\s-*)"
cscope-line-number 2568
face cscope-function-face
mouse-face cscope-mouse-face
I see. I guess this issue is related to how the cscope database is generated. I use make cscope
to generate the database. And it turns out absolute path is used for file names.
In this case, expand-file-name
does not expand the "absolute" file name with the TRAMP prefix. So the "absolute" file name "(/home/yf/src/qemu-git/memory.c") is inserted in the text properties.
Line 2377 in 57bff67
Therefore, my fix #21 does not work either. It only works when the file names are absolute. For relative file names, it produces "/scp:yf@val17:memory.c
" which also leads to "is not readable or exists" :P
from xcscope.el.
OK. What does make cscope
do? All my testing was done with indexing with C-c s I
. This doesn't request absolute or relative, but rather does the default thing. You should try it to see what it does for you. And you should tell me what your command does so that I can test it here.
from xcscope.el.
Sorry for insufficient information.
make cscope
does:
rm -f "/home/yf/src/qemu-git"/cscope.*
find "/home/yf/src/qemu-git/" -name "*.[chsS]" -print > "/home/yf/src/qemu-git/cscope.files"
cscope -b -i"/home/yf/src/qemu-git/cscope.files"
The head
of the cscope.files:
/home/yf/src/qemu-git/migration/xbzrle.h
/home/yf/src/qemu-git/migration/rdma.h
/home/yf/src/qemu-git/migration/channel.h
/home/yf/src/qemu-git/migration/socket.c
/home/yf/src/qemu-git/migration/qjson.h
/home/yf/src/qemu-git/migration/migration.h
/home/yf/src/qemu-git/migration/tls.h
/home/yf/src/qemu-git/migration/qemu-file-channel.h
/home/yf/src/qemu-git/migration/global_state.c
/home/yf/src/qemu-git/migration/fd.h
from xcscope.el.
Please try this patch:
diff --git a/xcscope.el b/xcscope.el
index e6f8a6b..539e5ad 100644
--- a/xcscope.el
+++ b/xcscope.el
@@ -2144,6 +2144,18 @@ concatenation of ARGS is returned"
dir
)
+
+(defun cscope--expand-file-name-with-absolute-remote (file)
+ "Returns an expanded filename, with the remote prefix.
+This is just like `expand-file-name', but will always contain the
+remote prefix if `default-directory' has one. `expand-file-name'
+will not do this if FILE is an absolute (but local) path"
+ (let ((file-expanded (expand-file-name file)))
+ (if (file-remote-p file-expanded)
+ file-expanded
+ (concat (or (file-remote-p default-directory) "")
+ file-expanded))))
+
(defun cscope-construct-custom-options-list ()
"Returns a list of cscope options defined by the
cscope-option-* variables"
@@ -2361,7 +2373,7 @@ using the mouse."
str))
(cscope-insert-with-text-properties
str
- (expand-file-name file))
+ (cscope--expand-file-name-with-absolute-remote file))
(insert "\n")))
(if cscope-first-match-point
@@ -2374,7 +2386,7 @@ using the mouse."
(cscope-make-entry-line function-name
line-number
line)
- (expand-file-name file)
+ (cscope--expand-file-name-with-absolute-remote file)
line-number
line)
(insert "\n")
from xcscope.el.
OK, it fixes this issue.
from xcscope.el.
Related Issues (20)
- xcscope.el and user-reserved keybindings collision HOT 3
- "display-buffer" fallbacks to "display-buffer-fallback-action" HOT 1
- cscope-index-files doesn't work with paths using whitespaces HOT 5
- 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
- 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
- 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
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.