1

Ok, so I just got the F# extension working for emacs. I now need to figure out how to make the scripts I write actually execute. In Visual Studio, to run them you just highlight, right click, and choose "Send to Interactive". I do not expect that emacs has that or anything similar, but I have no idea how to make an f# script interact with with fsi. So, in essence, how do you run a script after writing it, using emacs or terminal?

EDIT: For clarification, I am running emacs on a mac.

EDIT2: Because I am running on a mac, emacs has no way to execute the script, since fsi doesn't exist as a usable thing for macs. Apparently. How sad. I will just choose the most voted answer as correct.

1
  • I think the key bindings (at least the Ctrl key bindings) are the same on a Mac. Commented Feb 15, 2012 at 3:02

2 Answers 2

5

I'm not an Emacs user myself, but Laurent Le Brun has done some work on F# mode for Emacs, which is probably the most comfortable way to use F# from Emacs. His blog post talks about Alt+Enter, so I suppose the F# mode adds handling for this keyboard shortcut.

If you don't want to install this, then I guess you'll just need to run fsi.exe as a normal console application in another buffer and copy your F# intput there (appending ;; to the end, to send the command to fsi.exe).

Sign up to request clarification or add additional context in comments.

Comments

5

According to this page the readme file included with the package should document the keystrokes available. And, according to that readme, these are the keystrokes in question:

3) Bindings

If you are new to Emacs, you might want to use the menu (call
menu-bar-mode if you don't see it). However, it's usually faster to learn
a few useful bindings:

- C-c C-r       Evaluate region
- C-c C-e       Evaluate current toplevel phrase
- C-M-x         Evaluate current toplevel phrase
- C-M-h         Mark current toplevel phrase
- C-c C-s       Show interactive buffer
- C-c C-c       Compile with fsc
- C-c x         Run the executable
- C-c C-a       Open alternate file (.fsi or .fs)
- C-c l         Shift region to left
- C-c r         Shift region to right
- C-c <up>      Move cursor to the beginning of the block

So I'm guessing you want the Ctrl-c Ctrl-r combo.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.