efricas patch

1 view
Skip to first unread message

Ralf Hemmecke

unread,
Oct 19, 2008, 2:52:08 PM10/19/08
to fricas-devel, Martin Rubey
Hi Martin, hello Waldek,

I've added a few commands to make Martin's fricas.el, fricas-cpl.el and
efricas available.

After

./configure && make && make install

there will be a script "efricas" in bindir (the same place where the
fricas script is). Furthermore there will be

${prefix}/lib/fricas/emacs/fricas.el
${prefix}/lib/fricas/emacs/fricas-cpl.el

Martin, could you check whether everything works fine? I seem to have
problems to work with your mode. ENTER does not work as I would expect.

If everything works fine then, I'd like to get authorization to commit
that patch to trunk.

After that I would like to get rid of fricas-cpl.el in the SVN
repository since it should be generated.


Ralf

PS: Note that this patch should remove trunk/contrib/emacs/efricas from
the repository. efricas will be generated at compile time to get the
load-path for fricas.el right.

emacs.patch

Martin Rubey

unread,
Oct 20, 2008, 2:10:46 AM10/20/08
to Ralf Hemmecke, fricas-devel
Ralf Hemmecke <ra...@hemmecke.de> writes:

> Martin, could you check whether everything works fine? I seem to have problems
> to work with your mode. ENTER does not work as I would expect.

There is one bug I know of, which happens *sometimes* at startup. The symptom
is that you get a *fricas* buffer, first line empty, while the second line
contains just "(1) -> ", and up to and including that last blank, everything is
in the default output colour. Point should be just after the blank after "(1)
->".

If you hit enter in this situation, the second line should then contain
"(1) -> (1) -> ", where the second prompt is *not* coloured. Thereafter,
everything should work fine.

Expected behaviour is, that *fricas* contains something like the following at
startup - depending on the underlying lisp, where the last prompt is
uncoloured:

-- gcl ------------------------------------------------------------------------
(1) -> (1) ->
Value = (LAMBDA-CLOSURE () () () (X &OPTIONAL ARGS)
(PRINC (CODE-CHAR 27))
(COND
((AND (EQ X '|startKeyedMsg|)
(MEMBER (CAR ARGS) '('S2GL0012 'S2GL0013 'S2GL0014)))
(PRINC "|startTypeTime|"))
((AND (EQ X '|endOfKeyedMsg|)
(MEMBER (CAR ARGS) '('S2GL0012 'S2GL0013 'S2GL0014)))
(PRINC "|endOfTypeTime|"))
(T (PRIN1 X)))
(PRINC #\Newline))
(1) ->
-- sbcl -----------------------------------------------------------------------
(1) -> (1) ->
Value = #<INTERPRETED-FUNCTION NIL {B865395}>
(1) ->
-- ecl ------------------------------------------------------------------------
(1) -> (1) -> Value = #<bytecompiled-function #<bytecompiled-function 0000000000f2f820>>
(1) ->
-------------------------------------------------------------------------------

> If everything works fine then, I'd like to get authorization to commit that
> patch to trunk.

Hm, it seems that it doesn't work on your machine, does it? What emacs version
do you have there?

Some more comments:

> +all: all-ax all-contrib
>
> +all-contrib:
> + cd contrib/emacs && ${MAKE}
> +

I'm not sure, but maybe making the emacs mode should be conditional?

> +###################################################################
> +## The following section deals with running fricas inside emacs.
> +## The sources are expected in ${srcdir}/contrib/emacs.
> +## The shell script efricas will be copied to ${bindir}.
> +## The files fricas*.el should probably go to
> +# emacsdatadir=$pkgdatadir/emacs/site-lisp
> +## but will currently be put into
> +emacsdatadir=$libdir/fricas/emacs

I think that emacsdatadir should be customizable. Maybe you look into the
configure of gcl, they also seem to try to detect the site-lisp directory.
Although we decided that we won't do that, maybe you find some suggestions
there.

> +efricas:
> + echo "#!/bin/sh -" > $@
> + echo "AXIOMEDITOR='emacsclient +$$line $$name >/dev/null 2>&1'" >> $@
> + echo "export AXIOMEDITOR" >> $@
> + echo "if which emacs; then \\" >> $@
> + echo "emacs --eval '${EMACSCMDS}' -f fricas; \\" >> $@
> + echo "else \\" >> $@
> + echo "echo You must have installed emacs to run efricas.; fi" >> $@

I'm not sure whether emacsclient comes with emacs for emacs 21, by the way...


Ralf, many many thanks,

Martin

Ralf Hemmecke

unread,
Oct 20, 2008, 3:31:07 AM10/20/08
to fricas...@googlegroups.com, Martin Rubey
>> If everything works fine then, I'd like to get authorization to commit that
>> patch to trunk.

> Hm, it seems that it doesn't work on your machine, does it? What emacs version
> do you have there?

Well, I think the problem was that efricas calls "fricas" and not fricas
with a full path. So at the time of writing it called my previous
installation. Now I have removed that and everything seems to work.
Still, I hate to see the initial stuff

(1) -> (1) ->
Value = (LAMBDA-CLOSURE () () () (X &OPTIONAL ARGS)
(PRINC (CODE-CHAR 27))
(COND
((AND (EQ X '|startKeyedMsg|)
(MEMBER (CAR ARGS) '('S2GL0012 'S2GL0013 'S2GL0014)))
(PRINC "|startTypeTime|"))
((AND (EQ X '|endOfKeyedMsg|)
(MEMBER (CAR ARGS) '('S2GL0012 'S2GL0013 'S2GL0014)))
(PRINC "|endOfTypeTime|"))
(T (PRIN1 X)))
(PRINC #\Newline))
(1) ->

in the *fricas* buffer (which cannot even be deleted by hand). But maybe
that can be resolved later.

> Some more comments:
>
>> +all: all-ax all-contrib
>>
>> +all-contrib:
>> + cd contrib/emacs && ${MAKE}

> I'm not sure, but maybe making the emacs mode should be conditional?

Why? Putting a few bytes into bin and lib/fricas does not really hurt.
And then try to deinstall emacs and run "efricas" and see what happens.
;-) Maybe it is easier to just investigate that script.

>> +###################################################################
>> +## The following section deals with running fricas inside emacs.
>> +## The sources are expected in ${srcdir}/contrib/emacs.
>> +## The shell script efricas will be copied to ${bindir}.
>> +## The files fricas*.el should probably go to
>> +# emacsdatadir=$pkgdatadir/emacs/site-lisp
>> +## but will currently be put into
>> +emacsdatadir=$libdir/fricas/emacs

> I think that emacsdatadir should be customizable. Maybe you look into the
> configure of gcl, they also seem to try to detect the site-lisp directory.
> Although we decided that we won't do that, maybe you find some suggestions
> there.

I am not trying to detect anything with emacsdatadir. If the prefix is
/usr/local or just /usr, then $pkgdatadir/emacs/site-lisp expands to ...
Oh wait... it should be just $datadir not $pkgdatadir. So it expands to:
/usr/local/share/emacs/site-lisp. Which is correct, at least for debian.
Unfortunately, I don't know about other distributions.

But as you see efricas sets the load-path for emacs, so it doesn't
really matter where fricas.el actually live. And for people who know
emacs, they know how to adjust their .emacs file if the want to start
fricas inside their already running emacs.

>> +efricas:
>> + echo "#!/bin/sh -" > $@
>> + echo "AXIOMEDITOR='emacsclient +$$line $$name >/dev/null 2>&1'" >> $@
>> + echo "export AXIOMEDITOR" >> $@
>> + echo "if which emacs; then \\" >> $@
>> + echo "emacs --eval '${EMACSCMDS}' -f fricas; \\" >> $@
>> + echo "else \\" >> $@
>> + echo "echo You must have installed emacs to run efricas.; fi" >> $@

> I'm not sure whether emacsclient comes with emacs for emacs 21, by the way...

Well, it is your code, I've just copied it. I hope, I am not responsible
for finding out about emacsclient. I can only tell that I have the
debian etch installation of emacs (21.4.1) and emacsclient is accessible.

Ralf

Martin Rubey

unread,
Oct 20, 2008, 9:15:53 AM10/20/08
to Ralf Hemmecke, fricas-devel, Martin Rubey
Ralf Hemmecke <ra...@hemmecke.de> writes:

> Hi Martin, hello Waldek,
>
> I've added a few commands to make Martin's fricas.el, fricas-cpl.el and efricas
> available.
>
> After
>
> ./configure && make && make install
>
> there will be a script "efricas" in bindir (the same place where the fricas
> script is). Furthermore there will be

After a fresh build, I get:

make[1]: Betrete Verzeichnis '/local/scratch/ax-build/contrib/emacs'
/usr/bin/install -c -m 644 ../../../fricas/contrib/emacs/fricas.el
/users/rubey//lib/fricas/emacs/fricas.el
/usr/bin/install -c -m 644 ../../../fricas/contrib/emacs/fricas-cpl.el
/users/rubey//lib/fricas/emacs/fricas-cpl.el
/usr/bin/install -c efricas '/users/rubey//bin/efricas'
/usr/bin/install: Aufruf von stat für „efricas“ nicht möglich: No such file or
directory
make[1]: *** [install-emacs] Fehler 1
make[1]: Verlasse Verzeichnis '/local/scratch/ax-build/contrib/emacs'
make: *** [install] Fehler 2

Martin

Ralf Hemmecke

unread,
Oct 20, 2008, 9:21:55 AM10/20/08
to fricas...@googlegroups.com, Martin Rubey
> After a fresh build, I get:
>
> make[1]: Betrete Verzeichnis '/local/scratch/ax-build/contrib/emacs'
> /usr/bin/install -c -m 644 ../../../fricas/contrib/emacs/fricas.el
> /users/rubey//lib/fricas/emacs/fricas.el
> /usr/bin/install -c -m 644 ../../../fricas/contrib/emacs/fricas-cpl.el
> /users/rubey//lib/fricas/emacs/fricas-cpl.el
> /usr/bin/install -c efricas '/users/rubey//bin/efricas'
> /usr/bin/install: Aufruf von stat für „efricas“ nicht möglich: No such file or
> directory
> make[1]: *** [install-emacs] Fehler 1
> make[1]: Verlasse Verzeichnis '/local/scratch/ax-build/contrib/emacs'
> make: *** [install] Fehler 2

I am not sure whether that applies, but did you actually remove
"trunk/contrib/emacs/efricas" as I said in the PS of

http://groups.google.com/group/fricas-devel/browse_thread/thread/f17c6a1bdcc71729

Ralf

Martin Rubey

unread,
Oct 20, 2008, 9:43:37 AM10/20/08
to Ralf Hemmecke, fricas...@googlegroups.com
Ralf Hemmecke <ra...@hemmecke.de> writes:

Yes, it applies. I didn't realize that I would have to remove it myself,
stupid me.

Seems to work, von mir aus commit.

Martin


Ralf Hemmecke

unread,
Oct 20, 2008, 9:49:37 AM10/20/08
to fricas...@googlegroups.com
>> I am not sure whether that applies, but did you actually remove
>> "trunk/contrib/emacs/efricas" as I said in the PS of

>> http://groups.google.com/group/fricas-devel/browse_thread/thread/f17c6a1bdcc71729

> Yes, it applies. I didn't realize that I would have to remove it myself,
> stupid me.

> Seems to work, von mir aus commit.

OK. Do I get the OK from Master Waldek?

Ralf

Waldek Hebisch

unread,
Oct 20, 2008, 2:26:35 PM10/20/08
to fricas...@googlegroups.com

Yes, go on.


--
Waldek Hebisch
heb...@math.uni.wroc.pl

Reply all
Reply to author
Forward
0 new messages