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

fix find-file-noselect: Wrong type argument: stringp, nil #1997

Merged
merged 3 commits into from May 24, 2017

Conversation

hojinyoo
Copy link
Contributor

  • fix a bug that losing buffer-file-name after call (cider--quit-error-window)
    The bug yields an error message `find-file-noselect: Wrong type argument: stringp, nil' that prevents from loading buffer.

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 (make test)
  • The new code is not generating bytecode or M-x checkdoc warnings
  • You've updated the changelog (if adding/changing user-visible functionality)
  • You've updated the readme (if adding/changing user-visible functionality)
  • You've updated the refcard (if you made changes to the commands listed there)

Thanks!

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

@bbatsov
Copy link
Member

bbatsov commented May 24, 2017

I can't really understand how moving the code as you did would fix anything. Some details would be useful.

@hojinatmixpanel
Copy link

hojinatmixpanel commented May 24, 2017

(cider--quit-error-window) has a side-effect, at least emacs in some setup. Once the error window is "buried" by the call, the return value of function buffer-file-name becomes nil. That leads filename to be nil, and it is avoided by changing the order or moving the code.

@bbatsov
Copy link
Member

bbatsov commented May 24, 2017

Ah, I get it now - quitting the error buffer probably selects it. Now I understand why this fix works, but I don't think that's the best possible fix as this makes the code pretty brittle - that's going to break again the moment someone rearranges the code. I think that passing buffer to buffer-file-name is going to fix this problem in a much clear and robust manner.

@hojinyoo
Copy link
Contributor Author

cool. that works as well.

@bbatsov bbatsov merged commit 1c0cd08 into clojure-emacs:master May 24, 2017
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.

None yet

3 participants