)set output showeditor issues

4 views
Skip to first unread message

Grégory Vanuxem

unread,
Jun 14, 2024, 10:32:02 AMJun 14
to fricas...@googlegroups.com
Hello,

FriCAS just cloned, commit (1b5c139) and installed with
--prefix=/home/user/.local

Looking at the different output modes in FriCAS, I tried the
showeditor option, output from ')show' in an editor.

GVim:

(1) -> )sh SINT
Unable to open directory to be removed
rmdir failed: Not a directory
Unable to open directory to be removed
rmdir failed: Not a directory
(1) ->

Directly two empty gvim (gvim is not supported, I know).

With export FRICASEDITOR=emacs
(1) -> )set output showedit on
(1) -> )sh SINT
Unable to open directory to be removed
rmdir failed: Not a directory
Unable to open directory to be removed
rmdir failed: Not a directory
(1) ->

After you close the first empty emacs, it restarts one, empty also.

That scared me a little bit. What is it trying to delete...

Default settings:
(1) -> )set output showeditor on
(1) -> )sh SINT
Unable to open directory to be removed
rmdir failed: Not a directory

Warning: environment variable FRICASEDITOR not set.
Launching 'less' in an 'xterm'.
Press space to continue, 'q' to quit.

Warning: environment variable FRICASEDITOR not set.
Launching 'less' in an 'xterm'.
Press space to continue, 'q' to quit.

Again, a first window, here an Xterm, with the SINT domain opened by
less. After pressing 'q', like emacs, another less in an xterm is
started, but here SINT is also loaded in less.

- Greg

BTW: do you happen to know a very simple graphical text editor, with
very few libraries needed, compatible. Opening something with a 14''
laptop in an xterm becomes illisible to (too small fonts by default
and not very practical). Using Windows has some goodness... I have no
Linux desktop environment and I do not need one in WSL.

Grégory Vanuxem

unread,
Jun 14, 2024, 3:17:46 PMJun 14
to fricas...@googlegroups.com
Accessorily, after viewing the SINT domain, a file SHOW.LISTING still stays in the working directory, even if fricas is closed. 

Qian Yun

unread,
Jun 14, 2024, 8:31:28 PMJun 14
to fricas...@googlegroups.com


On 6/14/24 22:31, Grégory Vanuxem wrote:
> Hello,
>
> FriCAS just cloned, commit (1b5c139) and installed with
> --prefix=/home/user/.local
>
> Looking at the different output modes in FriCAS, I tried the
> showeditor option, output from ')show' in an editor.
>
> GVim:
>
> (1) -> )sh SINT
> Unable to open directory to be removed
> rmdir failed: Not a directory
> Unable to open directory to be removed
> rmdir failed: Not a directory
> (1) ->

It's removing "SHOW.LISTING". It should be rm instead of rmdir.

> Directly two empty gvim (gvim is not supported, I know).

gvim should be supported, see bellow.

> With export FRICASEDITOR=emacs

The documentation for ')help edit' is wrong, you should set like this:

export FRICASEDITOR='emacs $name'

>
> BTW: do you happen to know a very simple graphical text editor, with
> very few libraries needed, compatible. Opening something with a 14''
> laptop in an xterm becomes illisible to (too small fonts by default
> and not very practical). Using Windows has some goodness... I have no
> Linux desktop environment and I do not need one in WSL.
>

Like I said above, gvim or emacs or another GUI text editor should work,
the key is to include '$name' in FRICASEDITOR.

On the other hand, you can config xterm to use bigger fonts, so that
'less' can be shown with bigger fonts.

- Qian

Grégory Vanuxem

unread,
Jun 14, 2024, 9:46:28 PMJun 14
to fricas...@googlegroups.com
Hello Qian,

Le sam. 15 juin 2024 à 02:31, Qian Yun <oldk...@gmail.com> a écrit :


On 6/14/24 22:31, Grégory Vanuxem wrote:
> Hello,
>
> FriCAS just cloned, commit (1b5c139) and installed with
> --prefix=/home/user/.local
>
> Looking at the different output modes in FriCAS, I tried the
> showeditor option, output from ')show' in an editor.
>
> GVim:
>
> (1) -> )sh SINT
> Unable to open directory to be removed
> rmdir failed: Not a directory
> Unable to open directory to be removed
> rmdir failed: Not a directory
> (1) ->

It's removing "SHOW.LISTING".  It should be rm instead of rmdir.

> Directly two empty gvim (gvim is not supported, I know).

gvim should be supported, see bellow.

> With export FRICASEDITOR=emacs

The documentation for ')help edit' is wrong, you should set like this:

export FRICASEDITOR='emacs $name'

Ok, I forgot this.

I postponed looking deeper into this, for example i-syscmd.boot, thanks for looking at it.

By the way, I had a remaining open xterm with less open in it several hours ago with no FriCAS opened. Latest FriCAS version (with your last patch, closing hyperdoc if started with )hd). I don't know if this is related to HyperDoc. I will look at how to reproduce it, from hyperdoc or )set out showeditor. I opened some xterm-s with the two methods. 


>
> BTW: do you happen to know a very simple graphical text editor, with
> very few libraries needed, compatible. Opening something with a 14''
> laptop in an xterm becomes illisible to (too small fonts by default
> and not very practical). Using Windows has some goodness... I have no
> Linux desktop environment and I do not need one in WSL.
>

Like I said above, gvim or emacs or another GUI text editor should work,
the key is to include '$name' in FRICASEDITOR.

Yes, that's good, thanks again! I will be able to use gvim or emacs.

I still do not understand why, with the eventually absent file because of bad parameters, editors/viewers are opened two times.  
 

On the other hand, you can config xterm to use bigger fonts, so that
'less' can be shown with bigger fonts.

Yes, it is possible I did it in the past but for me it was always a relative mess  since a  long time to choose good fonts, 10646 or no, 75 dpi or 100 dpi and more.

- Greg 

Grégory Vanuxem

unread,
Jun 15, 2024, 11:16:23 AMJun 15
to fricas...@googlegroups.com
Hello,

> Unable to open directory to be removed
> rmdir failed: Not a directory

I looked at this a little, I have not totally understood the use of erase_lib here (i-syscmd.boot).  It is defined in nlib.lisp and seems to be a case sensitive wrapper for delete-directory. Here I would have used erase_file or something like that but this function does not exist. Furthermore, erase_lib is often used and from what I have seen not always for FriCAS lib directories. I may be wrong. There is some room to improve readability and fix this I think.

Line 2294 and after of i-syscmd.boot
reportOpsFromLisplib1(unitForm,u)  ==
  showFile := '"SHOW.LISTING"
  erase_lib(showFile)
  $sayBrightlyStream : fluid := MAKE_OUTSTREAM(showFile)
  sayShowWarning()
  reportOpsFromLisplib(unitForm,u)
  SHUT $sayBrightlyStream
  editFile showFile

- Greg

Waldek Hebisch

unread,
Jul 2, 2024, 10:21:38 PMJul 2
to fricas...@googlegroups.com
On Fri, Jun 14, 2024 at 04:31:21PM +0200, Grégory Vanuxem wrote:
> Hello,
>
> FriCAS just cloned, commit (1b5c139) and installed with
> --prefix=/home/user/.local
>
> Looking at the different output modes in FriCAS, I tried the
> showeditor option, output from ')show' in an editor.
>
> With export FRICASEDITOR=emacs
> (1) -> )set output showedit on
> (1) -> )sh SINT
> Unable to open directory to be removed
> rmdir failed: Not a directory
> Unable to open directory to be removed
> rmdir failed: Not a directory
> (1) ->
>
> After you close the first empty emacs, it restarts one, empty also.
>
> That scared me a little bit. What is it trying to delete...
>
> Default settings:
> (1) -> )set output showeditor on
> (1) -> )sh SINT
> Unable to open directory to be removed
> rmdir failed: Not a directory
>
> Warning: environment variable FRICASEDITOR not set.
> Launching 'less' in an 'xterm'.
> Press space to continue, 'q' to quit.
>
> Warning: environment variable FRICASEDITOR not set.
> Launching 'less' in an 'xterm'.
> Press space to continue, 'q' to quit.
>
> Again, a first window, here an Xterm, with the SINT domain opened by
> less. After pressing 'q', like emacs, another less in an xterm is
> started, but here SINT is also loaded in less.

The attached patch should fix the problems above. Concerning
SHOW.LISTING staying after FriCAS exit, AFAICS this was intended.
But it easy to change, just two more callse to 'maybe_delete_file'.

--
Waldek Hebisch
show.diff
Reply all
Reply to author
Forward
0 new messages