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

Allow clojuredocs navigation on qualified symbols and within *cider-clojuredocs* buffer #3040

Merged
merged 1 commit into from
Sep 2, 2021

Conversation

ag91
Copy link
Contributor

@ag91 ag91 commented Aug 31, 2021

This is a feature suggested by user @dotemacs: when we are looking at
clojuredocs, it is often useful to jump to the next related function.

Before this change, cider-clojuredocs could not reach symbols like
true? or clojure.core/map.

Also in buffers with cider-mode enabled we can navigate with the
keybinding C-c C-d C-c. Here I try to support the same also in the
temporary buffer the cider creates for clojuredocs.

Replace this placeholder text with a summary of the changes in your PR.
The more detailed you are, the better.


Before submitting the PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):

  • The commits are consistent with our contribution guidelines
  • You've added tests (if possible) to cover your change(s)
  • All tests are passing (eldev test)
  • All code passes the linter (eldev lint) which is based on elisp-lint and includes
  • You've updated the changelog (if adding/changing user-visible functionality)
  • You've updated the user manual (if adding/changing user-visible functionality)

Thanks!

If you're just starting out to hack on CIDER you might find this section of its
manual
extremely useful.

@yuhan0
Copy link
Contributor

yuhan0 commented Sep 1, 2021

I don't think this is the right approach -- (thing-at-point 'symbol) works as expected in clojure-mode buffers and doesn't need a separate regex based approach to replace it.
The problem is that the clojuredocs buffer uses the default fundamental-mode syntax table, which doesn't recognize . and ? as symbol constituents.
Executing (set-syntax-table clojure-mode-syntax-table) in the buffer solves the issue.

The question might be whether to apply this more generally to other popups, in cider-make-popup-buffer, or only to
cider-create-clojuredocs-buffer.

@bbatsov
Copy link
Member

bbatsov commented Sep 1, 2021

I'd start small. :-)

And I agree with the rest of your suggestions. In the clojuredocs buffers it might also be a good idea to convert related symbols to links that people can simply press.

@yuhan0
Copy link
Contributor

yuhan0 commented Sep 1, 2021

I was thinking the same thing :)
There's some relevant "See also" button code already implemented at the bottom of cider-docview-render-info.

This is a feature suggested by user @dotemacs: when we are looking at
clojuredocs, it is often useful to jump to the next related function.

Before this change, cider-clojuredocs could not reach symbols like
true? or clojure.core/map within *clojuredocs* buffers.
@ag91
Copy link
Contributor Author

ag91 commented Sep 1, 2021

hey @yuhan0 thanks so much for your comment: I just learned that thing-at-point changes according to the mode AND how to set the syntax table! This PR was just worth the effort for your comment.
@bbatsov maybe I can try to add links in another PR? I am happy to try.

@bbatsov
Copy link
Member

bbatsov commented Sep 2, 2021

Yeah, you can tackle this in separate PR. Thanks!

@bbatsov bbatsov merged commit beb8226 into clojure-emacs:master Sep 2, 2021
bbatsov added a commit that referenced this pull request Sep 2, 2021
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

Successfully merging this pull request may close these issues.

3 participants