[9fans] acme/sam linewrapping off - Plan9

This is a discussion on [9fans] acme/sam linewrapping off - Plan9 ; Hi all, Is there any way how to sensibly edit a file with long lines (eg. a table with many fields, like /sys/lib/lp/devices) using acme/sam? What I miss is a way to not wrap long lines when I need to ...

+ Reply to Thread
Results 1 to 17 of 17

Thread: [9fans] acme/sam linewrapping off

  1. [9fans] acme/sam linewrapping off

    Hi all,

    Is there any way how to sensibly edit a file with long lines (eg. a table
    with many fields, like /sys/lib/lp/devices) using acme/sam? What I miss is a
    way to not wrap long lines when I need to concentrate
    on the different fields and a whole
    single line is a true representative of an item (a printer).

    Thanks
    Ruda


  2. Re: [9fans] acme/sam linewrapping off

    > Is there any way how to sensibly edit a file with long lines (eg. a table
    > with many fields, like /sys/lib/lp/devices) using acme/sam? What I miss is a
    > way to not wrap long lines when I need to concentrate
    > on the different fields and a whole
    > single line is a true representative of an item (a printer).


    make the frame long enough to hold the whole line.

    for example in acme, use a single column display and a tiny font. you
    can get one by middle clicking on this

    Font /lib/font/bit/misc/ascii.5x7.font

    - erik



  3. Re: [9fans] acme/sam linewrapping off

    Thanks for the answer, although it did not please me...
    (In Vim, you only have to do :set nowrap and you are done... From time to
    time I find this rather useful.)
    Ruda


    On 23/03/2008, erik quanstrom wrote:
    >
    > > Is there any way how to sensibly edit a file with long lines (eg. a

    > table
    > > with many fields, like /sys/lib/lp/devices) using acme/sam? What I miss

    > is a
    > > way to not wrap long lines when I need to concentrate
    > > on the different fields and a whole
    > > single line is a true representative of an item (a printer).

    >
    >
    > make the frame long enough to hold the whole line.
    >
    > for example in acme, use a single column display and a tiny font. you
    > can get one by middle clicking on this
    >
    > Font /lib/font/bit/misc/ascii.5x7.font
    >
    >
    > - erik
    >
    >
    >



  4. Re: [9fans] acme/sam linewrapping off

    > Thanks for the answer, although it did not please me...
    > (In Vim, you only have to do :set nowrap and you are done... From time to
    > time I find this rather useful.)
    > Ruda


    it's unreasonable for the lp configuration file to need lines 200 characters long.
    i would think it would make more sense to talk about addressing lp's unreasonable
    requirments rather than complaining about acme's lack of features.

    - erik



  5. Re: [9fans] acme/sam linewrapping off

    Well, what you are saying is usually true (that line lengths should usually
    not be too long). I mentioned the lp configuration file as an example (a
    particular one, thought, since there it was that I encountered the problem).
    Nonetheless, even if I had only a reasonable number of fields (say 5) and I
    had the field names (string comments) above the real
    field values, it could easily happen the lines would be wrapped if my
    window weren't big enough. The
    same happens even when viewing an ordinary program code, if the window is
    not large enough. Adjusting the window size or font size
    is one way to go, however, why should I be forced to do it, when it's by no
    way neccessary, had I the option to not wrap... All I want to see are the
    beginings of lines and should I decide to edit a particular line I had no
    problem moving to it and edit it.

    Another, even more compelling example is, when you want to look at some
    scientific data from some experiment. There it is quite common to have rows
    of data, each row having say 20 real
    numbers, each row meaning one 'step' of the experiment. With acme or sam,
    with/without your solution, you have no simple way of looking at it. Using
    Vim, it's an easy task, you can turn the wrapping off...

    Ruda

    On 23/03/2008, erik quanstrom wrote:
    >
    > > Thanks for the answer, although it did not please me...
    > > (In Vim, you only have to do :set nowrap and you are done... From time

    > to
    > > time I find this rather useful.)
    > > Ruda

    >
    >
    > it's unreasonable for the lp configuration file to need lines 200
    > characters long.
    > i would think it would make more sense to talk about addressing lp's
    > unreasonable
    > requirments rather than complaining about acme's lack of features.
    >
    >
    > - erik
    >
    >
    >



  6. Re: [9fans] acme/sam linewrapping off

    Also, for me that 5x7 font is already almost illegible...

    On 23/03/2008, Rudolf Sykora wrote:
    >
    > Well, what you are saying is usually true (that line lengths should
    > usually not be too long). I mentioned the lp configuration file as an
    > example (a particular one, thought, since there it was that I encountered
    > the problem). Nonetheless, even if I had only a reasonable number of fields
    > (say 5) and I had the field names (string comments) above the real
    > field values, it could easily happen the lines would be wrapped if my window weren't big enough. The
    > same happens even when viewing an ordinary program code, if the window is
    > not large enough. Adjusting the window size or font size
    > is one way to go, however, why should I be forced to do it, when it's by no
    > way neccessary, had I the option to not wrap... All I want to see are the
    > beginings of lines and should I decide to edit a particular line I had no
    > problem moving to it and edit it.
    >
    > Another, even more compelling example is, when you want to look at some
    > scientific data from some experiment. There it is quite common to have rows
    > of data, each row having say 20 real
    > numbers, each row meaning one 'step' of the experiment. With acme or sam,
    > with/without your solution, you have no simple way of looking at it. Using
    > Vim, it's an easy task, you can turn the wrapping off...
    >
    > Ruda
    >
    > On 23/03/2008, erik quanstrom wrote:
    > >
    > > > Thanks for the answer, although it did not please me...
    > > > (In Vim, you only have to do :set nowrap and you are done... From time

    > > to
    > > > time I find this rather useful.)
    > > > Ruda

    > >
    > >
    > > it's unreasonable for the lp configuration file to need lines 200
    > > characters long.
    > > i would think it would make more sense to talk about addressing lp's
    > > unreasonable
    > > requirments rather than complaining about acme's lack of features.
    > >
    > >
    > > - erik
    > >
    > >
    > >

    >



  7. Re: [9fans] acme/sam linewrapping off

    > Another, even more compelling example is, when you want to look at some
    > scientific data from some experiment. There it is quite common to have rows
    > of data, each row having say 20 real numbers, each row meaning one 'step' of
    > the experiment. With acme or sam, with/without your solution, you have no
    > simple way of looking at it. Using Vim, it's an easy task, you can turn the
    > wrapping off...


    I tend to think editing tabular data is a task for a different
    program. 20 real numbers of a similar length are probably fine in
    Vim. But throw in a couple of fields where the length varies and
    keeping track of columns across lines gets to be a real task, wrapping
    or no. I'd like to see an acme-like environment for editing tables.
    (I know, "Quit talking; start coding.")

    Micah


  8. Re: [9fans] acme/sam linewrapping off

    On 3/23/08, Rudolf Sykora wrote:
    > Another, even more compelling example is, when you want to look at some
    > scientific data from some experiment.


    Maybe there's someone out there who has done a spreadsheet for Plan 9?

    I've never looked, are there any open source spreadsheets around that would lend
    themselves as a starting point?

    Robby


  9. Re: [9fans] acme/sam linewrapping off

    I understand that a speadsheet would solve the situation, but...
    Vim has always been sufficient for the task I described, having that one
    particular feature.
    If acme were able of the same, it would suffice me as well...

    Ruda

    On 24/03/2008, Robert Raschke wrote:
    >
    > On 3/23/08, Rudolf Sykora wrote:
    > > Another, even more compelling example is, when you want to look at some
    > > scientific data from some experiment.

    >
    >
    > Maybe there's someone out there who has done a spreadsheet for Plan 9?
    >
    > I've never looked, are there any open source spreadsheets around that
    > would lend
    > themselves as a starting point?
    >
    > Robby
    >
    >



  10. Re: [9fans] acme/sam linewrapping off

    On Tue, Mar 25, 2008 at 3:33 PM, Rudolf Sykora wrote:
    > I understand that a speadsheet would solve the situation, but...
    > Vim has always been sufficient for the task I described, having that one
    > particular feature.
    > If acme were able of the same, it would suffice me as well...
    >
    > Ruda
    >


    Then vim@plan9 may be a good choice for your problem :-)

    > stefanha to 9fans
    >
    > I am porting Vim and have made the first tarballs available. See
    > http://vmsplice.net/9vim.html.
    >
    > If you are interested, please try it and let me know how it goes. It
    > is usable, but do not rely on it yet.
    >
    > Things that currently do not work:
    > * Shell execution (including :sh, !, :make, vimdiff, man page
    > viewing, and suspend)
    > * Mouse
    > * Some unicode characters appear not to be fixed width
    > * Startup is slow
    >
    > Stefan
    >
    > PS: Please avoid flamewar .



    --
    HZ


  11. Re: [9fans] acme/sam linewrapping off

    Hi,

    Well, vim@plan9 could definitely be a choice. But, doesn't it go against the
    basic philosophy of Plan9 creators??!

    Sam, as far as I know, was created with orthogonality and simplicity in mind
    (as well as whole Plan9). It only added a few commands compared to ed. Just
    what is truly needed. Vim is highly configurable, any instance of it behaves
    slightly differently, and it has incomparably higher complexity, which makes
    it, some would say (read E. S. Raymond's Art of unix) awful. We parhaps
    really don't need that. But nowadays, you don't have a choice: neither sam
    nor acme can be used.

    Ruda

    On 25/03/2008, Hongzheng Wang wrote:
    >
    > On Tue, Mar 25, 2008 at 3:33 PM, Rudolf Sykora
    > wrote:
    > > I understand that a speadsheet would solve the situation, but...
    > > Vim has always been sufficient for the task I described, having that one
    > > particular feature.
    > > If acme were able of the same, it would suffice me as well...
    > >
    > > Ruda
    > >

    >
    >
    > Then vim@plan9 may be a good choice for your problem :-)
    >
    >
    >



  12. Re: [9fans] acme/sam linewrapping off

    > Well, vim@plan9 could definitely be a choice. But, doesn't it go against the
    > basic philosophy ... ??!


    the response here usually follows these steps:

    (1) at most a mild suggestion to try using the system somewhat as intended
    (2) ignoring it

    this is in contrast to affirmative-action companies such as Apple, where
    a port of Vim to the iPhone and Touch would quickly be sensed by the
    caveman intrusion detection system,
    and Jobs would soon turn up to shame the ingrate in public,
    and rip the device from those cheating hands.



  13. Re: [9fans] acme/sam linewrapping off

    I haven't said that to use Vim is bad. Vim is my most favourite editor. I am
    myself happy to have Vim around in Plan9 (and am not alone for sure).
    Nonetheless, it's bad to not have an alternative which would follow the
    system's principles. Please read all I mentioned before. Vim does not follow
    those and is more and more distant from them (adding more and more features,
    becoming bloated). But now, there is not a Plan9-like editor suited for
    editing e.g. aforementioned files with several (real-number) fields (it
    simply gets wrapped and is unreadable then; using small fonts is not a
    proper solution since a too small font renders the file unreadable again).
    To be forced to use Vim right away is in my opinion sad. (Opposite to what
    you propose: you have to use Vim, you have no other way == you can't ignore
    it.)

    R

    On 25/03/2008, Charles Forsyth wrote:
    >
    > > Well, vim@plan9 could definitely be a choice. But, doesn't it go against

    > the
    >
    > > basic philosophy ... ??!

    >
    > the response here usually follows these steps:
    >
    > (1) at most a mild suggestion to try using the system somewhat as intended
    > (2) ignoring it
    >
    > this is in contrast to affirmative-action companies such as Apple, where
    > a port of Vim to the iPhone and Touch would quickly be sensed by the
    > caveman intrusion detection system,
    > and Jobs would soon turn up to shame the ingrate in public,
    > and rip the device from those cheating hands.
    >
    >
    >



  14. Re: [9fans] acme/sam linewrapping off

    > I haven't said that to use Vim is bad. Vim is my most favourite editor. I am
    > myself happy to have Vim around in Plan9 (and am not alone for sure).
    > Nonetheless, it's bad to not have an alternative which would follow the
    > system's principles. Please read all I mentioned before. Vim does not follow
    > those and is more and more distant from them (adding more and more features,
    > becoming bloated). But now, there is not a Plan9-like editor suited for
    > editing e.g. aforementioned files with several (real-number) fields (it
    > simply gets wrapped and is unreadable then; using small fonts is not a
    > proper solution since a too small font renders the file unreadable again).
    > To be forced to use Vim right away is in my opinion sad. (Opposite to what
    > you propose: you have to use Vim, you have no other way == you can't ignore
    > it.)


    why don't you add this feature to acme? you have the source. you care about
    this feature.

    - erik



  15. Re: [9fans] acme/sam linewrapping off

    On 25/03/2008, erik quanstrom wrote:
    >
    > > I haven't said that to use Vim is bad. Vim is my most favourite editor.

    > I am
    > > myself happy to have Vim around in Plan9 (and am not alone for sure).
    > > Nonetheless, it's bad to not have an alternative which would follow the
    > > system's principles. Please read all I mentioned before. Vim does not

    > follow
    > > those and is more and more distant from them (adding more and more

    > features,
    > > becoming bloated). But now, there is not a Plan9-like editor suited for
    > > editing e.g. aforementioned files with several (real-number) fields (it
    > > simply gets wrapped and is unreadable then; using small fonts is not a
    > > proper solution since a too small font renders the file unreadable

    > again).
    > > To be forced to use Vim right away is in my opinion sad. (Opposite to

    > what
    > > you propose: you have to use Vim, you have no other way == you can't

    > ignore
    > > it.)

    >
    >
    > why don't you add this feature to acme? you have the source. you care
    > about
    > this feature.
    >
    >
    > - erik
    >
    >
    >

    I just love this switch...
    In my opinion, before you start implementing anything (if it's not trivial),
    you should be well convinced about its usefulness. This has two points.
    First you should find if your task can't be done in another, possibly better
    way (use another program, use already existing and known trick), and second,
    you should not do something others have already solved.
    Until now, people who answered me in this list proposed no good solution.
    Others agued my problem is not an issue. For the latter I tried to lay down
    some reasons why I think, it is an issue. Hopefully clearly enough. So first
    I wanted to see that nobody here can give me a satisfactory solution. This
    has been actually happening.
    Only then I can think how much work it would be for me to add the feature.
    Since I am a physicist and a beginner in Plan9, I can't do it straight away,
    maybe in a few weeks time. But I know at least now, that first, it would be
    useful to add it (nobody has done it yet), and second, that I just can't use
    Plan9 for my real job now.

    If I code it, I will let you know.

    R
    R.


  16. Re: [9fans] acme/sam linewrapping off

    On Tue, Mar 25, 2008 at 2:39 AM, Rudolf Sykora wrote:

    > Well, vim@plan9 could definitely be a choice. But, doesn't it go against the
    > basic philosophy of Plan9 creators??!



    Who cares? I talked to one of those creators @ google a little while
    back. In response to some of my probing on "what if we change this" he
    said, "well, we're pretty much out of it, you can do what you deem
    necessary".

    Sure, there are a few rules you ought to follow. Don't go the path of
    Linux and add a system call every time you need something new. But,
    the code is not Holy Writ. It's code. Change it and learn.

    ron


  17. Re: [9fans] acme/sam linewrapping off

    have you considered using sam to break each line into multiple lines
    and then rejoining. e.g. if you have a | separated record structure, you
    could do something like:

    ,x/^.*\n/ {
    s/\|/\n/g
    s/\n/\n\n/
    }

    edit the fields, then rejoin before writing it back:

    ,y/\n\n/ x/\n/ c/|/
    ,x/\n\n/ c/\n/

    fyi, i'm a casual sam user and there are probably better ways.



+ Reply to Thread