4

The problem:

  1. I'm in scheme-mode (simple quack)
  2. scheme is already running
  3. eval expression
  4. it sends the expression to scheme buffer
  5. but! doesn't bring that buffer up in 2nd window = no immediate feedback
  6. and I have to manually switch second buffer to scheme which is annoying

Some (more recent) modes like fsharp-mode or tuareg do that automatically. Tried to read quack.el, but didn't find convenient separate function like "pop scheme". It's tangled within run-scheme which also changes focus. Settings also don't help.

I want to stay in my rkt/scm file and see repl buffer pop up if not already popped. Like this simple build logic in sublime-text but with persistent repl.

Maybe I should try geiser, but quack is ok for now. Just missing few obvious conveniences.

2 Answers 2

2

Just rungeiser. It's in MELPA now, so it's a quick install.

You can also try lispy (which uses geiser) for in-place scheme eval. e will eval current expression and display the result in the minibuffer. E will eval current expression and insert the result in current buffer. u is bound to undo, so you can either e or Eu if you prefer.

3
  • I read somewhere (on geiser page?) that geiser more like complements quack. And required behaviour looked in quack realm.
    – bravmi
    May 14, 2014 at 13:49
  • 1
    Not sure if there are still updates to quack. geiser on the other hand is very much alive: in fact I just had to fix lispy's interaction with geiser, since it broke on update.
    – abo-abo
    May 14, 2014 at 13:57
  • Using scheme-mode you can use C-c C-z to switch to scheme, and then C-x 2 C-x o C-x b to split the screen, switch to the other emacs 'window', and then switch back to your code. Use C-x 3 to split vertically if you'd rather.
    – Nick
    May 26, 2020 at 20:23
0

I ended up writing this:

(setq scheme-program-name "guile")
(defun run-scheme-2.0 ()
    "Loads your chosen Scheme implementation for interactive development, 
and displays that buffer below your main editing buffer, and makes sure that 
your cursor will be on your code."
    (interactive)
    (if (not (get-buffer "*scheme*"))
      (progn 
        (setq starting-buffer (buffer-name))
        (run-scheme scheme-program-name)
        (split-window-below)
        (other-window 1)
        (shrink-window-if-larger-than-buffer)
        (other-window 1)
        (switch-to-buffer starting-buffer))))

(add-hook 'scheme-mode-hook 'run-scheme-2.0)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.