running scheme from emacs

后端 未结 4 1931
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-16 16:47

I\'m a newbie to LISP.

I am attempting to invoke the scheme interpreter from within emacs (version 23 running on windows). I loaded the xscheme library by telling em

相关标签:
4条回答
  • 2020-12-16 17:15

    I'll start by saying that I'm very new to programming, scheme and SICP, but I'm trying to work through the course and watch the lectures that are online.
    I'm running emacs on Ubuntu 12.10 and I really wanted to get MIT scheme working in emacs instead of relying on Edwin.
    The above tips didn't work for me, but here's the step-by-step instructions that did work:

    1. Install emacs 24 from the Ubuntu Software Center (search "emacs" and install it!)
    2. Open a terminal (ALT + CTRL + t)
    3. Go to your home directory (cd ~)
    4. Open the hidden file .emacs in gedit (gedit .emacs)
    5. On the first line of the file, type exactly what's after the colon: (require 'xscheme)
    6. Save the changes to .emacs
    7. That's it!!!

    You can now open .scm files in emacs and use commands like C-x C-e.

    *directions courtesy of http://alexott.net/en/writings/emacs-devenv/EmacsScheme.html#sec14

    0 讨论(0)
  • 2020-12-16 17:22

    Add this line to your .emacs file:

    (setq scheme-program-name "gsi")
    

    (Replace "gsi" with the name of your Scheme interpreter.)

    You can then start the interpreter with M-x run-scheme. You can evaluate pieces of code by using C-x C-e (to evaluate the sexp before the point) or with C-M-x to evaluate the sexp you're in right now. You can also load a file with C-c C-l.

    0 讨论(0)
  • 2020-12-16 17:35

    My guess is that it's just a known issue I still dunno how to sort that out (it's out of my current skills) but I got a macro that probably helps: just after writing the s-exp you can do Cc-Cz (it calls the geiser REPL) then C-spc, C-M-b, M-w, C-x-o, C-y and RET.

    There are a variation (same, placed just after writing the s-exp): C-spc, C-M-b, M-w, C-c Cz, C-y and RET

    0 讨论(0)
  • 2020-12-16 17:40

    Try setting the scheme-program-name variable to the path to your Scheme interpreter. The major-mode of the scheme buffer is probably just comint and you cannot do much about it unless you switch to something more capable like Geiser - something that I'd recommend you do.

    0 讨论(0)
提交回复
热议问题