polymode / poly-org

Polymode for org-mode
57 stars 12 forks source link

C-c C-c in lisp blocks doesn't work as expected #25

Open slyrus opened 4 years ago

slyrus commented 4 years ago

If I have the following .org file:

#+begin_src lisp
  (asdf:load-system "alexandria")  
#+end_src

And I move the cursor into the block and hit C-c C-c, I get an error message such as the following:

poly-org-lisp-test/README-2.org:5:10:
  read-error: 
    READ error during COMPILE-FILE:

      end of file on #<SB-INT:FORM-TRACKING-STREAM for "file /tmp/slimetul4IH" {1005A0CFC3}>

      (in form starting at line: 5, column: 0, position: 53)

Compilation failed.

with SBCL, and with ABCL, I get:

   [Condition of type READER-ERROR]

Restarts:
 0: [ABORT] Abort compilation.
 1: [*ABORT] Return to SLIME's top level.
 2: [ABORT] Abort thread.

Backtrace:
  0: (INVOKE-DEBUGGER #<READER-ERROR {14C15C16}>)
  1: org.armedbear.lisp.Lisp.error(Lisp.java:382)
  2: org.armedbear.lisp.LispReader$4.execute(LispReader.java:101) = #<function READ-RIGHT-PAREN {7CC89B3C}>
  3: org.armedbear.lisp.Stream.processChar(Stream.java:589)
  4: org.armedbear.lisp.Stream.readPreservingWhitespace(Stream.java:558)
  5: org.armedbear.lisp.Stream.read(Stream.java:501)
  6: org.armedbear.lisp.Stream$16.execute(Stream.java:2451) = #<function READ {2D99708D}>
  7: org.armedbear.lisp.Symbol.execute(Symbol.java:838)
  8: org.armedbear.lisp.LispThread.execute(LispThread.java:872)
  9: org.armedbear.lisp.read_conditional_2.execute(read-conditional.lisp:39) = #<function READ-CONDITIONAL {69E0C94D}>
 10: org.armedbear.lisp.LispThread.execute(LispThread.java:851)
 11: org.armedbear.lisp.Stream.readDispatchChar(Stream.java:817)
 12: org.armedbear.lisp.LispReader$6.execute(LispReader.java:130) = #<function READ-DISPATCH-CHAR {1995EAA7}>
 13: org.armedbear.lisp.Stream.processChar(Stream.java:589)
 14: org.armedbear.lisp.Stream.readList(Stream.java:756)
 15: org.armedbear.lisp.LispReader$3.execute(LispReader.java:88) = #<function READ-LIST {3B9CD93B}>
 16: org.armedbear.lisp.Stream.processChar(Stream.java:589)
 17: org.armedbear.lisp.Stream.readPreservingWhitespace(Stream.java:558)
 18: org.armedbear.lisp.Stream.readPreservingWhitespace(Stream.java:567)
 19: (READ #S(SYSTEM::STRING-INPUT-STREAM) T NIL T)

Not sure if this is a polymode, poly-org, org-mode problem, or what, but any help would be appreciated. Thanks!

vspinu commented 4 years ago

It probably sends the entire file or the block head/tail.

This is how evaluation functions are protected for R evaluation.

slyrus commented 4 years ago

Thanks for the pointer. Any suggestions on how I might do something similar for lisp mode? Do I need to make some sort of poly-lisp mode?

emacswatcher commented 3 years ago

It looks to me as though the C-c C-c is being sent to the source block's language mode.