Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mention by name and link to references, not just containing files #19

Closed
tarsius opened this issue Aug 26, 2018 · 2 comments
Closed

Mention by name and link to references, not just containing files #19

tarsius opened this issue Aug 26, 2018 · 2 comments

Comments

@tarsius
Copy link
Contributor

tarsius commented Aug 26, 2018

Currently the files that contain references are shown and linkified, and the calling expressions are also shown.

However clicking on the link takes one to the beginning of the file instead of to the first reference (as mentioned in #15), there are no direct links to the other references either, and the names of the functions that contain references are not even shown at all.

Without that I can answer questions like "how am I supposed to use this function?", but in order to answer questions "in what contexts is this function used?". To do the latter I still have to manually jump to each file and then do something like an isearch to get the full context. If I know that a function isn't used by Emacs itself and would have to jump to every reference anyway to get the full context, then doing even a rgrep is faster.

Could you please add those things?

@Wilfred
Copy link
Owner

Wilfred commented Aug 29, 2018

You can use RET to visit the exact line where the result was found. Were you aware of that? If not, I need to improve the docs.

Alternatively, are you asking about showing the enclosing s-expression? If so, I'm certainly open for suggestions as to how you'd like this to look. The problem is that results may be nested in one another (e.g. looking for while) and the top level isn't necessarily a defun form.

@tarsius
Copy link
Contributor Author

tarsius commented Aug 29, 2018

You can use RET to visit the exact line where the result was found. Were you aware of that?

I have probably tried that, but forgot that to some heavy remapings I have to use C-m, not the key labeled "Return". What I usually do first when I try out a new package is to grep for define-key to see what bindings I have to adjust but also to see what is available. In that case I didn't do that because I started using in the middle of a task I expected it to be useful for -- and that apparently distracted me a bit.

If not, I need to improve the docs.

It was my mistake and I don't think I actually read the docs, so things should be fine.

Alternatively, are you asking about showing the enclosing s-expression?

I would like that, yes.

If so, I'm certainly open for suggestions as to how you'd like this to look.

Maybe start with displaying the top level iff it is a defun like form, like in the helpful-mode buffers? Ideally the defun line would be used as heading and the rest as body. magit-section.el might be helpful here. Will post a little proof-of-concept tomorrow.

The problem is that results may be nested in one another (e.g. looking for while) and the top level isn't necessarily a defun form.

I haven't considered that at all yet. Going to bed now and posting in case of power outage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants