help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to use Emacs with Scheme without tears and joint pain?


From: Pascal J. Bourguignon
Subject: Re: How to use Emacs with Scheme without tears and joint pain?
Date: Sat, 15 Aug 2009 12:44:38 +0200
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.3 (darwin)

fft1976 <fft1976@gmail.com> writes:

> On Aug 14, 7:54 pm, p...@informatimago.com (Pascal J. Bourguignon)
> wrote:
>> fft1976 <fft1...@gmail.com> writes:
>> > I tried to use Emacs as suggested in the Gambit manual, and I also
>> > tried the
>> > Quack mode. Either I'm not using them right, or they just don't
>> > provide the functionality I need. I'm not looking for something as
>> > advanced as SLIME necessarily (which AFAIK only works with Scheme48),
>> > but at least something like what you get with ELISP:
>>
>> > When you are editing a file, and eval an expression to the REPL, you
>> > get an answer in the minibuffer (which should temporarily expand if
>> > necessary) Also, if there is an error, you get a kind of pop-up window
>> > that's easy to dismiss and get to the top level of the REPL. I don't
>> > get these with Quack or Gambit mode.
>>
>> > How do you make this work with Emacs? Commercial IDEs ruined this for
>> > me.
>>
>> Apart from the popup window, inferior-lisp provides the minimal needed
>> features.  With C-x C-e I'm happy.
>>
>
> None of the features I asked about. C-x C-e doesn't send the output to
> the minibuffer.

Try this:

(defun scheme-output-to-minibuffer (string)
  (let* ((string (let ((prompt (format "%s\\'" comint-prompt-regexp)))
                   (if (string-match prompt string)
                       (subseq string 0 (match-beginning 0))
                       string)))
         (string (if (string-match "\\`[\n\t ]*\\(.*[^\n\t ]\\)[\n\t ]*\\'" 
string)
                     (match-string 1 string)
                     string)))
    (message "%s" string)))


(add-hook 'inferior-scheme-mode-hook
          (lambda () (pushnew 'scheme-output-to-minibuffer
                               comint-output-filter-functions)))



>> Then you could take the port of swank to scheme48, and adapt it to the
>> schemes you use, so you could take advantage of slime.
>>
>
> I don't know ELISP, and really don't feel like reading a book about it
> and Emacs hacking just to get some basic Scheme development
> functionality working.

The fundamental essence of emacs is that you may change its behavior
if you don't like it.  You can do that by modifying customization
variables, try: M-x customize-group RET scheme RET and see if there is
an option to send scheme output to the minibuffer; or by modifying the
emacs program itself, writing emacs lisp code.  If you don't have a
customization option to do what you want, and you don't want to write
emacs lisp code, then the answer is that emacs cannot do what you
want.  Perhaps you should try another IDE.  PLT-scheme comes with a
nice IDE.

-- 
__Pascal Bourguignon__


reply via email to

[Prev in Thread] Current Thread [Next in Thread]