TSE: Shrinking file list also in 'List Open'

14 views
Skip to first unread message

knud van eeden

unread,
Nov 29, 2022, 8:54:35 AM11/29/22
to SemWare TSE Pro Text Editor, S.E. Mitchell
Carlo,

I checked your latest PickList.s program
from 28 November 2022 and executed it.

https://ecarlo.nl/tse/ search for 'Picklist'

It does only in some cases thus show the 'shrinking list' behavior.

For example thus not when doing a  

 menu TSE > 'File' > 'List Open'.

(as far as I can tell thus at this moment, if it can please inform).

Question:

Because your PickList.s program thus 

1. Uses and manipulates a buffer

2. And also that 'List Open' buffer which you see when doing menu TSE > 'File' > 'List Open' is thus a buffer

3. Could therefore your PickList() program not also easily be extended to that ListOpen buffer also, e.g. by getting the bufferId() from ListOpen() and using that (also).

4. It looks like this generalization to other system buffers like the 'List Open' buffer would only be a very small programming step thus. 

E.g. just
finding out which bufferId is used by 'List Open' and
passing or using that as a parameter here.

The question then probably initially boils down thus to 'what is the bufferid (always) used by 'List Open', or how can we find the current value of that bufferId used by 'List Open'?

Thanks
with friendly greetings
Knud van Eeden


Carlo Hogeveen

unread,
Nov 29, 2022, 8:58:50 AM11/29/22
to sem...@googlegroups.com

Knud,

You have me cornered.
Those are fair questions.
I will look into answering them.

Carlo



knud van eeden

unread,
Nov 29, 2022, 10:43:18 AM11/29/22
to sem...@googlegroups.com, S.E. Mitchell
Carlo,

1. Checking the tse.ui it shows that
   TSE menu > 'File' > 'List open' 
    should thus be implemented via the file

       mac\listopen.s

2. It looks like the bufferId used for 'List Open' is 

filelist

3. And it looks like that bufferId for 'List open' is only a temporarily assigned bufferId:
    (see e.g. line 351 in clean TSE 4.48 mac\listopen.s)

  filelist = CreateTempBuffer()

4. Because it is a temporary assigned id (and not some global always used bufferId for example) from that it follows that one should put 'PickList.s' as a subroutine into
listopen.s.

5. So if making 'PickList.s' for example more general by allowing to pass a bufferId parameter
to it, it could then e.g. be inserted into listopen.s and recompiled to get the wanted shrink list  behavior is my current analysis result.

knud van eeden

unread,
Nov 29, 2022, 10:49:36 AM11/29/22
to sem...@googlegroups.com, S.E. Mitchell
As a follow up on this it would be great to have some further generalization which applies the 'shrink list' algorithm to *any* given bufferId.

It could then also be applied to any TSE 'List()' namely, which would be very handy if having very long lists (like I have in my git_tse.s program, typing one or more characters would then potentially shrink it to only a few lines).

Thanks

knud van eeden

unread,
Nov 29, 2022, 11:03:06 AM11/29/22
to sem...@googlegroups.com, S.E. Mitchell
And if possible could you possibly inform what your 
'shrink list' algorithm is?

I assume it will need at least 2 buffers.

Say Buffer1 and Buffer2.

One buffer1 with the original content, then you search and the results are put in the second buffer buffer2, which is then shown. Then possibly switching between the two.

Or something similar...

Carlo Hogeveen

unread,
Nov 29, 2022, 12:20:26 PM11/29/22
to sem...@googlegroups.com

Knud,

First, let me compliment you on your first email, which talked me into this. Well argued.

Non-macro programmers skip to past the "====================" line in this text.

Currently PickList only works for TSE picklists. "Being a picklist" is a TSE display property that a macro like PickList can query, and then it ruthlessly does its thing for all such picklists. That seems to work quite well so far.

ListOpen uses an ordinary list, i.e. not a picklist. Even if I could, I do not want PickList to work on all ordinairy lists, because ordinary lists are sometimes creatively used for another purpose.

Ordinary list's create their buffer ids even more randomly than picklists, so we cannot configure PickList to also work for fixed buffer ids.

To answer one of your questions and one of your proposals:
Since May 2020 eList.s is included in TSE's core distribution, which implements a shrink-as-you-type list command. By defining "#define ELIST_INCLUDED TRUE" or by leaving out its Main proc it can be copied into another macro as a substitute for the lList() command. It was specifically built for that. It therefore requires minimal macro programming to build it into another macro.

====================

What I maybe can do for PickList, is make it configurable for ordinary lists' titles.
If that works, I could pre-configure it for known ordinary lists, like the List Open menu's "Buffer List" title, the "buffer" macro's "Buffer list:" title, and the Potpourri menu's "Potpourri" title.
Anybody please share perceived obstacles, criticisms, ideas and opinions about this, while I can still take them into account.

Carlo



knud van eeden

unread,
Nov 29, 2022, 1:33:39 PM11/29/22
to sem...@googlegroups.com
>> It could then also be applied to any TSE 'List()' namely, which would be very handy if having very long >> lists (like I have in my git_tse.s program, typing one or more characters would then potentially shrink >> it > to only a few lines).

Carlo wrote:
> To answer one of your questions and one of your proposals:
> Since May 2020 eList.s is included in TSE's core distribution, which implements a shrink-as-you-type list command. By defining "#define 
> ELIST_INCLUDED TRUE" or by leaving out its Main proc it can be copied into another macro as a substitute for the lList() command. It was 
> specifically built for that. It therefore requires minimal macro programming to build it into another macro.

Applied this elist.s on my long list (100+ lines) git_tse.s List() lines and it works like a charm.

Many thanks

Carlo Hogeveen

unread,
Nov 30, 2022, 8:55:20 AM11/30/22
to sem...@googlegroups.com

Just going to grumble about "progress".

It turns out, that picklists are nice and standard, which is probably why the PickList extension (so far) works magnificently for all picklists.

Regular lists not so much. Identifying regular lists by their title works great. Shrinking-as-you-type a regular list works great too. But then it turns out, that the commands and macros that create regular lists also create different contexts, most of which hamper PickList. So this will take a while longer, and I might decide on an imperfect version for regular lists. Those will be configurable, so it will be up to the user which regular lists to "improve" with PickList.

For example, currently List Open does not always hilite the typed string, Potpourri remains shrunken, and View Finds finds and hilites the "File:" lines too.

Why did I let myself get talked into this?

Done grumbling,
Carlo

(No, I did not publish this version of PickList.)



knud van eeden

unread,
Dec 17, 2022, 8:00:28 AM12/17/22
to sem...@googlegroups.com
Carlo,

Feature request:

Would it be possible to adapt PickList.s so that it does
not at each restart of TSE shows again the menu for
'Regular lists: Title Search Strings'.

It should possibly only show it once, the user should make the choice, then after that only activating that menu again as an optional option.

Thanks in advance

Carlo Hogeveen

unread,
Dec 17, 2022, 9:38:59 AM12/17/22
to sem...@googlegroups.com

 

Knud,

 

I am mostly guessing here. Really.

 

PickList’s configuration menu is started by executing PickList. This is intentional, and documented.

 

Ordinary users will have added PickList to their Macro AutoLoad List, like the installation instructions describe. At TSE’s start-up the Macro AutoLoad List starts its configured macros with a LoadMacro() command.

 

You start PickList from your own macro with ExecMacro(). Change that to LoadMacro(), and your special problem is solved.

 

With special greetings,

Carlo

 

(P.S.

Don’t like behind you!)

 

 

knud van eeden

unread,
Dec 17, 2022, 9:53:59 AM12/17/22
to sem...@googlegroups.com
> Carlo wrote:
> You start PickList from your own macro with ExecMacro(). Change that to LoadMacro(), and 
> your special problem is solved.

Many thanks for pointing to and giving this more general solution (=LoadMacro()) to such questions like loading TSE any macro but not executing (=ExecMacro()) that TSE macro.

Reply all
Reply to author
Forward
0 new messages