chollida
chollida

Reputation: 7894

Mapping the :edit command to a certain editor

I've got the Haskell interpreter running in Emacs.

With this I've got the typical Emacs setup of 2 open windows,

Using the command :edit file in the interpreter it will open the file I tell it to, but it will open it in Notepad.

Is there a way to map the :edit command to use Emacs instead of Notepad.

It looks like the .hs extension is mapped to to ghci on my machine.

Upvotes: 4

Views: 194

Answers (3)

Alex Ott
Alex Ott

Reputation: 87174

Why not just re-assign .hs to emacs, and run ghci from it?

Upvotes: 0

pajato0
pajato0

Reputation: 3676

I'm guessing that the Haskell interpreter will honor the following:

:set editor emacsclient

and from Emacs do

M-x start-server

and then when you do

:edit file

the file will pop up in your Emacs session. C-x # will tell Emacs to tell Haskell to consume the file.

Upvotes: 10

Michael Steele
Michael Steele

Reputation: 15772

The command you are looking for is :set editor emacs. Using :edit will open up a new emacs process.

For me, it's more convenient to simply edit the files in their own buffers and then :load and :reload them as necessary rather than calling up the editor from within ghci.

Upvotes: 4

Related Questions