9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] sam mod for delete-forward
@ 2001-03-26  8:45 Douglas A. Gwyn
  0 siblings, 0 replies; 9+ messages in thread
From: Douglas A. Gwyn @ 2001-03-26  8:45 UTC (permalink / raw)
  To: 9fans

Recently I got tired of not being able to delete in front of the cursor
with DEL the way most other text editors work these days, so I changed
"samterm" to do that.  I made it conditional on DELFWD so you can compile
it to work either way; this could be made an environmental switch or
command-line option instead.  Or, my preference, officially change sam
to always work this way.

term% diff main.BAK main.c
488d487
< 			case '\b':
489a489,494
> #ifdef DELFWD	/* DAG -- want DEL key to delete forward, not backward */
> 				l->p0 = a;
> 				l->p1 = a<l->origin+l->f.nchars? a+1 : a;
> 				break;
> #endif
> 			case '\b':
490a496
> 				l->p1 = a;
493a500
> 				l->p1 = a;
496a504
> 				l->p1 = a;
499d506
< 			l->p1 = a;

Here is what the updated section of /sys/src/cmd/samterm/main.c looks like:

	}else if(backspacing && !hostlock){
		if(l->f.p0>0 && a>0){
			switch(c){
			case 0x7F:	/* del */
#ifdef DELFWD	/* DAG -- want DEL key to delete forward, not backward */
				l->p0 = a;
				l->p1 = a<l->origin+l->f.nchars? a+1 : a;
				break;
#endif
			case '\b':
				l->p0 = a-1;
				l->p1 = a;
				break;
			case 0x15:	/* ctrl-u */
				l->p0 = ctlu(&t->rasp, l->origin, a);
				l->p1 = a;
				break;
			case 0x17:	/* ctrl-w */
				l->p0 = ctlw(&t->rasp, l->origin, a);
				l->p1 = a;
				break;
			}
			if(l->p1 != l->p0){
				/* cut locally if possible */


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] sam mod for delete-forward
  2001-03-28  8:37           ` Douglas A. Gwyn
@ 2001-03-29  8:26             ` Boyd Roberts
  0 siblings, 0 replies; 9+ messages in thread
From: Boyd Roberts @ 2001-03-29  8:26 UTC (permalink / raw)
  To: 9fans

Douglas A. Gwyn <DAGwyn@null.net> a crit dans le message :
> WHILE YOU'RE AT IT WHY NOT ADD DOSKEY FUNCTIONALITY TOO THE COMMAND
WINDOW?
> (There were unnecessary figure/letter shifts around the spaces.)

While I've rarely agreed with you I know you're no fool.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] sam mod for delete-forward
  2001-03-27 16:51         ` Dan Cross
@ 2001-03-28  8:37           ` Douglas A. Gwyn
  2001-03-29  8:26             ` Boyd Roberts
  0 siblings, 1 reply; 9+ messages in thread
From: Douglas A. Gwyn @ 2001-03-28  8:37 UTC (permalink / raw)
  To: 9fans

Dan Cross wrote:
> It's a paper tape image.  I'm not sure what the text says, though.

Since it has 5 levels, one assumes it uses Baudot code.
(He may have put the sprocket track in the wrong row.)
Translating:
WHILE YOU'RE AT IT WHY NOT ADD DOSKEY FUNCTIONALITY TOO THE COMMAND WINDOW?
(There were unnecessary figure/letter shifts around the spaces.)


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] sam mod for delete-forward
  2001-03-27 14:01       ` Sam
@ 2001-03-27 16:51         ` Dan Cross
  2001-03-28  8:37           ` Douglas A. Gwyn
  0 siblings, 1 reply; 9+ messages in thread
From: Dan Cross @ 2001-03-27 16:51 UTC (permalink / raw)
  To: 9fans

In article <01032709015600.08511@softnet> you write:
>At the risk of asking a perhaps foolish question . . .
>What the hell is this!?!

It's a paper tape image.  I'm not sure what the text says, though.
I think the first letter is ``I,'' though.

	- Dan C.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] sam mod for delete-forward
  2001-03-27  8:25     ` Boyd Roberts
@ 2001-03-27 14:01       ` Sam
  2001-03-27 16:51         ` Dan Cross
  0 siblings, 1 reply; 9+ messages in thread
From: Sam @ 2001-03-27 14:01 UTC (permalink / raw)
  To: 9fans

At the risk of asking a perhaps foolish question . . .
What the hell is this!?!

:),

sam
On Tuesday 27 March 2001 03:25, you wrote:
> Douglas A. Gwyn <gwyn@arl.army.mil> a crit dans le message :
> 3ABF5D54.B549A18B@arl.army.mil...
>
> > I appreciate the point.  It is a pity that the industry didn't agree on
> > standard uses for control keystrokes.  Actually DEL is RUBOUT, which
> > should be ignored since it is where the punched paper tape was
> > backspaced and overpunched to remove an erroneous character.  ESC is
> > supposed to introduce a *sequence* of characters.
> >
> |-------------|
> | o o .     o |
> |     . o   o |
> |   o . o     |
> |   o .     o |
> | o   .       |
> | o o .   o o |
> |     . o     |
> | o o . o o o |
> | o   . o   o |
> |     .   o o |
> | o o . o     |
> | o o .   o o |
> | o o .   o   |
> | o o . o o o |
> |   o .   o   |
> | o   .       |
> | o o .   o o |
> |     . o     |
> | o o . o o o |
> | o o .       |
> |     .     o |
> | o o .   o o |
> |     . o     |
> | o o . o o o |
> |   o . o     |
> |     .     o |
> | o o .   o o |
> |     . o     |
> | o o . o o o |
> | o o .     o |
> |     . o   o |
> | o   . o   o |
> | o o .   o o |
> |     . o     |
> | o o . o o o |
> |     . o o   |
> |     .   o o |
> |     .     o |
> | o o .   o o |
> |     . o     |
> | o o . o o o |
> | o o .       |
> | o   .   o   |
> | o   .   o   |
> | o o .   o o |
> |     . o     |
> | o o . o o o |
> | o   .   o   |
> |     .   o o |
> | o   . o     |
> | o o . o o   |
> | o   .       |
> | o   . o   o |
> | o o .   o o |
> |     . o     |
> | o o . o o o |
> | o   . o o   |
> | o o . o     |
> |     . o o   |
> |   o . o o   |
> |     .     o |
> |   o . o     |
> |     .   o o |
> |     . o o   |
> | o o .       |
> |   o .     o |
> |   o . o     |
> |     .     o |
> | o   . o   o |
> | o o .   o o |
> |     . o     |
> | o o . o o o |
> |     .     o |
> |     .   o o |
> | o o .   o o |
> |     . o     |
> | o o . o o o |
> |     .     o |
> |     . o   o |
> | o   .       |
> | o o .   o o |
> |     . o     |
> | o o . o o o |
> |   o . o o   |
> |     .   o o |
> |     . o o o |
> |     . o o o |
> | o o .       |
> |     . o o   |
> | o   .   o   |
> | o o .   o o |
> |     . o     |
> | o o . o o o |
> | o o .     o |
> |   o . o     |
> |     . o o   |
> | o   .   o   |
> |     .   o o |
> | o o .     o |
> | o o .   o o |
> | o   .   o o |
> |   o .       |
> |-------------|

-- 


Sam Hopkins
------------------------------------------------
Random QOTD:
"It now costs more to amuse a child,
	than it once did to educate his father."



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] sam mod for delete-forward
  2001-03-26 15:37   ` Douglas A. Gwyn
@ 2001-03-27  8:25     ` Boyd Roberts
  2001-03-27 14:01       ` Sam
  0 siblings, 1 reply; 9+ messages in thread
From: Boyd Roberts @ 2001-03-27  8:25 UTC (permalink / raw)
  To: 9fans

Douglas A. Gwyn <gwyn@arl.army.mil> a crit dans le message :
3ABF5D54.B549A18B@arl.army.mil...
> I appreciate the point.  It is a pity that the industry didn't agree on
> standard uses for control keystrokes.  Actually DEL is RUBOUT, which
> should be ignored since it is where the punched paper tape was
> backspaced and overpunched to remove an erroneous character.  ESC is
> supposed to introduce a *sequence* of characters.

|-------------|
| o o .     o |
|     . o   o |
|   o . o     |
|   o .     o |
| o   .       |
| o o .   o o |
|     . o     |
| o o . o o o |
| o   . o   o |
|     .   o o |
| o o . o     |
| o o .   o o |
| o o .   o   |
| o o . o o o |
|   o .   o   |
| o   .       |
| o o .   o o |
|     . o     |
| o o . o o o |
| o o .       |
|     .     o |
| o o .   o o |
|     . o     |
| o o . o o o |
|   o . o     |
|     .     o |
| o o .   o o |
|     . o     |
| o o . o o o |
| o o .     o |
|     . o   o |
| o   . o   o |
| o o .   o o |
|     . o     |
| o o . o o o |
|     . o o   |
|     .   o o |
|     .     o |
| o o .   o o |
|     . o     |
| o o . o o o |
| o o .       |
| o   .   o   |
| o   .   o   |
| o o .   o o |
|     . o     |
| o o . o o o |
| o   .   o   |
|     .   o o |
| o   . o     |
| o o . o o   |
| o   .       |
| o   . o   o |
| o o .   o o |
|     . o     |
| o o . o o o |
| o   . o o   |
| o o . o     |
|     . o o   |
|   o . o o   |
|     .     o |
|   o . o     |
|     .   o o |
|     . o o   |
| o o .       |
|   o .     o |
|   o . o     |
|     .     o |
| o   . o   o |
| o o .   o o |
|     . o     |
| o o . o o o |
|     .     o |
|     .   o o |
| o o .   o o |
|     . o     |
| o o . o o o |
|     .     o |
|     . o   o |
| o   .       |
| o o .   o o |
|     . o     |
| o o . o o o |
|   o . o o   |
|     .   o o |
|     . o o o |
|     . o o o |
| o o .       |
|     . o o   |
| o   .   o   |
| o o .   o o |
|     . o     |
| o o . o o o |
| o o .     o |
|   o . o     |
|     . o o   |
| o   .   o   |
|     .   o o |
| o o .     o |
| o o .   o o |
| o   .   o o |
|   o .       |
|-------------|


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] sam mod for delete-forward
  2001-03-26 14:12 ` rob pike
  2001-03-26 15:37   ` Douglas A. Gwyn
@ 2001-03-26 15:42   ` Scott Schwartz
  1 sibling, 0 replies; 9+ messages in thread
From: Scott Schwartz @ 2001-03-26 15:42 UTC (permalink / raw)
  To: 9fans

| I'm nervous about this because rio can't do the same thing, and if you
| get in the habit in sam place you'll be sorry in rio when you kill the
| process.  I regret the different interpretations of ESC and don't want
| to make another mistake like that.

Does rio really need to use the delete key for that?  Most keyboards
these days have some spare function keys, if not a key that's actually
labled something like "Break".



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] sam mod for delete-forward
  2001-03-26 14:12 ` rob pike
@ 2001-03-26 15:37   ` Douglas A. Gwyn
  2001-03-27  8:25     ` Boyd Roberts
  2001-03-26 15:42   ` Scott Schwartz
  1 sibling, 1 reply; 9+ messages in thread
From: Douglas A. Gwyn @ 2001-03-26 15:37 UTC (permalink / raw)
  To: 9fans

rob pike wrote:
> I'm nervous about this because rio can't do the same thing, and if you
> get in the habit in sam place you'll be sorry in rio when you kill the
> process.  I regret the different interpretations of ESC and don't want
> to make another mistake like that.

I appreciate the point.  It is a pity that the industry didn't agree on
standard uses for control keystrokes.  Actually DEL is RUBOUT, which
should be ignored since it is where the punched paper tape was
backspaced and overpunched to remove an erroneous character.  ESC is
supposed to introduce a *sequence* of characters.  Etc.  I'm not sure
why the early Unix use of DEL to generate an INTR signal was carried
into Plan 9, but frankly it seems like a poor choice.  ETX (^C) is a
semi-standard for this function, just as DEL deletes
forward in most text processors these days.

I doubt you want to go the X11-init-file route, but it might be
useful to employ *some* sort of functional key map, defaulting to
whatever you think is best.  Then sam, rio, and other apps could be
uniformly coded to test for the key corresponding to the function
Delete-Word-Backward, Delete-Char-Forward, Generate-Signal, etc.
instead of hard-wiring the functions.  I know that hard-wired
functions make it easier to use somebody else's environment, but I
don't think that trumps the desire to be able to switch among Plan 9
and other OSes without having to retrain one's fingers.

I just realized that while preparing this message under Solaris with
Netscape's Compose window, I used DEL for delete-forward several times.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] sam mod for delete-forward
@ 2001-03-26 14:12 ` rob pike
  2001-03-26 15:37   ` Douglas A. Gwyn
  2001-03-26 15:42   ` Scott Schwartz
  0 siblings, 2 replies; 9+ messages in thread
From: rob pike @ 2001-03-26 14:12 UTC (permalink / raw)
  To: 9fans

I'm nervous about this because rio can't do the same thing, and if you
get in the habit in sam place you'll be sorry in rio when you kill the
process.  I regret the different interpretations of ESC and don't want
to make another mistake like that.

-rob



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2001-03-29  8:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-26  8:45 [9fans] sam mod for delete-forward Douglas A. Gwyn
     [not found] <rob@plan9.bell-labs.com>
2001-03-26 14:12 ` rob pike
2001-03-26 15:37   ` Douglas A. Gwyn
2001-03-27  8:25     ` Boyd Roberts
2001-03-27 14:01       ` Sam
2001-03-27 16:51         ` Dan Cross
2001-03-28  8:37           ` Douglas A. Gwyn
2001-03-29  8:26             ` Boyd Roberts
2001-03-26 15:42   ` Scott Schwartz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).