Open lispercat opened 4 years ago
You could always wrap it in a save-excursion
or save-window-excursion
.
Thanks, Eric save-window-excursion does the trick
On Tue, Dec 24, 2019 at 3:23 PM Eric Kaschalk notifications@github.com wrote:
You could always wrap it in a save-excursion or save-window-excursion.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/hylang/hy-mode/issues/87?email_source=notifications&email_token=AACCZB4HLBVEZXS4VP47HHTQ2JVS5A5CNFSM4J6U2Y22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHTS5XY#issuecomment-568798943, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACCZBY4DLYJFLFOAMG5UGDQ2JVS5ANCNFSM4J6U2Y2Q .
It would be amazing to have a defcustom
to tweak this behavior.
Behavior similar to eval-last-sexp
as default would be awesome.
Behavior similar to
eval-last-sexp
as default would be awesome.
You can try something like this:
(use-package hy-mode
:bind (:map hy-mode-map ("C-c C-c" . my-hy-eval-last-sexp))
:config
;; Don't echo python code back
(setq hy-shell--interpreter-args '("--repl-output-fn" "hy.contrib.hy-repr.hy-repr"))
(defun my-hy-eval-last-sexp ()
(interactive)
(save-window-excursion
(hy-shell--send (hy--last-sexp-string)))))
Maybe it's a feature, but every time I press C-M-x it takes me to the Hy buffer so I have to need to go back to my source file. Not sure if it's the intended behavior, just feels rather odd. Is there a way to configure to stay in the source unless I explicitly want to go to Hy?