Skip to content

Instantly share code, notes, and snippets.

@bowbow99
Created April 20, 2012 18:41
Show Gist options
  • Save bowbow99/2430946 to your computer and use it in GitHub Desktop.
Save bowbow99/2430946 to your computer and use it in GitHub Desktop.
#xyzzy M-x start-repl するのに疲れた
(defun switch-to-repl ()
"repl を開く。
既に見えてたらそのウィンドウへ。既に開いてたらそのバッファへ。まだ開いて
なかったら開く。"
(interactive)
(let* ((repl-buffer (find-buffer "*repl*"))
(repl-window (when repl-buffer (get-buffer-window repl-buffer))))
(cond (repl-window (set-window repl-window))
(repl-buffer (switch-to-buffer repl-buffer))
(t (start-repl)))))
(define-key *global-keymap* #\M-F4 'switch-to-repl)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment