开发者

How to choose what scheme to use for emacs?

开发者 https://www.devze.com 2023-01-12 18:00 出处:网络
I have the following code in ~/.emacs for running scheme (gosh and mit-scheme). ;(setq scheme-program-name \"gosh -i\")

I have the following code in ~/.emacs for running scheme (gosh and mit-scheme).

;(setq scheme-program-name "gosh -i")
(setq scheme-program-name "mit-scheme")
(autoload 'scheme-mode "cmuscheme" "Major mode for scheme." t)
(autoload 'run-scheme "cmuscheme" "Run an inferior scheme process." t)

(defun scheme-other-window ()
 "Run scheme on other window"
 (interactive)
 (switch-to-buffer-other-window
  (get-buffer-create "*scheme*"))
 (run-scheme scheme-program-name))

(define-key global-map
  "\C-cs" 'scheme-other-window)

C-c s starts the scheme in REP开发者_StackOverflow中文版L way specified at 'scheme-program-name', and I select the scheme to use by commenting out one or the other.

Is there better way than this? I mean, can I select which scheme to use with 'M-x' or something?


If you invoke run-scheme with a prefix argument, it will ask you which scheme you want to run -- you can fake that by running it with

(let ((current-prefix-arg 1)) (call-interactively 'run-scheme))


quack.el is probably the better solution, but should you want to keep using run-scheme this version of the function includes Eli's suggestion and does work.

(defun scheme-other-window ()
  "Run scheme on another window"
  (interactive)
  (switch-to-buffer-other-window
   (get-buffer-create "*scheme*"))
  ;; This causes run-scheme to act as if C-u had been entered before it was called.
  (let ((current-prefix-arg 1)) 
    (call-interactively 'run-scheme)))


Look at quack.el- it has a better Scheme mode and queries for what Scheme you wish to run.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号