Skip to content
New issue

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

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

Already on GitHub? # to your account

"No comment syntax is defined. Use: " in minibuffer when compiling after test/error #2105

Closed
harold opened this issue Nov 2, 2017 · 12 comments
Labels

Comments

@harold
Copy link
Contributor

harold commented Nov 2, 2017

(Thanks, as ever, for CIDER. It's the best and you're the best)

Expected behavior

File compiles fine, no buffers move or close, minibuffer is not focused, workflow uninterrupted.

Actual behavior

*cider-error* buffer is buried, minibuffer is focused and says No comment syntax is defined. Use: , file may or may not be compiled.

Steps to reproduce the problem

  1. Run a test (cider-test-run-test) that has an error (throws)
    • *cider-test-report* buffer appears (as expected)
  2. Select the error: link at the bottom of the buffer
    • *cider-error* buffer appears w/ stack-trace in it (as expected)
  3. Select the line in your code that caused the error
    • File with errant code it in appears (as expected)
  4. Make a change to the code - attempting to fix the error
  5. C-x C-s C-c C-k to save the file and compile the new (hopefully fixed) code
    • 💥 cider-error buffer weirdly is buried, minibuffer is focused and says No comment syntax is defined. Use: ...

Environment & Version information

GNU Emacs 24.5.1 on Linux gibson 4.8.0-59-generic #64-Ubuntu SMP Thu Jun 29 19:38:34 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

CIDER version information

;; CIDER 0.15.1 (London), nREPL 0.2.12
;; Clojure 1.8.0, Java 1.8.0_111

Lein/Boot version

$ lein --version
Leiningen 2.7.2-SNAPSHOT on Java 1.8.0_111 Java HotSpot(TM) 64-Bit Server VM
@harold
Copy link
Contributor Author

harold commented Nov 2, 2017

Seems related to, but perhaps slightly different from: #1779

@calvis
Copy link

calvis commented Dec 1, 2017

Any updates/workarounds for this? I think I'm having the same issue.

Here's a backtrace after following the instructions in #1779, produced via "Steps to reproduce the problem" in the issue description.

Debugger entered--Lisp error: (quit)
  icicle-ORIG-read-from-minibuffer("No comment syntax is defined.  Use: " "" nil nil nil nil nil)
  read-from-minibuffer("No comment syntax is defined.  Use: " nil nil nil nil nil nil)
  read-string("No comment syntax is defined.  Use: ")
  comment-normalize-vars()
  clojure--looking-at-non-logical-sexp()
  clojure-forward-logical-sexp()
  cider--make-fringe-overlays-for-region(1 763)
  #[514 "\300�!\210\301�!\205��r�q\210\302ed\"\210\303\304!)\207" [cider--display-interactive-eval-result buffer-live-p cider--make-fringe-overlays-for-region run-hooks cider-file-loaded-hook] 5 "\n\n(fn BUFFER VALUE)"](#<buffer *cider-test-report*> "#multifn[interpret 0xd30c4a0]")
  #[257 "\307�\310\"\307�\311\"\307�\312\"\307�\313\"\307�\314\"\307��\315\"\307��\316\"\317\300!\2038�r\300q\210�\2037�\320\321!\2047�\322��!\210)��\203I�\301\205\331�\301\300��\"\202\331��\203Y�\302\205\331�\302\300��\"\202\331�\211\203s�\306\203h�\306\300�\"\202\331�\302\205\331�\302\300�\"\202\331��\203\202�\303\205\331�\303\300�\"\202\331��\205\331�\323�\235\203\234�\307��\324\"\307�	\325\"\326��\"\266�\327�\235\203\246�\330\331!\210\332�\235\203\264�\305\206\262��! \210\333�\235\203\276�\330\334!\210\335�\235\203\310�\336\300!\210\337�\235\205\331�\340�!\210\304\205\331�\304\300!\207" [#<buffer *cider-test-report*> #[514 "\300�!\210\301�!\205��r�q\210\302ed\"\210\303\304!)\207" [cider--display-interactive-eval-result buffer-live-p cider--make-fringe-overlays-for-region run-hooks cider-file-loaded-hook] 5 "\n\n(fn BUFFER VALUE)"] #[514 "\300�!\207" [cider-emit-interactive-eval-output] 4 "\n\n(fn BUFFER VALUE)"] #[514 "\301�!\210\302�\300\"\207" [#<buffer *cider-test-report*> cider-emit-interactive-eval-err-output cider-handle-compilation-errors] 5 "\n\n(fn BUFFER ERR)"] nil #[0 "� \207" [nrepl-err-handler] 1] nil nrepl-dict-get "value" "ns" "out" "err" "status" "id" "pprint-out" buffer-live-p derived-mode-p clojure-mode cider-set-buffer-ns "notification" "msg" "type" nrepl-notify "interrupted" message "Evaluation interrupted." "eval-error" "namespace-not-found" "Namespace not found." "need-input" cider-need-input "done" nrepl--mark-id-completed nrepl-err-handler] 13 "\n\n(fn RESPONSE)"]((dict "id" "17" "session" "15706130-e0b0-4b2a-a812-d807ab1ad334" "value" "#multifn[interpret 0xd30c4a0]"))
  nrepl--dispatch-response((dict "id" "17" "session" "15706130-e0b0-4b2a-a812-d807ab1ad334" "value" "#multifn[interpret 0xd30c4a0]"))
  nrepl-client-filter(#<process nrepl-connection> "d2:id2:177:session36:15706130-e0b0-4b2a-a812-d807ab1ad3345:value29:#multifn[interpret 0xd30c4a0]ed2:id2:177:session36:15706130-e0b0-4b2a-a812-d807ab1ad3346:statusl4:doneee")

I'm using CIDER 0.16.0-SNAPSHOT (20171126.150 via melpa; I encountered the same issue on 0.15.1 so tried the latest), nREPL 0.2.12, and boot 2.7.1

@bbatsov
Copy link
Member

bbatsov commented Dec 9, 2017

Some minimal repro case would be useful. It's pretty hard to guess what's going wrong with one.

@harold
Copy link
Contributor Author

harold commented Dec 9, 2017

@bbatsov - The original 5 "Steps to reproduce the problem" are pretty minimal.

Would it help to make a project with a test with an error in it? Or something else? I am happy to do more to help here, I encounter this issue every day. :)

@calvis
Copy link

calvis commented Dec 9, 2017

I've found steps 3/4 above to be unnecessary. Even simpler:

  1. load a buffer that causes an error
  2. open the error buffer
  3. reload the buffer from step 1
  4. error buffer is buried, see No comment syntax is defined. Use: in minibuffer

FWIW a workaround I've found is to comment out https://github.com/clojure-emacs/cider/blob/master/cider-interaction.el#L1602 (I feel like there used to be a configuration option for this but I can't find it at the moment..)

@bbatsov
Copy link
Member

bbatsov commented Dec 10, 2017

@calvis This seems to work just fine for me. Regarding 2) I tried both compiling the buffer again, and running cider-refresh, as I wasn't certain what exactly do you mean.

@calvis
Copy link

calvis commented Dec 10, 2017

(2) means click on the link that opens the *cider-error* buffer, same as (2) in the original reproduction steps

But I apologize, (1) should have said "run a test" like the original, not just load the a buffer. I don't think it happens unless the *cider-error* buffer is buried when the *cider-test-report* buffer is also open.

  1. make a test like:
(deftest assert-test
  (assert false))

and cider-test-run-test

  1. open the *cider-error* buffer by clicking the java.lang.AssertionError: Assert failed: false link
  2. cider-load-buffer from the buffer with the test
  3. *cider-error* buffer is buried, see No comment syntax is defined. Use: in minibuffer

@bbatsov bbatsov added the bug label Dec 20, 2017
@xiongtx
Copy link
Member

xiongtx commented Mar 14, 2018

Cannot reproduce w/ @calvis's instructions on:

;; CIDER 0.17.0snapshot (package: 20180312.26), nREPL 0.2.13
;; Clojure 1.9.0, Java 1.8.0_151

@xiongtx xiongtx added can't repro We can't reproduce the issue and removed bug labels Mar 14, 2018
@harold
Copy link
Contributor Author

harold commented Mar 15, 2018

@calvis instructions reproduce for me on:

;; CIDER 0.16.0 (Riga), nREPL 0.2.13
;; Clojure 1.9.0, Java 1.8.0_111

Perhaps there is something coming in 0.17 that fixes this? That would be great, I encounter this many times every day in my real work.

@jimrthy
Copy link

jimrthy commented Dec 3, 2018

FWIW, I'm still encountering this in 0.18.0.

@calvis
Copy link

calvis commented Dec 15, 2018

I'm still encountering this on 0.18.0

Again steps to reproduce:

  1. run a test that causes an error, like add an (assert false)
  2. click on the link in *cider-test-report*: error: java.lang.AssertionError: Assert failed: false
  3. cider-load-buffer a buffer

A small repro file is:

(ns cider-bug
  (:require [clojure.test :refer :all]))

(deftest test-for-bug
  (is (assert false)))

Load/test that buffer, click this link that I have highlighted:

This window appears:

Don't close the test or error window. Go back to the cider-bug ns and cider-load-buffer. The *cider-error* buffer disappears, but No comment syntax is defined. Use: appears in the minibuffer

This happens when my ~/.emacs file is completely minimal.

The workaround to comment out this line still works:

(cider--quit-error-window)

@bbatsov bbatsov added bug low hanging fruit and removed can't repro We can't reproduce the issue labels Dec 16, 2018
@bbatsov
Copy link
Member

bbatsov commented Dec 16, 2018

I'll update the tagging of the bug, but I'm not sure if I'll be able to tackle it soon. I guess something gets messed with the focus when the error buffer is closed. I guess someone should check what exactly can go wrong in it.

mallt added a commit to mallt/cider that referenced this issue Dec 16, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants