On Fri, 20 Jan 2023 at 18:39, Jon Paris <jon.paris@xxxxxxxxxxxxxx> wrote:
Not that I want to encourage anyone to think of SEU as anything other than the dinosaur it is I have to correct part of your comment.
"SEU is unscriptable. No alternative key bindings, no internal hooks/extension points and a block mode interface."
There are indeed "hooks/extension points" - you can add your own line commands - Jeff Olen published an example some time back (https://www.mcpressonline.com/programming/rpg/techtip-userdefined-seu-line-commands <https://www.mcpressonline.com/programming/rpg/techtip-userdefined-seu-line-commands>). This was a feature that a number of us insisted be made available before IBM stopped further enhancements to SEU. Don't recall the release where it came out but the exit point are there.
I have to admit when I looked up Jeff's example I just about died laughing. The article was published almost 20 years ago - and begins with:
"I know it's not terribly popular these days to be advocating the use of SEU, but regardless of the benefits of using other IDEs ..."
Nothing changes does it <grin>
Jon, I love you (in the good way!)
I wrote an SEU user exit program circa 2000, and I'm extremely
familiar with what SEU... offers by way of scriptability.
I was certain I had posted an example to a Midrange list, and came up
- It's on Github
- the actual code
- SEU User's Guide & Reference V4R2 1998 (most recent edition)
Appendix E is our reference.
I too had a good laugh.
What's missing to call this unscriptable?
1) Block mode. The exit program only gets to see two F keys - F7 and
F8, so no fancy key assignments like Ctrl-Shift-F to pop up a window
of fields from a file on the F-spec
2) Screen manipulation is absent. No pop-up windows that can interact
with SEU and be displayed or manipulated when editing. Sure, your exit
program can pop up a window, but it's only useful while the exit
program is running. When the exit program returns control to SEU, any
exit program window is dead. Imagine a script that you position your
cursor on a DS subfield in a C-spec, you mash F7 to open up a live
window of the DS-specs where the DS is defined so that you can
simultaneously alter the DS definition and the C-spec that uses it.
Can-do in Eclipse. Not possible here
3) Cursor control is absent. While this is a property of the block
mode interface, I feel it deserves separate mention. I often write a
script that modifies code/text in situ, and then moves the editing
cursor to the next logical place, for instance if converting a data
structure from fixed to free. (I'm finding it an interesting mental
exercise to give a name to such a data structure manipulating 'line
command'. I guess that's why 'copy block' has three names - CC CC B)
4) Text-only. I don't mean that SEU is missing graphical capabilities
like drawing an indent tree (it is missing that capability). I mean
that everything in the SEU window is text. No annotations. In other
editors, it's one of the standard hooks to add annotations to the
code. For instance, a warning that the /copy can't be found, or if you
are making a linter or style checker, maybe you want to warn yourself
that your CHAIN hasn't got an (e) on it, but you don't want to
actually insert warnings like that as lines of code - the compiler
will say bad words in Canadian! No tokens; no way to ask SEU to tell
you what the opcode is
5) No graphical capabilities. You can't tie a script or macro to an
icon on a menu bar
6) Mice Do Not Exist. No capturing Shift-RightMouseButton actions
here. It's all command keys, all the time. OK, it's two command keys.
One at a time
7) Text selection does not exist. You're not going to highlight a
block or keyword and have the script affect only the highlighted
portion. For example, no 'convert this bit of code to lower case'. The
script has no idea what is or is not highlighted. Further, the script
can't itself perform character selection. For example it might be
really nice to have the script convert that to lower case, find the
next one, highlight/select it and let the programmer decide if she
wants to convert that one, too. I can imagine using UIM to do all of
that work separately in the exit program, but at that point, I'm
encroaching on rewriting SEU's basic functionality
8) No using SEU's basic functionality. There's no way to create an
in-memory process that _is SEU_; to basically create a sub-editor that
does some complex thing to a block of code and presents it in a
separate SEU editor window for review and additional editing BEFORE
returning that block of code to the main SEU process where it would
replace the highlighted block of co...hm I'm already too far gone,
This is off the top of my head, but I assure you that I have done each
and every one of these things with Code/400. For working with RPG, CL,
and DDS code. I've done a number of them in Brief, Vim, Emacs and
Eclipse as well as other, obscure editors. I apologise for being an
absolutist. I should rather have said that SEU is unscriptable in any
way that I myself might practically use the term. I hope that readers
will see that I most assuredly am not making value judgments here. I'm
not trying to assert that X is better than Y. If someone is making a
living with SEU, good on ya. But I'm pretty sure no one is writing SEU
exit programs, whereas Mihael and Thomas have Eclipse extensions in
the world, and Liam has done early work with extending VS Code. From
the strange padded room in which I find myself, I prefer RDi because
iSphere and (kooky stuff I myself have done) leverages the IBM
portions of RDi. So my extension can bang on a block of code and then
invoke the syntax checker, light off the compiler, interface with the
debugger - all the IBM stuff that's RPG-aware. Liam has to make all of
that from scratch, and I love his energy, but unless he somehow gets
access to the RPG-aware mechanisms that RDi has, I predict that his
work will pivot toward RPG-adjacent stuff for web people. Which
doesn't sound that bad. I hear this internet thing is going to catch
on Real Soon Now, lol
All the best,
ps confidential to V in Toronto: There's an old guy in the States who
admires your work to pieces.
As an Amazon Associate we earn from qualifying purchases.