kaz-yos / eval-in-repl

Consistent ESS-like eval interface for various REPLs
171 stars 27 forks source link

Racket-mode support uses unavailable function #48

Open jloow opened 2 years ago

jloow commented 2 years ago

eval-in-repl-racket.el uses the function racket--repl-show-and-move-to-end from racket-mode. However, this function is no longer available. I'm not sure what it has been replaced with, but the issue can be fixed by replacing the function with it's previous implementation. That is

(defalias 'eir-send-to-racket
  (apply-partially 'eir-send-to-repl
                   ;; fun-change-to-repl
                   #'(lambda ()
                       ;; Show Racket REPL (focus comes back)
                       (racket--repl-show-and-move-to-end)
                       ;; Go to the other window
                       (other-window 1))
                   ;; fun-execute
                   #'comint-send-input)
  "Send expression to *Racket REPL* and have it evaluated.")

Can be rewritten as

(defalias 'eir-send-to-racket
  (apply-partially 'eir-send-to-repl
                   ;; fun-change-to-repl
                   #'(lambda ()
                       ;; Show Racket REPL (focus comes back)
                       (display-buffer racket-repl-buffer-name)
                       (save-selected-window
              (select-window (get-buffer-window racket-repl-buffer-name))
              (comint-show-maximum-output))
                       ;; Go to the other window
                       (other-window 1))
                   ;; fun-execute
                   #'comint-send-input)
  "Send expression to *Racket REPL* and have it evaluated.")

Probably not the prettiest solution but it fixes the issue.

julian-hoch commented 1 month ago

Yeah just noticed that too... do you have a fork we can use? Or any tips on how to adjust this ourselves?