9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] eenter with select/snarf/paste
@ 2024-07-16 14:31 sirjofri
  2024-07-16 14:47 ` Jacob Moody
  2024-07-18  4:45 ` ori
  0 siblings, 2 replies; 11+ messages in thread
From: sirjofri @ 2024-07-16 14:31 UTC (permalink / raw)
  To: 9front

Hi all,

I'm using eenter in my spreadsheet program for basically every line input. Some user asked for snarf/paste because that's not supported by eenter yet. Changing eenter wouldn't be a small change, so I wanted to ask first if that change would be accepted to 9front? Otherwise I'll just copy the function to the spread package and add the features there.

Have a good day

sirjofri

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

* Re: [9front] eenter with select/snarf/paste
  2024-07-16 14:31 [9front] eenter with select/snarf/paste sirjofri
@ 2024-07-16 14:47 ` Jacob Moody
  2024-07-16 16:51   ` sirjofri
  2024-07-17 12:57   ` sirjofri
  2024-07-18  4:45 ` ori
  1 sibling, 2 replies; 11+ messages in thread
From: Jacob Moody @ 2024-07-16 14:47 UTC (permalink / raw)
  To: 9front

On 7/16/24 09:31, sirjofri wrote:
> Hi all,
> 
> I'm using eenter in my spreadsheet program for basically every line input. Some user asked for snarf/paste because that's not supported by eenter yet. Changing eenter wouldn't be a small change, so I wanted to ask first if that change would be accepted to 9front? Otherwise I'll just copy the function to the spread package and add the features there.

What would be the mechanism for a user to communicate to the eenter input prompt that they want use the snarf buffer?
Would it be mouse chording? Or perhaps a mouse menu on the input box itself with paste as an option?
I would personally be fine with adding this feature as long the added code doesn't make too much of a mess.
I would also probably expect the libthread variant, enter() in mouse(2), to also be updated to this new functionality.


Thanks,
moody


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

* Re: [9front] eenter with select/snarf/paste
  2024-07-16 14:47 ` Jacob Moody
@ 2024-07-16 16:51   ` sirjofri
  2024-07-16 20:38     ` Scott Flowers
  2024-07-17 12:57   ` sirjofri
  1 sibling, 1 reply; 11+ messages in thread
From: sirjofri @ 2024-07-16 16:51 UTC (permalink / raw)
  To: 9front

16.07.2024 16:48:49 Jacob Moody <moody@posixcafe.org>:

> On 7/16/24 09:31, sirjofri wrote:
>> Hi all,
>>
>> I'm using eenter in my spreadsheet program for basically every line input. Some user asked for snarf/paste because that's not supported by eenter yet. Changing eenter wouldn't be a small change, so I wanted to ask first if that change would be accepted to 9front? Otherwise I'll just copy the function to the spread package and add the features there.
>
> What would be the mechanism for a user to communicate to the eenter input prompt that they want use the snarf buffer?
> Would it be mouse chording? Or perhaps a mouse menu on the input box itself with paste as an option?
> I would personally be fine with adding this feature as long the added code doesn't make too much of a mess.
> I would also probably expect the libthread variant, enter() in mouse(2), to also be updated to this new functionality.

Mouse chording would make most sense to me, given that this is commonly used throughout the system.

I'll take a look at the libthread variant, maybe they are similar enough to share code, at least structure-wise. I'll see what I can do and send a patch, ETA in the next few days.

sirjofri

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

* Re: [9front] eenter with select/snarf/paste
  2024-07-16 16:51   ` sirjofri
@ 2024-07-16 20:38     ` Scott Flowers
  0 siblings, 0 replies; 11+ messages in thread
From: Scott Flowers @ 2024-07-16 20:38 UTC (permalink / raw)
  To: 9front

Hi. I'm "some user" that sirjofre referred to. I was just thinking mouse chording inside the data entry boxes would make sense and be useful.

My two cents.

Scott Flowers
flowerss@cranky.ca

On Tue, 16 Jul 2024, at 10:51, sirjofri wrote:
> 16.07.2024 16:48:49 Jacob Moody <moody@posixcafe.org>:
> 
> > On 7/16/24 09:31, sirjofri wrote:
> >> Hi all,
> >>
> >> I'm using eenter in my spreadsheet program for basically every line input. Some user asked for snarf/paste because that's not supported by eenter yet. Changing eenter wouldn't be a small change, so I wanted to ask first if that change would be accepted to 9front? Otherwise I'll just copy the function to the spread package and add the features there.
> >
> > What would be the mechanism for a user to communicate to the eenter input prompt that they want use the snarf buffer?
> > Would it be mouse chording? Or perhaps a mouse menu on the input box itself with paste as an option?
> > I would personally be fine with adding this feature as long the added code doesn't make too much of a mess.
> > I would also probably expect the libthread variant, enter() in mouse(2), to also be updated to this new functionality.
> 
> Mouse chording would make most sense to me, given that this is commonly used throughout the system.
> 
> I'll take a look at the libthread variant, maybe they are similar enough to share code, at least structure-wise. I'll see what I can do and send a patch, ETA in the next few days.
> 
> sirjofri
> 

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

* Re: [9front] eenter with select/snarf/paste
  2024-07-16 14:47 ` Jacob Moody
  2024-07-16 16:51   ` sirjofri
@ 2024-07-17 12:57   ` sirjofri
  2024-07-17 13:29     ` umbraticus
  1 sibling, 1 reply; 11+ messages in thread
From: sirjofri @ 2024-07-17 12:57 UTC (permalink / raw)
  To: 9front

16.07.2024 16:48:49 Jacob Moody <moody@posixcafe.org>:
> I would also probably expect the libthread variant, enter() in mouse(2), to also be updated to this new functionality.

I compared both variants and they have roughly the same code structure. It would be possible to share the same code by extracting functionality to separate auxiliary functions. However...

> I would personally be fine with adding this feature as long the added code doesn't make too much of a mess.

...this would mean quite some code restructuring. While this will not necessarily end up being a mess, it will result in having ~5 functions instead of just 2.

This will have its upsides and downsides like usual, especially considering future code changes and maintenance. Instead of touching the same code in two different functions twice, it means changing the code only once and having the functionality in both.

I'll see what I can do. For now, I can select text and delete it (backspace and "overtype", if that's a word in this context), and it doesn't react to all mouse buttons so I can chord.

When it's done, I'll need people for testing, especially considering runes and UTF8 character lengths, plus code feedback obviously.

sirjofri

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

* Re: [9front] eenter with select/snarf/paste
  2024-07-17 12:57   ` sirjofri
@ 2024-07-17 13:29     ` umbraticus
  2024-07-17 14:22       ` sirjofri
  0 siblings, 1 reply; 11+ messages in thread
From: umbraticus @ 2024-07-17 13:29 UTC (permalink / raw)
  To: 9front

tangential, but perhaps something to consider in
any rejigging: I recently noticed that clicking
in the prompt part of (e)enter's rectangle is
equivalent to hitting enter. I can see some benefit;
maybe speeds up accepting default string repeatedly
without reaching to the keyboard (eg text search
in mothra). Downside: one can accidentally trigger
it when trying to position cursor at start of the
typing part of the rectangle. Not sure whether this
has delighted or disturbed anyone else.

I am for enabling chording in enter. Double-click at
start or end could select all? a la line select elsewhere.

umbraticus

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

* Re: [9front] eenter with select/snarf/paste
  2024-07-17 13:29     ` umbraticus
@ 2024-07-17 14:22       ` sirjofri
  2024-07-17 22:20         ` thedaemon
  0 siblings, 1 reply; 11+ messages in thread
From: sirjofri @ 2024-07-17 14:22 UTC (permalink / raw)
  To: 9front

17.07.2024 15:30:56 umbraticus@prosimetrum.com:
> tangential, but perhaps something to consider in
> any rejigging: I recently noticed that clicking
> in the prompt part of (e)enter's rectangle is
> equivalent to hitting enter. I can see some benefit;
> maybe speeds up accepting default string repeatedly
> without reaching to the keyboard (eg text search
> in mothra). Downside: one can accidentally trigger
> it when trying to position cursor at start of the
> typing part of the rectangle. Not sure whether this
> has delighted or disturbed anyone else.

It's currently disturbing me while testing. My thinkpad buttons aren't 100% precise, so sometimes a single click is recognized as two clicks, in which case the prompt opens and immediately closes.

sirjofri

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

* Re: [9front] eenter with select/snarf/paste
  2024-07-17 14:22       ` sirjofri
@ 2024-07-17 22:20         ` thedaemon
  0 siblings, 0 replies; 11+ messages in thread
From: thedaemon @ 2024-07-17 22:20 UTC (permalink / raw)
  To: 9front

Quoth sirjofri <sirjofri+ml-9front@sirjofri.de>:
> 17.07.2024 15:30:56 umbraticus@prosimetrum.com:
> > tangential, but perhaps something to consider in
> > any rejigging: I recently noticed that clicking
> > in the prompt part of (e)enter's rectangle is
> > equivalent to hitting enter. I can see some benefit;
> > maybe speeds up accepting default string repeatedly
> > without reaching to the keyboard (eg text search
> > in mothra). Downside: one can accidentally trigger
> > it when trying to position cursor at start of the
> > typing part of the rectangle. Not sure whether this
> > has delighted or disturbed anyone else.
> 
> It's currently disturbing me while testing. My thinkpad buttons aren't 100% precise, so sometimes a single click is recognized as two clicks, in which case the prompt opens and immediately closes.
> 
> sirjofri
I very much dislike not being able to snarf in eenter. 
Sign me up for testing.

thedæmon

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

* Re: [9front] eenter with select/snarf/paste
  2024-07-16 14:31 [9front] eenter with select/snarf/paste sirjofri
  2024-07-16 14:47 ` Jacob Moody
@ 2024-07-18  4:45 ` ori
  2024-07-20 15:02   ` sirjofri
  1 sibling, 1 reply; 11+ messages in thread
From: ori @ 2024-07-18  4:45 UTC (permalink / raw)
  To: 9front

Quoth sirjofri <sirjofri+ml-9front@sirjofri.de>:
> Hi all,
> 
> I'm using eenter in my spreadsheet program for basically every line input. Some user asked for snarf/paste because that's not supported by eenter yet. Changing eenter wouldn't be a small change, so I wanted to ask first if that change would be accepted to 9front? Otherwise I'll just copy the function to the spread package and add the features there.
> 
> Have a good day
> 
> sirjofri

yes please

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

* Re: [9front] eenter with select/snarf/paste
  2024-07-18  4:45 ` ori
@ 2024-07-20 15:02   ` sirjofri
  2024-07-22 16:17     ` sirjofri
  0 siblings, 1 reply; 11+ messages in thread
From: sirjofri @ 2024-07-20 15:02 UTC (permalink / raw)
  To: 9front

Hello all,

I prepared a small testing program to gather user feedback. You can download the binary here: https://sirjofri.de/oat/tmp/6.eenter (amd64, obviously). It uses eenter as I started with it.

I'll try to share the source asap. Code needs cleanup and restructuring as I preferably want to share as much code as usefully possible between enter and eenter.

Regarding the snarf/paste behavior: I tried to match the natural behavior as close as possible, but some things aren't the same. For example, acme seems to have another separate snarf buffer, which I never really use, it seems to be related with undo in a 1-3-5-3 chain (100-110-101-110), where the last interaction doesn't paste, but undoes the whole operation. I don't think it makes sense to go that far for (e)enter.

Feedback and bug reports are welcome.

Edit: Here's the code: https://shithub.us/sirjofri/eesp (eenter snarf paste). Note that I don't like the code as-is, no need for code feedback yet. In case you want to test it, make sure to do a backup first or revert later).

sirjofri

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

* Re: [9front] eenter with select/snarf/paste
  2024-07-20 15:02   ` sirjofri
@ 2024-07-22 16:17     ` sirjofri
  0 siblings, 0 replies; 11+ messages in thread
From: sirjofri @ 2024-07-22 16:17 UTC (permalink / raw)
  To: 9front

20.07.2024 17:03:28 sirjofri <sirjofri+ml-9front@sirjofri.de>:
> Edit: Here's the code: https://shithub.us/sirjofri/eesp (eenter snarf paste).

I updated the code to have one generic function for both enter and eenter. At this point I'm also happy for feedback on the code.

This adds genenter.(c|h) inside libdraw. The helper functions could still be improved.

The package "installs" over your system libdraw implementation. You'll have to backup enter.c, eenter.c and mkfile (or revert) manually.

What do you think?

sirjofri

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

end of thread, other threads:[~2024-07-22 16:19 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-16 14:31 [9front] eenter with select/snarf/paste sirjofri
2024-07-16 14:47 ` Jacob Moody
2024-07-16 16:51   ` sirjofri
2024-07-16 20:38     ` Scott Flowers
2024-07-17 12:57   ` sirjofri
2024-07-17 13:29     ` umbraticus
2024-07-17 14:22       ` sirjofri
2024-07-17 22:20         ` thedaemon
2024-07-18  4:45 ` ori
2024-07-20 15:02   ` sirjofri
2024-07-22 16:17     ` sirjofri

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).