[9fans] sam question
  Home FAQ Contact Sign in
comp.os.plan9 only
 
Advanced search
POPULAR GROUPS

more...

comp.os.plan9 Profile…
 Up
[9fans] sam question         


Author: Skip Tavakkolian
Date: Jul 17, 2008 16:00

related to the earlier discussion, for stripping the \r at the end of
lines in windows files, i use:

,x/$/ c//

where is a cut&pasted return char (yes, i could use '.' instead,
but i'm paranoid.) x doesn't seem to recognize \r as a escape
sequence. true?
4 Comments
Re: [9fans] sam question         


Author: erik quanstrom
Date: Jul 17, 2008 17:33

> related to the earlier discussion, for stripping the \r at the end of
> lines in windows files, i use:
>
> ,x/$/ c//
>
> where is a cut&pasted return char (yes, i could use '.' instead,
> but i'm paranoid.) x doesn't seem to recognize \r as a escape
> sequence. true?

no they don't: sam/regexp.c and acme/regx.c both have a lex function
that starts basically like this (from acme)

int
lex(void){
int c;

c = *exprp++;
switch(c){
case '\\':
if(*exprp)
if((c= *exprp++)=='n')
c='\n';
Show full article (0.58Kb)
3 Comments
Re: [9fans] sam question         


Author: Pietro Gagliardi
Date: Jul 17, 2008 17:50

On Jul 17, 2008, at 8:28 PM, erik quanstrom wrote:
> i suppose you could also type
ctl+m
2 Comments
Re: [9fans] sam question         


Author: roger peppe
Date: Jul 18, 2008 03:07

On Fri, Jul 18, 2008 at 1:45 AM, Pietro Gagliardi mac.com> wrote:
> On Jul 17, 2008, at 8:28 PM, erik quanstrom wrote:
>> i suppose you could also type
>
> ctl+m

interestingly this only works in some versions of acme and sam.
it seems to work ok under plan 9, and in inferno's acme,
but not in p9p or acme sac.
1 Comment
Re: [9fans] sam question         


Author: Russ Cox
Date: Jul 18, 2008 06:26

> interestingly this only works in some versions of acme and sam.
> it seems to work ok under plan 9, and in inferno's acme,
> but not in p9p or acme sac.

There are two different issues here. One is getting
an actual \r to the program in question (acme, sam, etc.)
and the second is how that program interprets it.

The first issue is getting a \r to the program.
On most systems, you type \r. On Windows,
Enter sends \r so the keyboard handler swaps \r and \n,
so you type Ctl-J to get \r. (If anyone cared, I think
you could check for Ctl in the input handler and not
swap in that case.) This applies to drawterm, inferno,
and 9pm, which all share the same gui code (I think 9pm
is the progenitor).
Show full article (1.56Kb)
no comments