Grep macro by Chris Antos

28 views
Skip to first unread message

Guy Rouillier

unread,
Mar 6, 2026, 1:24:21 AM (6 days ago) Mar 6
to Semware TSE Pro
In the semware macro files repository here: 

https://semware.com/html/tseprofiles.php

is a grep macro submitted by Chris Antos a long time ago (grep3230.zip). I
like this version of grep, but it hasn't worked in quite awhile - until now!
:) I've created some build files and directions that will allow you to get
this working with recent versions of TSE, both in Windows and Linux. I've
thought of creating a git repository for it, so people who just want to use it
can do so. I'm willing to do that if anyone is interested. Because Linux is
case-sensitive, I had to make some changes not only in the grep3230.zip file,
but also in other zips that it uses: dlg222.zip, dlg222p.zip and gethlp40.zip.
I suppose I could just upload updated versions of those zips, but a repo
sounds like a better idea so we can retain history. Express preferences if
you have any.

Gmail will not allow me to attach a zip, so I put it on my Google Drive as
antos_grep.zip here:

https://drive.google.com/file/d/1SmbPMDjmwS-lKddWBb8xwbozR7gLbg8t/view?usp=sharing

Enjoy.

--
Guy Rouillier

Knud van Eeden

unread,
Mar 9, 2026, 8:06:19 PM (2 days ago) Mar 9
to sem...@googlegroups.com
1. Only installing on Microsoft Windows 11 Professional
2. Downloaded the 3 files from Google Drive link in a subdirectory (GREPANTOS) of my TSE working directory
3. Followed most of the steps as described in the file 'build_grep.txt'
4. Downloaded the following files from the "old" Semware web site in the same GREPANTOS subdirectory
https://semware.com/html/tseprofiles.php
4.1 grep3230.zip
4.2 dlg222.zip
4.3 dlg222p.zip
4.4 gethlp40.zip
5. Did not use build.bat at all
6. Then unzipped in the order 4.1, then 4.2 then 4.3 then 4.4 as shown above
7. When asked to overwrite when unzipping answered always 'A'll so overwriting.
8. Then delete all .mac files in that subdirectory (GREPANTOS)
9. Finally compiling grep.s in that GREPANTOS directory (using TSE 4.50 RC24) and running it
10. As far as I can tell then nothing happens out of the box.
11. One gives e.g. TSE command line parameters to do things:

(extracted from the grep.s file in the GREPANTOS subdirectory):

/*
Options:
-w search files in memory for word under cursor.
-r... reload saved search results, from file {...}.
-f search current file for function name under cursor.
-p... start search from directory {...}.
-e... exclude files matching {...}.
-c search current file only.
//$ todo: -F... file {...} is a list of files to search.
-Bn bufferid {n} is a list of files to search (NOTE: grep
takes ownership of the buffer, modifies it, and frees it).

with friendly greetings
Knud van Eeden



--

---
You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/semware/966ab58ecfae38841876c5528d2db6b8498bd6cc.camel%40gmail.com.

Knud van Eeden

unread,
Mar 9, 2026, 8:32:25 PM (2 days ago) Mar 9
to sem...@googlegroups.com
Update:


1. Only installing on Microsoft Windows 11 Professional
2. Downloaded the 3 files from Google Drive link in a subdirectory (GREPANTOS) of my TSE working directory
3. Followed most of the steps as described in the file 'build_grep.txt'
4. Downloaded the following files from the "old" Semware web site in the same GREPANTOS subdirectory
https://semware.com/html/tseprofiles.php
4.1 grep3230.zip
4.2 dlg222.zip
4.3 dlg222p.zip
4.4 gethlp40.zip
5. Then unzipped in the order 4.1, then 4.2 then 4.3 then 4.4 as shown above
6. When asked to overwrite when unzipping answered always 'A'll so overwriting.
7. Then delete all .mac files in that subdirectory (GREPANTOS)
8. Looked in build.bat
   Finally compiling the files in this same order as shown here:
   (replace sc32 with its full path)

    sc32 dialog.s

    sc32 dialogp.s

    sc32 gethelp.si

    sc32 grep.s

9. Then running the grep.mac macro in that GREPANTOS directory
   (using TSE 4.50 RC24)

10. // the grep dialog

<Alt G> Grep("")
<AltShift G> ShowResults(0)

// grep in current file's directory for word (or block) under cursor
<CtrlAlt G> GrepCurrWord(FALSE)
<CtrlShift '> GrepCurrWord(FALSE)

// grep files in memory for word/block under cursor
<Ctrl '> GrepCurrWord(TRUE)

// find function
<Ctrl G> FunctionList(GetWord(TRUE))

11. As far as I can tell then nothing happens out of the box
    (I pressed e.g. <ALT G>)
12. One gives e.g. TSE command line parameters to do things:


(extracted from the grep.s file in the GREPANTOS subdirectory):

/*
Options:
-w search files in memory for word under cursor.
-r... reload saved search results, from file {...}.
-f search current file for function name under cursor.
-p... start search from directory {...}.
-e... exclude files matching {...}.
-c search current file only.
//$ todo: -F... file {...} is a list of files to search.
-Bn bufferid {n} is a list of files to search (NOTE: grep
takes ownership of the buffer, modifies it, and frees it).
*/

13. -To see an input menu, you will have to add a line setting the VARIATION to 1 in grep.s

// #define VARIATION 2 // VARIATION:  0=Ask, 1=Menu, 2=Dialog
#define VARIATION 1 // VARIATION:  0=Ask, 1=Menu, 2=Dialog

save and recompile.

14. Then you will see an input menu.

image.png

Guy Rouillier

unread,
Mar 10, 2026, 4:58:47 AM (2 days ago) Mar 10
to sem...@googlegroups.com
Here is what the running macro looks like.  In a Windows 11 VM, the dialog is movable; even the Semware provided grep macro can't do that! :)  The macro dialog looks exactly the same in LInux, and works, but is not movable; Sammy already acknowledged that mouse capabilities in Linux are limited.  Since Chris Antos wrote this so long ago, his work precedes the Semware grep.exe binary, so he implemented all the grep logic in SAL code!  I compared the output with the output for the Semware grep.s (which uses the Semware-supplied grep binary), and the result lists are the same.

If someone can reply to my question about preferences for TSE macro repository, I'll put all my files in a repo, which should make it easier for others to build  Next thing I want to do is to replace Chris's grep implementation in SAL code with the invocations of the Semware grep binary now supplied for both Wndows and Linux.  I'll  reuse the actual code from the Semware grep.s to invoke the external grep binary.

-- 
Guy Rouillier

knud van eeden

unread,
Mar 10, 2026, 11:14:31 AM (2 days ago) Mar 10
to sem...@googlegroups.com
Update:

When putting all the files in your own directory

 e.g.

 c:\temp\grepantos\

you must explicitly change in Main() in grep.s to this directory.

E.g. add a line in the beginning of Main() in grep.s, save and recompile.

ChrDir( "c:\temp\grepantos\" )

Inline image

Inline image



Knud van Eeden

unread,
Mar 11, 2026, 2:50:55 PM (17 hours ago) Mar 11
to sem...@googlegroups.com
Trying also to get it to work also in TSE for Linux WSL Ubuntu
(compiling grep.s gives errors for example).

Are you sure that should work out of the box (using your above steps) also on Linux thus?
(as it was clearly primarily and only written for Microsoft Windows usage thus).

with friendly greetings
Knud van Eeden

On Fri, Mar 6, 2026 at 7:24 AM Guy Rouillier <guy.ro...@gmail.com> wrote:

Guy Rouillier

unread,
Mar 11, 2026, 10:06:14 PM (9 hours ago) Mar 11
to sem...@googlegroups.com
Yes, see the last message I sent yesterday, March 10, 2026, with this subject line.  The included screenshot is on Ubuntu Linux.  Sorry, I do not have WSL Ubuntu available.  I'm already working on 3 different platforms: Windows VM, Ubuntu Linux and Rocky Linux VM.
-- 
Guy Rouillier
Reply all
Reply to author
Forward
0 new messages