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

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/ZoS1r4SoLOGUKpI7%40fricas.org.
--- ../trunk.pp6/src/interp/i-syscmd.boot	2024-07-01 20:07:47.791983024 +0000
+++ i-syscmd.boot	2024-07-03 02:13:56.858534213 +0000
@@ -2271,7 +2271,7 @@
 
 reportOpsFromUnitDirectly1 D ==
   showFile := '"SHOW.LISTING"
-  erase_lib(showFile)
+  maybe_delete_file(showFile)
   $sayBrightlyStream : fluid := MAKE_OUTSTREAM(showFile)
   sayShowWarning()
   reportOpsFromUnitDirectly D
@@ -2292,8 +2292,9 @@
   reportOpsFromLisplib(unitForm,u)
 
 reportOpsFromLisplib1(unitForm,u)  ==
+  $useEditorForShowOutput : local := false
   showFile := '"SHOW.LISTING"
-  erase_lib(showFile)
+  maybe_delete_file(showFile)
   $sayBrightlyStream : fluid := MAKE_OUTSTREAM(showFile)
   sayShowWarning()
   reportOpsFromLisplib(unitForm,u)

Reply via email to