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

Bugfix/fix cider selector problem #2711

Merged

Conversation

ahungry
Copy link
Contributor

@ahungry ahungry commented Sep 14, 2019

This fixes :
#2707

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

  • [ x ] The commits are consistent with our contribution guidelines
  • [ - ] You've added tests (if possible) to cover your change(s)
  • [ x ] All tests are passing (make test)
  • [ x ] All code passes the linter (make lint) which is based on elisp-lint and includes
  • [ x ] You've updated the changelog (if adding/changing user-visible functionality)
  • [ x ] 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.

- If the selector is run outside of an active sesman-session, it will
still find the REPL when the REPL selector is chosen (based on the
last cider REPL mode).
- If the selector is run while a window is visible, it will switch to
that window (focus) as opposed to giving a "No such buffer" message.
@@ -139,7 +145,8 @@ is chosen. The returned buffer is selected with

(def-cider-selector-method ?r
"Current REPL buffer."
(cider-current-repl))
(or (cider-current-repl)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docstring probably needs to be adjusted, as now this does something different.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@bbatsov
Copy link
Member

bbatsov commented Sep 14, 2019

Might also be a good idea to expand a bit the documentation for cider-selector in the manual.

"Return the most recently visited buffer, deriving its `major-mode' from MODE.
Only considers buffers that are not already visible."
CONSIDER-VISIBLE-P will allow handling of visible windows as well.
First pass only considers buffers that are not already visible.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can probably simplify the logic and consider all buffers right away. I've mostly copied this code from SLIME back in the day and I didn't think much about it. Treating differently hidden/visible buffers seems weird to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had thought about that, and on one of the commits actually implemented as such, but that had a side-effect of removing the ability to use cider-selector to flip-flop between the latest 2 buffers of the same type (to change from a clojure-mode buffer to the last visited but not shown clojure-mode buffer - not using the second pass would change this operation into a noop essentially).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Well, I guess it really depends on what do we consider the purpose of this command to be - for me it was always to jump to a source buffer from some special buffer and vice versa. Of course, there's also the question of how people are actually using something and what do they consider useful. :D

That's why I was thinking we should extend the documentation of cider-selector in general so people would know how it's supposed to be used.

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.

2 participants