bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] How to set the screen width in APL interpreter


From: Juergen Sauermann
Subject: Re: [Bug-apl] How to set the screen width in APL interpreter
Date: Sun, 25 Dec 2016 16:34:09 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

Hi Alexey,

I applied your patch (almost).

The patch didn't quite work because the workspace is created before the
command line arguments are parsed (so that another )CLEAR was needed
before the --PW value would be used, and the value did not survive )CLEAR
as described by IBM. I have fixed both in SVN 828.

Before we continue converting every system variable into a command line option, please
note that ⎕ARG gives you access to all command line arguments of GNU APL. So setting
⎕PW from ⎕ARG in your ⎕LX function would have had the same effect as the patch.

Alternatively, ⎕ENV gives you access to the environment variables when GNU APL
was started, which might be even better than a command line option.

/// Jürgen


On 12/25/2016 10:24 AM, Alexey Veretennikov wrote:
Hi,

Yes I understand your reasoning.
I've searched about ⎕PW behavior in IBM Reference
manual as well as tested its behavior with Dyalog APL.
As it states in IBM Reference Manual ⎕PW is a session-wide variable,
therefore I guess should not be attached to the workspace. In Dyalog
APL according to my experiments it is the case.
So I've taken the liberty to implement the command-line argument to set
the value of ⎕PW system variable as "--PW value", so the users who know
their terminal width (like I am since I'm running the terminal with
command line geometry option) could set the appropriate width.
I've also modified Archive to not to load this variable from workspaces
and use default one (or provided in command line argument) to comply
with IBM APL reference manual.

Kindly see the patch attached.



Juergen Sauermann <address@hidden> writes:

Hi Alexey,

I do not think this is a good idea.

I believe many people will be surprised if ⎕PW is different from 80.
And GNU APL does not necessarily run in a terminal. In my experience,
the terminal width is a fairly unreliable parameter on many platforms, and
adjusting ⎕PW automatically is asking for trouble.

So for the sake of compatibility and the principle of least surprises, I leave ⎕PW at 80.

Please not also that negative ⎕FIO arguments are not protable and not
available on all platforms (that's why they are not documented).

Most people do not put things in ⎕LX directly but have some larger APL function that
is called from ⎕LX. So an extra line in that function which sets ⎕PW is probably the
better solution.

/// Jürgen

On 12/24/2016 10:13 AM, Alexey Veretennikov wrote:

 Thanks! Both versions works for me on OSX, however on my small linux box tput
is not available while ⎕FIO¯8 works fine.

Jurgen, maybe it could be added as a default configuration for GNU APL
interpreter? From usability point it rather confusing to set this
variable manually (right now I did it in ⎕LX in CONTINUE workspace)

Christian Robert <address@hidden> writes:

       ⎕fio ¯8
200

undocumented ⎕fio ¯8 give you the window width,

Xtian.


On 2016-12-23 19:43, Kacper Gutowski wrote:

 On Sat, Dec 24, 2016 at 12:14:41AM +0100, Alexey Veretennikov wrote:

 I'm running GNU APL in the X terminal with geometry 48x15 (it is
 a small
screen). How could I set this width(48) to the GNU APL interpreter so it
will behave correctly on deletion of characters in long lines etc?


Setting print width affects line editing as well.  It should wrap
correctly if you set ⎕PW to the width of your terminal.

      ⎕PW←⍎↑⍎')HOST tput cols'

Sometimes I wish GNU APL did this automatically on WINCH.

-k





    


reply via email to

[Prev in Thread] Current Thread [Next in Thread]