This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Using Emacs with Kawa


> Specifically, when I'm defining a function, a prompt similar to the
> following appears:
>
> #|(---:2|#

Here's my two cents (in addition to the other responses).  What I do
is:

1. Use cmuscheme in Emacs, it works the best for me.

    (autoload 'scheme-mode "cmuscheme" "Major mode for Scheme." t)
    (autoload 'run-scheme "cmuscheme" "Switch to interactive Scheme buffer." t)

2. Set the kawa binary in Emacs.

    (setq scheme-program-name "/your/kawa/name ...")

3. Make Emacs recognize the kawa prompt:

    (defun my-inferior-scheme-mode-hook ()
      (turn-on-font-lock)
      (setq comint-process-echoes t)
      (setq comint-prompt-regexp "^#[^#]+# +"))
    (add-hook 'inferior-scheme-mode-hook 'my-inferior-scheme-mode-hook)

4. In the Kawa startup file (I think it's ~/.kawarc.scm) change the
   Kawa prompt to not put those open parens as continuation lines.

    (define (my-no-continuation-prompter port)
      (define (prompt port s)
        (string-append "#|"
                       s
                       (number->string (input-port-line-number port))
                       "|# "))
      (let ((state (input-port-read-state port)))
        (cond
         ((char=? state #\Newline) "")
         ((char=? state #\Space) (prompt port "kawa:" ))
         ((char=? state #\() "")
         (else ""))))

    (set-input-port-prompter! (current-input-port) my-no-continuation-prompter)


Good luck!

Regards,
Chris Dean


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]