Emacs / Slime Key Binding / Sending Command for Swank Server

I am familiar with the circuit, but new to emacs (transition from VIM) and elisp.

I know how to do the following:

  • make simple key binding
    • Cc iwb = integral indent buffer
    • F2 = turn on / off folding
  • use slime from emacs
  • some basic keys, such as Cx 2, paredit keys, some basic navigation keys

I need help to do something more advanced:

I want F3 to be equal to:

  • puts emacs in Cx 2 mode.
  • in the bottom window, go to the slime-repl buffer
  • in the slime-repl buffer, send the command "(test / run)" <- note, this is intended to be sent to the swank server, not elisp

, script ; , - , . [ , .]

!

+3
2

, , :

(defun slime-run-test ()
  (interactive)
  (slime-interactive-eval "(test/run)")
  (slime-pop-to-buffer (slime-output-buffer) t))

(global-set-key (kbd "<f3>") 'slime-run-test)
+2

slime, comint, , :

(defun my-slime-test-run ()
  (interactive)
  (delete-other-windows)
  (split-window-below)
  (with-selected-window (next-window)
    (switch-to-buffer "slime-repl")
    (goto-char (point-max))
    (insert "(test-run)")
    (comint-send-input)))

(global-set-key (kbd "<f3>") 'my-slime-test-run)

, , , , , elisp- ( , - , , , , .

C-h f name-of-the-function RET, / .

keybinding C-h k F3, , Emacs , kbd ( , , , ).

, , ( , ).

, , , , , , C-u C-h a ( , , , , . M-: (info "(emacs) Apropos") RET ). , - ( - I I info-apropos ).

, , , Emacs, , .

+1

All Articles