From: Andrey I. <and...@ma...> - 2024-01-25 16:52:50
|
Hi, Francis, First of all thank you very much for REDUCE-IDE! I'm very happy that Reduce has its own Emacs mode and interface to the interpreter. My platform is Linux. Currently I am using Debian 12 (Emacs 28.2) and GNU Guix (Emacs 29.1). Andrey. Francis Wright wrote: > Hi, Andrey > > Thanks for your email. I'll consider your suggestions for the next release of REDUCE-IDE. What platform(s) are you using? I think I added the code to remove ansi-color-process-output a very long time ago and the reason probably related to an old version of MS Windows. I can probably now remove it, as least on some platforms. > > Best wishes, > Francis > > ________________________________ > From: Andrey Ignatenko via Reduce-algebra-developers <red...@li...> > Sent: 25 January 2024 2:56 PM > To: red...@li... <red...@li...> > Subject: [Reduce-algebra-developers] SIGINT handling of CSL Reduce inside Emacs Reduce-IDE and TeXmacs interfaces > > Hello all, > > I hope the following may be of interest both to users and developers. > > 1. CSL version of Reduce, when used inside Emacs via Reduce-IDE > interface simply terminates on SIGINT (interrupt) signal generated, > e.g., by C-c C-c keystroke. Very similar behaviour is observed for CSL > Reduce in TeXmacs session when the calculation is interrupted by > pressing to the 'Stop' button. > > I find this behaviour of redcsl inside above-mentioned very useful > Reduce interfaces quite inconvenient. Below I suggest a couple of simple > hacks that allow to get rid of this for Emacs Reduce-IDE. > > 2. First of all, this behaviour is not specific to Reduce-IDE. The same > is observed when 'redcsl -w' is run inside Emacs shell (M-x shell) > buffer. Moreover, it is not specific to Emacs at all since it manifests > themselves when Reduce is run inside ordinary terminal via command 'env > TERM=dumb redcsl -w' which sets environment variable TERM to 'dumb'. > Inside Emacs shell the variable TERM is also set to 'dumb' by default. > > 3. The idea of the hack is to trick redcsl to think that it was run > inside more sophisticated terminal when a 'dumb' terminal. You can > archive this by setting 'reduce-run-commands Reduce-IDE variable to > (("CSL" . "env TERM=<termname> redcsl --nogui") ("PSL" . "redpsl")) with > <termname> replaced by one of the terminals known to your system. For > example, you can try "eterm-color", the default value of TERM variable > inside Emacs terminal (M-x term). With this modification Reduce-IDE (M-x > run-reduce) now reacts properly to C-c C-c interrupts. > > However, Reduce-IDE does not handle terminal color codes now emitted by > redcsl. There are two solution to this problem. First, one can use > <termname> corresponding to terminal that does not support color codes, > e.g. "vt100" or "vremote". Second, one can modify source code of > Reduce-IDE by commenting out the following two lines > > (remove-hook (make-local-variable 'comint-output-filter-functions) > 'ansi-color-process-output t) ; remove locally! > > in "reduce-run.el" file, thus allowing Reduce-ide to process color > codes. Above these two lines there is the following comment > > ;; ansi-color-process-output causes an error when CSL is terminated > ;; and is probably irrelevant anyway, so ... > > However, I do not observe any errors with CSL termination on Emacs 28.2. > Maybe the time has come to remove these lines from Reduce-IDE package? > > Regards, > Andrey Ignatenko > > > _______________________________________________ > Reduce-algebra-developers mailing list > Red...@li... > https://lists.sourceforge.net/lists/listinfo/reduce-algebra-developers > |