qi-mode.el

8 views
Skip to first unread message

praimon

unread,
Jan 17, 2008, 3:09:03 PM1/17/08
to Qilang
Hello,
I noticed there's an emacs for Qi at:
http://code.google.com/p/qilang/downloads/list

I'm not too familiar with emacs, though I did manage
to get slime working with my clisp. I also managed to
run maxima from emacs by following the directions in
the maxima.el file. However, I can't decipher the
qi-mode.el file. Can anyone provide some directions?

I'm running windows xp.

Thanks,
praimon

Victor Kryukov

unread,
Jan 17, 2008, 11:40:04 PM1/17/08
to Qilang
Hello,

I become interested in Qi recently, and I've just finished installing
qi-mode.el. It's actually pretty easy.

(Note: my environment is Mac OS X, Emacs 22.1.1 and SBCL 1.0.12.)

1. Download qi-mode.el and save it somewhere. I've saved it to the
usual Unix place ~/elisp/qi-mode.el, where ~ stands for home directory
- /Users/victor in my case.

2. In your .emacs (or however emacs initialization file is called on
emacs) include the following lines (adjust them accordingly to your
environment):

(add-to-list 'load-path "~/elisp/") ; make sure that the directory
where qi-mode.el lives is in the emacs lisp path
(require 'qi-mode) ; require the qi-mode library
(setf inferior-qi-program "/Users/victor/bin/qi") ; path to the qi
launcher

/Users/victor/bin/qi is a simple shell script that runs qi for me:

#!/bin/bash
sbcl --core /Users/victor/Qi\ 9.1/Qi.core

you should probably use whatever windows .bat file you use to launch
Qi.

3. Now, once qi-mode.el is installed, it should be turned
automatically every time your visit .qi file. Once there, run M-x
inferior-qi, and it will run a Qi interpretor in a separate window.
Now, once in your source file, you can go to the end of the form and
run C-x e (evaluate) - it will evaluate the form, as if you've entered
it yourself in the *inferior-qi* buffer.

Hope that helps,
Victor.

praimon

unread,
Jan 18, 2008, 5:34:56 PM1/18/08
to Qilang
Hello,
Thanks for your help. I feel that I'm almost there :)
I pretty sure I've done the 'add-to-list' and 'require' correctly,
and when I open a .qi file it does seem to go into Qi mode
(at least a Qi appears on the menu bar).

But then running M-x inferior-qi gives the following error:
"Spawning child process: invalid argument"

I have:
(setf inferior-qi-program "C:/Qi 9.1/Qi-Windows-CLisp.bat")

I've also tried directly:
(setf inferior-qi-program "C:/Qi 9.1/clisp.exe -M lispinit.mem
startup.txt")
where 'clisp.exe -M lispinit.mem startup.txt' is the content of
the .bat file.

I'll need to investigate this some more.
regards,
praimon

Victor Kryukov

unread,
Jan 19, 2008, 11:39:11 PM1/19/08
to Qilang
On Jan 18, 4:34 pm, praimon <prai...@gmail.com> wrote:
> Hello,
> Thanks for your help. I feel that I'm almost there :)
> I pretty sure I've done the 'add-to-list' and 'require' correctly,
> and when I open a .qi file it does seem to go into Qi mode
> (at least a Qi appears on the menu bar).
>
> But then running M-x inferior-qi gives the following error:
> "Spawning child process: invalid argument"
>
> I have:
> (setf inferior-qi-program "C:/Qi 9.1/Qi-Windows-CLisp.bat")
>
> I've also tried directly:
> (setf inferior-qi-program "C:/Qi 9.1/clisp.exe -M lispinit.mem
> startup.txt")
> where 'clisp.exe -M lispinit.mem startup.txt' is the content of
> the .bat file.

A hint: space in 'Qi 9.1' could be a problem. Try to rename this
directory to something w/o a space.

praimon

unread,
Jan 20, 2008, 7:14:07 PM1/20/08
to Qilang
Bless you!
I'm embarrassed to say that worked. I had tried:
"C:/Qi\ 9.1/Qi-Windows-CLisp.bat" without success, thinking
that would have taken care of any space problem.

That brings up the question: why on earth is the default
expansion of the zip file (which I innocently accepted)
set up with the space: Qi 9.1?

regards, and thanks again!
praimon

On Jan 19, 11:39 pm, Victor Kryukov <victor.kryu...@gmail.com> wrote:
> > I have:
> > (setf inferior-qi-program "C:/Qi 9.1/Qi-Windows-CLisp.bat")
>

Victor Kryukov

unread,
Jan 21, 2008, 11:27:36 AM1/21/08
to Qilang
On 20 Jan, 18:14, praimon <prai...@gmail.com> wrote:
> Bless you!
> I'm embarrassed to say that worked. I had tried:
> "C:/Qi\ 9.1/Qi-Windows-CLisp.bat" without success, thinking
> that would have taken care of any space problem.

"C:/Qi\\ 9.1/Qi-Windows-CLisp.bat" should work - notice that backslash
is doubled. You want the _resulting_ string to contain backslash _and_
space. When elisp _reads_ "\ " (just a space preceded by a backslash)
it _parses_ it as a backquoted space, i.e. just normal space.

> That brings up the question: why on earth is the default
> expansion of the zip file (which I innocently accepted)
> set up with the space: Qi 9.1?

I guess the answer is that Mr. Tarver likes it that way. I don't think
he uses Emacs for development - otherwise we would have seen qi-
mode.el earlier than later. Though, from my personal experience, it's
almost impossible to use Qi, as well as any Lisp/Scheme, w/o a proper
editor with paren matching.
Reply all
Reply to author
Forward
0 new messages