this post was submitted on 25 Oct 2023
1 points (100.0% liked)

Lisp

53 readers
3 users here now

founded 1 year ago
MODERATORS
 

I may have found a solution to my desire for C-c C-z in the slime repl (default slime-nop) to return you to the buffer that sent you to the repl via slime-switch-to-output-buffer (also C-c C-z), with regard to a post/request I made a year ago:

https://www.reddit.com/r/Common_Lisp/comments/xa7imh/seeking_reverse_of_slimeswitchtooutputbuffer/?utm_source=share&utm_medium=web2x&context=3

Basically calling a function which does (switch-to-buffer (slime-recently-visited-buffer 'lisp-mode)) works, or at least does something interesting by approximation.

I'm not much of an emacs coder though and I'm at a loss though as to how to bind my new function calling the above switch-to-buffer to C-c C-z only in the slime repl buffer. Any tips?

top 2 comments
sorted by: hot top controversial new old
[–] dzecniv@alien.top 1 points 1 year ago

Bind a key in the slime-repl-mode-map. Try this:

(defun my/slime-switch-to-recent-lisp-buffer ()
  (interactive)
  (switch-to-buffer (slime-recently-visited-buffer 'lisp-mode)))

(define-key slime-repl-mode-map (kbd "C-c C-z") 'my/slime-switch-to-recent-lisp-buffer)

thanks for the heads up, I'll def try it. So far I bound C-c C-z to 'other-window… simple.

[–] SlowValue@alien.top 1 points 1 year ago

In case a SLY user is reading this. Sly brings sly-switch-to-most-recent, you might have to bind it to C-c C-z yourself in sly-mrepl-mode-map.