[Thread Prev][Thread Next][Index]

Re: [ferret_users] emacs



Thanks, Ryo!

The other possibility I considered was using ansi-term. Are you familiar with that? I could set up a key binding that would send the current buffer to emacs using ansi-term.

Could you try running ferret in ansi-term and see how that works for you? (M-x ansi-term)

Thanks, Mark

Mark Verschell
markverschell@xxxxxxxxxxxxxx

"What we have done for ourselves alone dies with us. What we have done for others and the world remains and is immortal." - Albert Pines



On Aug 16, 2009, at 11:56 PM, Ryo Furue wrote:

Hi Mark,

| I was the person who created the ferret mode for emacs. I haven't done
| anything with it for a while now, but I have started running it
| again. Maybe it is time to revisit the ferret mode and update it. That
| is an interesting idea about running ferret from within emacs, I am
| not currently aware of how to accomplish that — but it sounds like a
| great feature!

I haven't figured out everything, but here are key pieces which I've
tested and found to work:

;(start-process name-of-the-process buffer-for-output name-of-command)
(start-process "ferret-process" "*ferret-output*" "/usr/local/bin/ ferret")

(defun ferret-send-buffer ()
  (interactive)
  (process-send-region "ferret-process" 1 (point-max)))
  ; send the process the entire buffer (from position 1 to the end).

Execute (evaluate) these expressions, go to a buffer that is
displaying a ferret script, then evaluate the following expression
to define the keys

 (local-set-key "\C-c\C-c" 'ferret-send-buffer)

and type C-c C-c.  In this way, I was able to send Ferret
the contents of the current buffer by C-c C-c.

I'm a novice in emacs lisp and I don't know how to
fill the remaining gaps at the moment:

1) Bind the keys only for Ferret buffers;
2) C-c C-c should start a Ferret process if none
  has been started;
3) Different Ferret buffers should use separate
  Ferret processes.

and I know there is one non-emacs problem:

4) Ferret cannot handle (as far as I know) long input lines from
 the standard input, so that we have to wrap the ferret around
 in a small shell script that feeds its standard input to Ferret
 through a named pipe "ferret -script namedpipe".

I hope these ideas are useful in extending your Ferret mode.

Regards,
Ryo





[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement