Discussion:
How to edit HTML source file on Windows in one step (not two)?
(too old to reply)
Marion
2025-01-15 09:20:46 UTC
Permalink
If it takes 2 steps to do something; that's twice as much as it should;
Hence, I'm trying to reduce the following interaction to a single step.

STEP 1: Win+R > gvine
STEP 2: Click on the backgrounded icon on the taskbar

What I need to know, in order to reduce those two steps to one is...
Why does Windows edit this file in the background (not foreground)?

Note: It comes up in one step if I used the default editor, but I don't
want to use Firefox as the default editor (unless Firefox has an editor?).

Here's the situation... (which I would think others would also have)...

This works fine to *view* that HTML file in Firefox in one step.
1. I created this HTML file for my one-click URLs
C:\sys\myurls.html
2. I can easily open that file in Firefox on Windows
firefox file:///C:/sys/myurls.html
(which I can subsequently bookmark within Firefox)
3. That opens up the file inside of the Firefox browser with one click
(note that the default program for HTML files is Firefox)

But what about *editing* that HTML file to add more stuff to it?
Here's what I created, which works, but it's two clicks, not one click.

A. I created this registry key to point to a shortcut
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\
gurl.exe = C:\sys\gurl.lnk
Where the TARGET for gurl.lnk does the actual editing:
TARGET=%comspec% /c gvim C:\sys\myurls.html
B. I can execute that command using the Windows Runbox shortcut
Win+R > gurl
C. That opens the desired HTML file in the gvim text editor
(note that gvim is not the default program for HTML files)

All this works just fine - EXCEPT - for one specific flaw.

FLAW:
The editing session is always "backgrounded" - by which I mean
that the gvim editing window does not come to the fore. That
gvim window is always backgrounded (Why? I don't know why.)

To bring the gvim window to the foreground, I have to tap
the icon that shows up on the Windows taskbar - but that's
an extra unnecessary step (which is why I'm asking for help).

Two specific questions:
a. Why doesn't the gvim editing window come up in the foreground?
b. What do I change to make that editing 1 step instead of 2 steps?
--
Note that I never type "Win+R" since I have a runbox pinned to the taskbar.
Marion
2025-01-15 11:28:43 UTC
Permalink
Post by Marion
b. What do I change to make that editing 1 step instead of 2 steps?
about:config
view_source.editor.external true
view_source.editor.path C:\Windows\System32\notepad.exe
In Firefox press <CTRL>-U to start the editor with the html source
Woo hoo! I think you (perhaps accidentally) answered BOTH questions!
It was the default gvim batch file which was BACKGROUNDING things!
Thanks!

Here's how I figured that out, based on what you suggested I do.
1. Check the configuration in Firefox
about:config
view_source.editor.external = false
view_source.editor.path = <blank>

2. Now change that to edit using Notepad (for test purposes).
C:\> where notepad
C:\Windows\System32\notepad.exe
about:config
view_source.editor.external = true
view_source.editor.path = C:\Windows\System32\notepad.exe
firefox firefox file:///C:/sys/myurls.html
Control+U
That works.

3. That works for notepad, but it does NOT work for gvim.
C:\> where gvim
C:\Windows\gvim.bat
about:config
view_source.editor.external = true
view_source.editor.path = C:\Windows\gvim.bat
firefox firefox file:///C:/sys/myurls.html
Control+U
That fails.

4. But if I use the full path to the gvim executable, it works:
C:\> where gvim.exe
INFO: Could not find files for the given pattern(s).
Hmm. That's how gvim installs. But I know the real path is
C:\bat\gvim\gvim.exe
about:config
view_source.editor.external = true
view_source.editor.path = C:\bat\gvim\gvim.exe
firefox firefox file:///C:/sys/myurls.html
Control+U
That works.

5. Notice once I realized (accidentally) that the path to gvim
was (by default) being found by the fact a batch file was
placed (by the gvim installer) in C:\Windows\gvim.bat, I then
surmized (correctly, it turns out) that the backgrounding was
being done by that gvim.bat file (and not by gvim.exe).

So, I solved that problem by amending the original steps to...

1. I created this HTML file for my one-click URLs
C:\sys\myurls.html
2. I can easily open that HTML file as HTML in Firefox on Windows
firefox file:///C:/sys/myurls.html
(which I can subsequently bookmark within Firefox)
3. That opens up the file inside of the Firefox browser with one click
(note that the default program for HTML files is Firefox)
4. I can also easily EDIT that HTML file in a single step inside Firefox
about:config
view_source.editor.external = true
view_source.editor.path = C:\bat\gvim\gvim.exe
firefox firefox file:///C:/sys/myurls.html
Control+U
That edits the HTML file in a single step! Woo hoo!

To edit that HTML file OUTSIDE of firefox is also a single step!

A. I created this registry key to point to a shortcut
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\
gurl.exe = C:\sys\gurl.lnk
Where the TARGET for gurl.lnk does the actual editing:
TARGET=%comspec% /c C:\bat\gvim\gvim.exe C:\sys\myurls.html
B. I can execute that command using the Windows Runbox shortcut
Win+R > gurl (I never actually type this - as I use a runbox shortcut)
C. That opens the desired HTML file in the gvim text editor
(note that gvim is not the default program for HTML files)

All this works just fine in a single step now!
a. To edit the url file in Firefox, use "Control+U"
b. To edit the url file outside Firefox, use "Win+R > gurl"

The two specific questions have now been answered thanks to Herbert!
Q: Why doesn't the gvim editing window come up in the foreground?
A: Because the default gvim.bat file is causing it to be backgrounded!

Q: What do I change to make that editing 1 step instead of 2 steps?
A: Target the full path to the gvim.exe executable (not to the bat)!

Thanks Herbert.

This information should be generally useful to everyone because it allows
them to maintain a list of URLs that they can easily edit at any time.
R.Wieser
2025-01-15 12:35:28 UTC
Permalink
Marion,
Post by Marion
3. That works for notepad, but it does NOT work for gvim.
C:\> where gvim
C:\Windows\gvim.bat
...
Post by Marion
That fails.
You mean, that does not work for your batch file.

But how do you *know* it doesn't work for your batchfile ? Maybe the
batchfile runs but it just can't run gvim.exe itself for some reason.

IOW, what did you do to check/test what part works and what part doesn't ?

Regards,
Rudy Wieser
Marion
2025-01-15 18:10:23 UTC
Permalink
Post by R.Wieser
You mean, that does not work for your batch file.
But how do you *know* it doesn't work for your batchfile ? Maybe the
batchfile runs but it just can't run gvim.exe itself for some reason.
IOW, what did you do to check/test what part works and what part doesn't ?
Agreed that you're correct it might work for other batch files.
Just not gvim.bat - and even then - it still could be a local problem.

Thanks for that sound advice.
Here's the gvim.bat file installed during the initial setup process.

@echo off
rem -- Run Vim --
rem # uninstall key: vim82 #

setlocal
set VIM_EXE_DIR=C:\bin\vim\vim82
if exist "%VIM%\vim82\gvim.exe" set VIM_EXE_DIR=%VIM%\vim82
if exist "%VIMRUNTIME%\gvim.exe" set VIM_EXE_DIR=%VIMRUNTIME%

if not exist "%VIM_EXE_DIR%\gvim.exe" (
echo "%VIM_EXE_DIR%\gvim.exe" not found
goto :eof
)

rem check --nofork argument
set VIMNOFORK=
:loopstart
if .%1==. goto loopend
if .%1==.--nofork (
set VIMNOFORK=1
) else if .%1==.-f (
set VIMNOFORK=1
)
shift
goto loopstart
:loopend

if .%VIMNOFORK%==.1 (
start "dummy" /b /wait "%VIM_EXE_DIR%\gvim.exe" %*
) else (
start "dummy" /b "%VIM_EXE_DIR%\gvim.exe" %*
)
--
R.Wieser
2025-01-15 21:15:50 UTC
Permalink
Marion,
Post by Marion
Agreed that you're correct it might work for other batch files.
No. The problem is the batch filetype. Its not an executable.

Also, firefox is not an OS, and it looks like it handles starting programs a
bit different than you are accustomed to.

Herbert gave you two about:config entry names. Remove the last part to see
the other settings in that group. It might give you an idea (it did for
me).
Post by Marion
Thanks for that sound advice.
You're welcome.
Post by Marion
Here's the gvim.bat file installed during the initial setup process.
Thats *way* to complex for testing. I would start with a new batchfile and
put something in it you know will always work. Perhaps just "echo I'm
here", or better yet :"pause". Maybe even both, in that order.

And, if you have not already done so, do test if if the batchfile works when
started from th commandline.

Regards,
Rudy Wieser
R.Wieser
2025-01-16 13:29:15 UTC
Permalink
Arlen,
And, if you have not already done so, do test if the batchfile works when
started from the commandline.
I should have made clearer that I ment *your* batchfile, not the almost
empty one I suggested for you to test with - though its a good idea to test
it too, to make sure it works before depending on it to checking something
else.


By the way, did you know that that gvim.bat contains a security issue of
sorts ?

Just see what you get when you put this in a batchfile :

echo %NotExisting%\gvim.exe

Yep, it would point to the root of the current drive, and I don't think
thats intentional ...

Regards,
Rudy Wieser
Carlos E.R.
2025-01-15 12:36:06 UTC
Permalink
Post by Marion
This information should be generally useful to everyone because it allows
them to maintain a list of URLs that they can easily edit at any time.
Seamonkey has an html editor.
--
Cheers, Carlos.
Marion
2025-01-15 18:10:03 UTC
Permalink
Post by Carlos E.R.
Post by Marion
This information should be generally useful to everyone because it allows
them to maintain a list of URLs that they can easily edit at any time.
Seamonkey has an html editor.
Good point.

Given there are essentially only 2 web browser code bases for Windows,
every Win10 browser will likely be sharing either Mozilla or Chromium code.

From Carlos' statement, we can presume Mozilla browsers use the Control+U.
Does the Chromium code base have a similar "Control+U" single edit step?

I just tested it and it comes up similarly to Firefox, but read only.
<view-source:chrome://settings/privacy>

Apparently the way Chromium does in-place modern editing is this:
1. Open Developer Tools:
2. Press Ctrl+Shift+I (or F12) on your keyboard.
3. Navigate to the "Elements" panel:
4. Right-click on the element you want to edit in the "Elements" panel.
5. Select "Edit as HTML" from the context menu.

That looks like more than a single step to me though.
And, of course, that HTML editor doesn't seem to use regular expressions.

Bear in mind, just being able to use the mouse and keyboard to edit complex
html code is not really editing. It's more like plucking letters on & off.

For modern editing, you need some sort of HTML editor that works with
regular expressions - but I don't know of any user-friendly HTML editor.

Do you?
Does anyone?

Q: What's a free HTML editor that can be used with regular expressions?
A: ?
Carlos E.R.
2025-01-16 22:08:28 UTC
Permalink
Post by Marion
Post by Carlos E.R.
Post by Marion
This information should be generally useful to everyone because it allows
them to maintain a list of URLs that they can easily edit at any time.
Seamonkey has an html editor.
Good point.
Given there are essentially only 2 web browser code bases for Windows,
every Win10 browser will likely be sharing either Mozilla or Chromium code.
From Carlos' statement, we can presume Mozilla browsers use the Control+U.
Does the Chromium code base have a similar "Control+U" single edit step?
I just tested it and it comes up similarly to Firefox, but read only.
<view-source:chrome://settings/privacy>
2. Press Ctrl+Shift+I (or F12) on your keyboard. 3. Navigate to the
4. Right-click on the element you want to edit in the "Elements" panel.
5. Select "Edit as HTML" from the context menu.
That looks like more than a single step to me though.
And, of course, that HTML editor doesn't seem to use regular expressions.
Bear in mind, just being able to use the mouse and keyboard to edit complex
html code is not really editing. It's more like plucking letters on & off.
For modern editing, you need some sort of HTML editor that works with
regular expressions - but I don't know of any user-friendly HTML editor.
Just give a try to Seamonkey. It is not Firefox, it is a fork. It
contains the old Composer that came with the ancient Netscape.

After you try it, decide if you like it or not.
--
Cheers, Carlos.
Marion
2025-01-17 04:28:56 UTC
Permalink
Post by Carlos E.R.
Post by Marion
For modern editing, you need some sort of HTML editor that works with
regular expressions - but I don't know of any user-friendly HTML editor.
Just give a try to Seamonkey. It is not Firefox, it is a fork. It
contains the old Composer that came with the ancient Netscape.
After you try it, decide if you like it or not.
Thanks for that advice to try SeaMonkey's HTML editor, which I have done.
However, I'm currently using Firefox for one thing only & that's for Vine.

SeaMonkey is already being used for something else on my system.

Since my philosophy is each web browser does one thing and only one thing,
you can rest assured I've tried almost every web browser there ever was.

Look here:
<Loading Image...> Windows browsers

The beauty of using any given web browser for only one thing is that one
thing is set up perfectly within that browser, for privacy & security.
Marion
2025-01-17 18:37:06 UTC
Permalink
Post by Marion
The beauty of using any given web browser for only one thing is that one
thing is set up perfectly within that browser, for privacy & security.
That's like using a different video player for each type of videos.
Hi Herbert,

I respect your acumen. I respect your philosophy. I listen to you.
I agree with you always. That doesn't mean I use the %PATH% just because
you do things that way - but I UNDERSTAND *why* you use the %PATH% to run
all your batch files - just as you UNDERSTAND *why* I use the AppPaths key.

We can each fully UNDERSTAND each other, even as we philosophically sway in
different ways. Here you suggest, apparently, different bookmarks files,
one per browser, which is how most people do things so I UNDERSTAND that.

But I suggest a single bookmarks file for all web browsers, which is simply
a different philosophy - which I'm sure you UNDERSTAND the logic of, right?
And you have to install the updates for all your browsers.
Back to the problem at hand, you are the only one who suggested a solution
to the problem because you are the only one who UNDERSTOOD the problem set.

I love that your suggestions are applicable to billions of people.
And not just to me.

That's the best kind of solution - which EVERYONE can easily benefit from!

Your suggestion was a huge step in resolution, which everyone can use of:
a. firefox about:config
b. view_source.editor.external (change from the default of false to true)
c. view_source.editor.path C:\path\to\your\favorite\editor.exe
d. firefox file:///C:/sys/bookmarks.html
e. Control+u

I *love* that everyone can use your suggested solution to their advantage!

With the bookmarks.html file bookmarked in Firefox, users can, in a single
step of "control+u", edit their bookmark file without needing to use either
the %PATH% or the AppPaths registry key. That's fantastic! Thank you.
You can create as many profiles you like in Firefox.
Again, you UNDERSTOOD the reason for using many browsers is they're each
set up perfectly for one task (or web site) and one task (or site) only!
<https://i.postimg.cc/fT2J40RD/windows-cascade-menu.jpg>

There is no cross-pollination of cookies, for example, which is a huge boon
to privacy. The disadvantage, of course, is they each can use different
bookmarks syntax, which I get around by having a single bookmarks.html
file.

Partly seriously & yet mostly in jest, might I philosophically muse by
contorting your words (to make the same point you were trying to make) of
"That's like using a different _bookmark file_ for each web browser."
"And you have to _manage separate bookmarks_ for all your browsers.

My point of the jest above is that I could just as well philosophically
muse that having more than one bookmarks file (one for each browser) is
like having more than one video player (one for each type of video).

We both understand the philosophy of using one browser (in this case,
Firefox) in ways that it can "play different types of tasks".

Doing a variety of tasks, after all, is why EVERYONE on the planet has a
web browser on every platform - which is a feat few apps can achieve.

However... as I'm sure you quite well UNDERSTAND, having any one browser do
multiple things, opens the user up to privacy-loss cross pollination.

The reason I use multiple browsers is to hinder that privacy-loss cross
pollination, but reading ahead, I see you UNDERSTOOD that problem set too!
firefox.exe -profile "profile_path"
This is a *great* idea, since it (in theory) has 2 (3?) huge advantages!
1. It "should" prevent that privacy-loss cross pollination, right?
2. It also means I only need to learn one web browser's peculiarities.
3. In addition, I might even get away with ONE master bookmarks.html!
You can also have more than one installations of Firefox on a computer.
https://support.mozilla.org/en-US/kb/profile-manager-create-remove-switch-firefox-profiles
https://wiki.mozilla.org/Firefox/CommandLineOptions
Thank you for UNDERSTANDING the problem set, which addresses (I think) the
three main issues everyone should have with the use of browsers on Windows.

1. It addresses the privacy-loss cross-pollination problem (I think).
2. It means we only have to learn peculiarities of just firefox alone.
3. It can be set up for a single master machine-specific bookmarks file!

Given your suggestion of multiple instances of Firefox (whether via
profiles or by executables) has multiple advantages, it's worth exploring.

Thank you for not only understanding the problem set, but also for
proposing a solution which may be simpler than the one I am currently using
of multiple browsers to prevent cross pollination of privacy losses.
Carlos E.R.
2025-01-18 13:33:30 UTC
Permalink
Post by Marion
Post by Carlos E.R.
Post by Marion
For modern editing, you need some sort of HTML editor that works with
regular expressions - but I don't know of any user-friendly HTML editor.
Just give a try to Seamonkey. It is not Firefox, it is a fork. It
contains the old Composer that came with the ancient Netscape.
After you try it, decide if you like it or not.
Thanks for that advice to try SeaMonkey's HTML editor, which I have done.
However, I'm currently using Firefox for one thing only & that's for Vine.
SeaMonkey is already being used for something else on my system.
Hum. Weird system, but to each his own. But you can have several
isolated Firefox instances by using profiles. I have not tried, but I
guess that Seamonkey also has profiles [...] Yes, it does.
Post by Marion
Since my philosophy is each web browser does one thing and only one thing,
you can rest assured I've tried almost every web browser there ever was.
<https://i.postimg.cc/fT2J40RD/windows-cascade-menu.jpg> Windows browsers
The beauty of using any given web browser for only one thing is that one
thing is set up perfectly within that browser, for privacy & security.
--
Cheers, Carlos.
Newyana2
2025-01-15 14:04:34 UTC
Permalink
Post by Marion
If it takes 2 steps to do something; that's twice as much as it should;
You must be a barrel of fun as a lover and a chef. :)
Post by Marion
Hence, I'm trying to reduce the following interaction to a single step.
STEP 1: Win+R > gvine
STEP 2: Click on the backgrounded icon on the taskbar
What I need to know, in order to reduce those two steps to one is... Why
does Windows edit this file in the background (not foreground)?
Note: It comes up in one step if I used the default editor, but I don't
want to use Firefox as the default editor (unless Firefox has an editor?).
Here's the situation... (which I would think others would also have)...
My approach -- just one option -- is that I have a half dozen
context menu items for all files (HKCR\*) that are like Open with
Notepad, Open with Paint Shop Pro, Open with HxD, etc. So I can
open any file in the program I want with just a right click/click.

In the rare occasions when I need the Run window, it's one
of 4 items on my Start Menu, so there's no need for hotkeys.

If you're going to edit HTML very often it makes sense to find
an HTML-specific editor with syntax highlighting at the very
least. The trouble with generic editors like vim, emacs, notepad++,
etc, is that they're really just text editors that support rudimentary
colorcoding for 50 languages. Like a 50-bit screwdriver, they don't
work very well for any particular screw.

I just tried Vim for the
first time. It looks like a relic from 1980, without even support for
non-fixed-width fonts. Really? That's your favorite editor? Few people
actually hand-code HTML anymore, but there must still be decent
editors around.

I took a look out of curiosity. At DDG, the whole first
page of results was links to online editors! It seems CoffeeCup Free is
still out there. I never tried it, but it was popular at one time.

The trouble with this kind of thing is that the reviewers don't know the
products. One site rated Notepad++ #1, with no HTML-specific functionality,
yet with some other editors they complained that there wasn't built-in
FTP. Another best-of site lists Vim and Atom along with Dreamweaver.
They rated Sublime Text #1 for customizability, even though it, too,
is only a general editor. Putting Dreamweaver on the same list with the
others is like listing MSPaint with Photoshop. Only someone who's never
edited photos would do that.
Janis Papanagnou
2025-01-15 17:03:59 UTC
Permalink
[ stripped address list from irrelevant X-posts for this part ]
Post by Newyana2
[...]
If you're going to edit HTML very often it makes sense to find
an HTML-specific editor with syntax highlighting at the very
least. The trouble with generic editors like vim, emacs, notepad++,
etc, is that they're really just text editors that support rudimentary
colorcoding for 50 languages.
Where did you get that number from?

Even my old Vim installation supports syntax files for already
~550 languages.

But Vim has them not hard-coded or tightly coupled; it provides
a syntax-language to map arbitrary syntax descriptions onto the
actual language-specific visible highlighting. Most flexible and
maintaining a terse interface; as opposed to hard-coded features
in specialized tools you don't buy the complexity from languages
you don't use.
Post by Newyana2
Like a 50-bit screwdriver, they don't
work very well for any particular screw.
What is that supposed to mean?

If you introduce a new language or want support for something yet
non-existing you can just provide a new syntax description file
for that language. So the syntax coloring is as good as the syntax
description for any language had been designed. Moreover you can
expect mature syntax descriptions bundled with the Vim package for
any common any many even uncommon languages.
Post by Newyana2
I just tried Vim for the first time.
I see.

Yet you obviously don't know it but nonetheless spread FUD. You
better inform yourself beforehand before getting in rage.
Post by Newyana2
It looks like a relic from 1980,
Vim *is* based on an editor from around 1980 (the Vi: ~1976).

But it is not a "relic". The excellent concepts of Vi are the
base for Vim. And Vim is (as Emacs) still widely used by folks
that do text editing professionally (specifically in the IT).
Post by Newyana2
without even support for non-fixed-width fonts. Really?
You are confusing a text editor with a word processor.

If use of proportional fonts is all what comes to your mind when
editing a text then you've obviously never experienced powerful
editing with any of the flag-ships of text editors (Vim, Emacs,
for example).
Post by Newyana2
That's your favorite editor? Few people
actually hand-code HTML anymore, but there must still be decent
editors around.
Here I agree with you. - There's often specialized tools for
specific sources or tasks that may have one or another specific
advantage for that specific type of source.

The point with text editors is that they are basically (widely)
agnostic about the text; they focus on the *powerful* _editing_
capabilities, and the same powerful editor tool (whatever editor
you prefer) can be used used for all sorts of texts; you don't
need to learn a dozen or more peculiar tools but can work with
your editor of choice. In other words, you can most efficiently
operate even on any (standard or special) format, and the better
editors also provide means to support higher-level specialized
operations (but that just aside).

Since you don't really know, and less understand, the concepts
of the editors you should be careful with your comments on that.

Specifically I would not suggest to you trying the Vim editor;
it's learning curve is too steep for someone who is fast with
spreading opinions without having any knowledge about it. Vim
is certainly no quick-to-get-into software.

Janis
Marion
2025-01-15 18:09:32 UTC
Permalink
Post by Newyana2
Post by Marion
If it takes 2 steps to do something; that's twice as much as it should;
You must be a barrel of fun as a lover and a chef. :)
It's true. I'm boring. But at least I'm boringly efficient on a PC. :)

The whole point of computers is everything should be a single step.
Our job is to know Windows & editing files well enough for us to do that.

With gvim, the use of regular expressions becomes finger memory over time.
Plus it works on all platforms, especially those Linux or Windows based.

With regular expressions, your hands do all the editing. Not the mouse.
Post by Newyana2
Post by Marion
Hence, I'm trying to reduce the following interaction to a single step.
STEP 1: Win+R > gurl
STEP 2: Click on the backgrounded icon on the taskbar
My approach -- just one option -- is that I have a half dozen
context menu items for all files (HKCR\*) that are like Open with
Notepad, Open with Paint Shop Pro, Open with HxD, etc. So I can
open any file in the program I want with just a right click/click.
Good idea. I have something similar for editing images using an editor that
isn't the default editor. For example, Irfanview is the default viewer, but
sometimes I want to edit images in a different editor so I've added similar
context menu additions for JPEG/GIF/BMP/etc style files.

I only generally define context menus once or twice in the long life of a
PC (unless I install & delete paintshoppro which screws up the menus).

I think I last used either "Default Programs Editor" or "ecmenu" or
NirSoft's context-menu editing tools (of which there are too many to
remember off hand so I just list the URLs for each in my sys log).

<http://defaultprogramseditor.com>
<https://www.techspot.com/guides/1670-windows-right-click-menu/>
<https://shellfix.nirsoft.net/context_menu_list.html>
Post by Newyana2
In the rare occasions when I need the Run window, it's one
of 4 items on my Start Menu, so there's no need for hotkeys.
It's a good idea no matter how you reduce all tasks to a single step.

Everyone reduces common actions to a single click in different ways.
Some (like Herbert) add batch files to a batch folder in the path.
Others (like me) add runbox commands to the system registry.

Both approaches to editing in a single step are supported by Microsoft.

My philosophy is that if a person even once in the entire lifetime of a
Windows PC has to laboriously LOOK or SEARCH for a file or editor...
... then they failed to understand what the purpose of a computers is. :)
Post by Newyana2
If you're going to edit HTML very often it makes sense to find
an HTML-specific editor with syntax highlighting at the very
least. The trouble with generic editors like vim, emacs, notepad++,
etc, is that they're really just text editors that support rudimentary
colorcoding for 50 languages. Like a 50-bit screwdriver, they don't
work very well for any particular screw.
I do very much agree with you that an HTML editor with regular expressions
would be lovely to find but I've never seen such an efficient HTML editor.

Have you?
Post by Newyana2
I just tried Vim for the
first time. It looks like a relic from 1980, without even support for
non-fixed-width fonts. Really?
You want the 'g' in front of Vim for the graphical bells & whistles.

I have bad eyes, so my Windows gvim editing windows have huge fonts.
I forgot how I set that up but you can change the font & size.

I think maybe I used "Edit > Select Font" in the gvim editing window.
Post by Newyana2
That's your favorite editor?
In the olden days, every computer was guaranteed to have ex on it, so you
first learned ex and then you hoped that the customer also had vi set up.

You couldn't bank on any other editor being there when you did support.
And, in those days, there was no such thing as a "floppy disk" or "USB".

You were on your own.
Once you learned how to use vi, it hasn't changed in 45 years.

One editor does everything on every platform using the same expressions.
That's pretty efficient, isn't it?
Post by Newyana2
Few people
actually hand-code HTML anymore, but there must still be decent
editors around.
Philosophically, there should be only one bookmark file per person.
It's a text file. With an HTML (or HTM) extension.

It contains only three things essentially:
1. The <A HREF=xxx>foo</A> link itself
2. White-space padding (such as <P> & <HR>)
3. Descriptive text (which is displayed verbatim)

That's it.
It's not fancy HTML.

A powerful text editor with regular expressions handles that easily.
Post by Newyana2
I took a look out of curiosity. At DDG, the whole first
page of results was links to online editors! It seems CoffeeCup Free is
still out there. I never tried it, but it was popular at one time.
I pine for a decent (and powerful) HTML editor that works on all platforms.
Philosophically, I'm only one person, so I only need one bookmark file.

Not one per browser.
Not one per computer.

One bookmark file per person.

The problem is a mix of platforms, bookmarks and multiple browsers.
Each web browser should use the same bookmark file.
Not a copy. The same file.

But they don't.

There should be only a single text bookmark file on Linux.
There should be only a single text bookmark file on Windows.
There should be only a single text bookmark file on Android.
etc.

It's the same bookmark file - just synced from the master file.
Post by Newyana2
The trouble with this kind of thing is that the reviewers don't know the
products. One site rated Notepad++ #1, with no HTML-specific functionality,
yet with some other editors they complained that there wasn't built-in
FTP.
I agree with you which is why 'comp.editors' was included on this thread.
Even gvim can run HTML conversion - but most people don't know about it.

Even I don't use it, but I know it's there. Let me look for it.
OK. Found it.

Let's try it on this recipe (since you disparage my cooking anyway!) :)
Recipe for Italian Vinaigrette
1/2 cup red wine vinegar
1/4 cup balsamic vinegar
1/4 cup lemon juice
4 cloves garlic, minced
2 teaspoons Dijon mustard
1 teaspoon dried oregano
1 teaspoon dried basil
1/2 teaspoon dried thyme
1/4 teaspoon salt
1/8 teaspoon black pepper

1. Paste that recipe.txt text file into gvim (white space included)
2. gvim:Syntax > Convert to HTML
3. Save it as recipe.html (or as recipe.htm)
4. Firefox:File > Open File > recipe.html
It displays perfectly (with the desired white space in its proper place.

Now edit it in Firefox:
5. Firefox:Control+U

I just tried it on that recipe text file and it worked for me.
But I like regular expressions since my hands do all the work.

Not the mouse.
Post by Newyana2
Another best-of site lists Vim and Atom along with Dreamweaver.
They rated Sublime Text #1 for customizability, even though it, too,
is only a general editor. Putting Dreamweaver on the same list with the
others is like listing MSPaint with Photoshop. Only someone who's never
edited photos would do that.
If someone can suggest a good free HTML editor that works on all major
platforms which incorporates regular expressions - I'd love to test it.

Even without the power of regular expressions, if it can do single-click
macros (like Notepad can do with its shortcuts.xml file), that'd be OK.
Newyana2
2025-01-15 18:49:44 UTC
Permalink
Post by Marion
I do very much agree with you that an HTML editor with regular expressions
would be lovely to find but I've never seen such an efficient HTML editor.
Have you?
I've never used regexp for anything. I don't know why I might
use them editing HTML. For HTML, or anything, I want an editor
designed for that specifically.
Post by Marion
Post by Newyana2
I just tried Vim for the
first time. It looks like a relic from 1980, without even support for
non-fixed-width fonts. Really?
You want the 'g' in front of Vim for the graphical bells & whistles.
Yes. I got gvim.
Post by Marion
If someone can suggest a good free HTML editor that works on all major
platforms which incorporates regular expressions - I'd love to test it.
It sounds like you're not really editing HTML in the sense of web design,
but rather editing your browser bookmarks file? If that's the case then I
can see why you want only a plain editor.
Marion
2025-01-15 20:03:02 UTC
Permalink
Post by Newyana2
Post by Marion
I do very much agree with you that an HTML editor with regular expressions
would be lovely to find but I've never seen such an efficient HTML editor.
Have you?
I've never used regexp for anything.
Regular expressions are difficult to learn, but there are only about a dozen
that you use all day, every day - so your fingers know them by rote.

You can do the same stuff with Notepad++ shortcuts.xml file of macros.
For example, here's a snippet of my single-click text-conversion macros.

For those on comp.editors, a huge advantage of Notepad++ shortcuts.xml
macro conversion is that it can convert non-printable characters also!

<!-- comment text -->
<Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
<Action type="3" message="1601" wParam="0" lParam="0" sParam="&amp;#151;" />
<Action type="3" message="1625" wParam="0" lParam="0" sParam="" />
<Action type="3" message="1602" wParam="0" lParam="0" sParam="&amp;" />
<Action type="3" message="1702" wParam="0" lParam="768" sParam="" />
<Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
<!-- comment text -->

I have about a dozen of those Notepad++ macros which convert non-printable
(or inconsistent) characters to printable (or to consistent) characters
after I've cut and pasted from an HTML page.

You can do it with gvim but all the escaping and usage of hex is
easier with Notepad's macros than it is with gvim's macros.

You use the best tool for the job that does the work in a single click.

Philosophically, if it takes us more than one click to do anything
repetitive, then that means we don't know Windows well enough yet. :)

Or... we don't know anyone who does know Windows since a lot of this comes
from this ng which contains experts in virtually all things Windows.
Post by Newyana2
I don't know why I might
use them editing HTML.
Well, how do you convert this template set into something useful?
<A HREF=https://www.amazon.com/s?k=foo+bar>amazon foo bar</A><P>
<A HREF=https://www.amazon.com/vine/vine-items?search=foo%20bar>vine foo bar</A>

If I want to convert that template to, oh, say, "laptop computer", I run:
ma ===> mark a
mb ===> mark b
<esc>:'a,'bs/foo/laptop/g ===> from a to b globally replace foo with laptop
<esc>:'a,'bs/bar/pc/g ===> from a to b globally replace bar with pc

Which, for the text lines between mark a and mark b, it converts that to
<A HREF=https://www.amazon.com/s?k=laptop+pc>amazon laptop pc</A><P>
<A HREF=https://www.amazon.com/vine/vine-items?search=laptop%20pc>vine laptop pc</A>

Ideally, we'd want a batch script which simply adds links to the one text
bookmarks.html file that each person would maintain for all browsers.

C:\> addlink.bat
Q: What link do you want to add?
A: ?
And that would add a line (or two) for every link that you specified.
Post by Newyana2
For HTML, or anything, I want an editor
designed for that specifically.
Post by Marion
Post by Newyana2
I just tried Vim for the
first time. It looks like a relic from 1980, without even support for
non-fixed-width fonts. Really?
You want the 'g' in front of Vim for the graphical bells & whistles.
Yes. I got gvim.
Good. Try what I had suggested. My fonts are always huge in gvim because my
eyes aren't what they used to be when I was a younger person at 75 or so.

You can change it on the fly, but I set it once (years ago) and my fonts in
gvim have been huge ever since. I just looked & they're 'Lucinda 22 bold'.
Post by Newyana2
Post by Marion
If someone can suggest a good free HTML editor that works on all major
platforms which incorporates regular expressions - I'd love to test it.
It sounds like you're not really editing HTML in the sense of web design,
but rather editing your browser bookmarks file?
What I'd REALLY WANT is the ability to add items to the bookmarks file.

a. I'd run a script, oh, say called "addbm.bat"
b. It would ask me "what link do you want to add to your bookmark file?"
c. Then it would add the necessary HTML to the bookmark.htm text file.

That addbm.bat script would be something EVERYONE would want!

A. Before running addbm.bat
<HR>
<A HREF=https://amazon.com/vine/about>About Amazon Vine</A><P>
<HR>

B. While running addbm.bat
Win+R > addbm
Q: What is it that you want to add?
A: ?

To which you'd simply type the words:
"laptop computer"

B. After running addbm.bat, the vine.html file would change to:
<HR>
<A HREF=https://amazon.com/vine/about>About Amazon Vine</A><P>
<A HREF=https://www.amazon.com/s?k=laptop+computer>amazon laptop computer</A><P>
<A HREF=https://www.amazon.com/vine/vine-items?search=laptop%20computer>vine laptop computer</A><P>
<HR>

This 'addbm.bat' would be generally useful for billions of people, BTW.

My immediate need for 'addbm.bat' is for Amazon Vine items;
but it would be exactly the same script to add anything to
any bookmarks.html text file.
Post by Newyana2
If that's the case then I
can see why you want only a plain editor.
You are correct. A powerful but basic text editor is all I need
to create and edit a bunch of clickable links
(with some rudimentary descriptions).

A browser bookmarks file is just a text file with clickable links.
Why they're so complicated is beyond my comprehension since
all browser bookmark files should be exactly the same syntax
for every web browser.

The format is an anchored hypertext reference & some simple white space.

Like this:
<HR>
<A HREF=https://domain1/urlspec1>domain1 urlspec1</A><P>
<A HREF=https://domain2/urlspec2>domain2 urlspec2</A><P>
<A HREF=https://domain3/urlspec3>domain3 urlspec3</A><P>
<HR>

Philosophically, each person would only need a single bookmarks file.
No matter what platform they're on or what browser they used at the moment.

I'm actually editing a vine.html file because I'm trying to game the system
<https://amazon.com/vine/about>

If you game the system, you can get anything you want on Amazon for 'free'.

To do that, I set up a few links for what I want to order off of Amazon.
My experience is that I can get anything for free after clicking on
those vine.html links for a few times over the period of a few days (or weeks).

The vine.html file allows me to just click on stuff that I want for 'free'.
Eventually it shows up for 'free' (see sig for why I used scare quotes).

It would be better to *automate* that clicking, but I don't know how
to have a web browser just click although I'm sure it would use curl
or wget (with a concomitant spoofing of the browser - which is the
hard part as they will kick you off the Amazon Vine program if they
detect these shenanigans to try to "improve" their algorithms).

The clicking is using Firefox without VPN so they know what I'm doing.
The point is to game Amazon into offering me what I want, for 'free'.

It works. But I'm simply trying to make the process even more efficient.
Thanks for your help and advice. And yes, this is perfectly legal.

See the sig for details.
--
(I put scare quotes around the 'free' because there is no cost for
anything you order off of vine - and there is no tax or shipping - but
your cost depends on your income tax bracket since they send the Feds a 1099).
Newyana2
2025-01-15 21:00:08 UTC
Permalink
Post by Marion
For those on comp.editors, a huge advantage of Notepad++ shortcuts.xml
macro conversion is that it can convert non-printable characters also!
<!-- comment text -->
<Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
<Action type="3" message="1601" wParam="0" lParam="0"
sParam="&amp;#151;" />
<Action type="3" message="1625" wParam="0" lParam="0" sParam="" />
<Action type="3" message="1602" wParam="0" lParam="0" sParam="&amp;" />
<Action type="3" message="1702" wParam="0" lParam="768" sParam="" />
<Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
<!-- comment text -->
I have about a dozen of those Notepad++ macros which convert non-printable
(or inconsistent) characters to printable (or to consistent) characters
after I've cut and pasted from an HTML page.
Sorry, but I lost you. You're assuming people know that
macro code and how it works.
Post by Marion
Well, how do you convert this template set into something useful?
<A HREF=https://www.amazon.com/s?k=foo+bar>amazon foo bar</A><P> <A
HREF=https://www.amazon.com/vine/vine-items?search=foo%20bar>vine foo
bar</A>
ma                         ===> mark a
mb                         ===> mark b
<esc>:'a,'bs/foo/laptop/g  ===> from a to b globally replace foo with
laptop <esc>:'a,'bs/bar/pc/g  ===> from a to b globally replace bar with pc
Again, you lost me. I don't see a template. Weren't
we talking about editing HTML?
Post by Marion
What I'd REALLY WANT is the ability to add items to the bookmarks file.
Yes. That seems to be the confusion. You're not looking to
edit HTML. You're looking to autmoate specific text editing
I use VBScript for things like that. BAT files are limited. I
actually keep a lot of VBS files on my Desktop, to do things
like Copy folderA to folderB if files in folderA do not exist in
folderB. Decode base64. Convert unix returns to Windows
returns. Convert a returnlss CSS block to clear lines with
returns. Clean all temp folders. Convert an encoded URL to
a clean one by doing things like replacing %3A%2F%2F to
://. Collect all domains referenced in an HTML file and present
them in a window with an option to add them to HOSTS. Etc.

All of that is fairly simple with VBScript of javascript files running
under Windows Script Host. (And of course, a specialized editor for
VBS is also handy. :)
Marion
2025-01-16 02:16:21 UTC
Permalink
Post by Newyana2
Post by Marion
I have about a dozen of those Notepad++ macros which convert non-printable
(or inconsistent) characters to printable (or to consistent) characters
after I've cut and pasted from an HTML page.
Sorry, but I lost you. You're assuming people know that
macro code and how it works.
Oh. I apologize. Allow me to briefly explain what Notepad++ does well.

Here's the problem that we're trying to solve with that shortcuts.xml file.
1. Let's say you copied and pasted from, oh, say five different web sites.
2. Lot's of "strange" & "inconsistent" characters will have been pasted.
3. Pasting the results into Notepad++ & running the macro cleans it all up.

Some of the crazy things that get pasted from web to text are...
a. If there are inconsistent styles of quotes, the macro fixes all that.
b. If there are special characters (e.g., umlauts), the macro fixes that.
c. If there are unprintable characters, the macro fixes that too.
Each time you run into something strange, you add a new macro to fix it.
That way you never have to repeat the same effort ever again.

You just make the macro longer and longer every time you find a problem.

All you do to fix *any* set of characters from web page cut and pastes is
A. Win+R > n (this starts Notepad++)
B. Control+V (this pastes your web copies into Notepad++)
C. Control+A (this selects all the text that was copied to Notepad++)
D. Control+B (this runs the shortcuts.xml macro on the selected set

In that quick sequence, you can clean up pastes of multiple web pages where
all sorts of hidden characters, strange characters & inconsistently
punctuation can be fixed.

A simple example is some web pages use "curly quotes" (sometimes called
"smart quotes") and some web pages don't use those fancy quotes - but you
want your final result to be consistent so you fix it to the same type.

Another example are bullet items. Another example is hidden text that the
web page insert for trademarks. Another example are strange characters such
as the "ae" character or the long "--" character (there are many of these).

The Notepad++ single-step macro cleans it all up in a single step.
What could be better than that?
Post by Newyana2
Post by Marion
Well, how do you convert this template set into something useful?
<A HREF=https://www.amazon.com/s?k=foo+bar>amazon foo bar</A><P> <A
HREF=https://www.amazon.com/vine/vine-items?search=foo%20bar>vine foo
bar</A>
ma������������������������ ===> mark a
mb������������������������ ===> mark b
<esc>:'a,'bs/foo/laptop/g� ===> from a to b globally replace foo with
laptop <esc>:'a,'bs/bar/pc/g� ===> from a to b globally replace bar with pc
Again, you lost me. I don't see a template. Weren't
we talking about editing HTML?
My apologies. The TEMPLATE is the two lines inside of the text file.
Those two lines are placeholder lines. They're the template.
So the HTML template is teh two lines above, one for Amazon, one for Vine.

When you want to add an item, you munge those two lines without destroying
them, so you first make a copy of those two lines with "mark a" and then
you drop down two lines and "yank to a" and then "paste" what you yanked.

In gvim, that sequence is "ma" & "jj" & y'a" and then "p".
a. ma => mark a
b. jj => drop down two lines
c. y'a => yank to a
d. p => paste the result

At that point, you have FOUR lines. Two for the original HEML template.
And two for the copy of that original template set of HTML lines.

At that point, you munge the SECOND SET of lines to the links you want.

FROM:
<A HREF=https://amazon.com/s?k=foo+bar>amazon foo bar</A><P>
<A HREF=https://amazon.com/vine/vine-items?search=foo%20bar>vine foo bar</A>
TO:
<A HREF=https://amazon.com/s?k=laptop+pc>amazon laptop pc</A><P>
<A HREF=https://amazon.com/vine/vine-items?search=laptop%20pc>vine laptop pc</A>

Now you have clickable links to run the desired searches.

In short, you did the following:
a. You created a two-line template
b. Then you copied that template & used regular expressions on the copy
c. The result is two lines that did something you wanted to be a link
Post by Newyana2
Post by Marion
<A HREF=https://www.amazon.com/s?k=foo+bar>amazon foo bar</A><P> <A
HREF=https://www.amazon.com/vine/vine-items?search=foo%20bar>vine foo
bar</A>
What I'd REALLY WANT is the ability to add items to the bookmarks file.
Yes. That seems to be the confusion. You're not looking to
edit HTML. You're looking to autmoate specific text editing
Yeah. I think most people would like a bm.bat file which just asked for
what URL they wanted to go to and what they wanted to call it.

C:\> bm.bat
What is the URL please?
What do you want to call it?

If you gave it the following two answers, it would add to the bm.htm file:
What is the URL please?
https://www.midomi.com/

What do you want to call it?
hum songs to find them

The resulting bookmarks.html file would have a new line of the following:
<A HREF=https://www.midomi.com/>hum songs to find them</A><P>
Post by Newyana2
I use VBScript for things like that. BAT files are limited. I
actually keep a lot of VBS files on my Desktop, to do things
like Copy folderA to folderB if files in folderA do not exist in
folderB. Decode base64. Convert unix returns to Windows
returns. Convert a returnlss CSS block to clear lines with
returns. Clean all temp folders. Convert an encoded URL to
a clean one by doing things like replacing %3A%2F%2F to
://. Collect all domains referenced in an HTML file and present
them in a window with an option to add them to HOSTS. Etc.
All of that is fairly simple with VBScript of javascript files running
under Windows Script Host. (And of course, a specialized editor for
VBS is also handy. :)
I don't disagree but I never learned VBS.
So for me it would have to be a batch file doing the following, which I
think billions of Windows users would be able to use because they need it.

bm.bat
Q: What is the URL?
Q: What do you want to call it?

If you enter in for the URL, oh, say:
"https://ispdesign.ui.com/"
And if you enter in what to call it of, oh, say:
"design antenna"

Then the resulting bookmarks file should have this added line to it:
<A HREF=https://ispdesign.ui.com/>design antenna</A><P>

Wouldn't almost everyone in the world want that bm.bat to create a single
system-wide custom bookmarks file that is browser independent?
Lawrence D'Oliveiro
2025-01-18 06:47:56 UTC
Permalink
Post by Newyana2
I've never used regexp for anything. I don't know why I might
use them editing HTML.
Doing a word count, for example.

<https://gitlab.com/ldo/emacs-prefs/-/blob/master/unhtml-wc.el>
Post by Newyana2
For HTML, or anything, I want an editor designed
for that specifically.
Do you really want a different editor for each type of text file you have
to deal with?!?
Newyana2
2025-01-18 14:09:28 UTC
Permalink
Post by Lawrence D'Oliveiro
Post by Newyana2
I've never used regexp for anything. I don't know why I might
use them editing HTML.
Doing a word count, for example.
I have a very simple VBScript on my desktop if I need a word
count. I very rarely use it. What I do use with HTML are HTML-
specific editor functions. Though I recently made my own simple
Notepad replacement and added word count/character count to
that.
Post by Lawrence D'Oliveiro
Post by Newyana2
For HTML, or anything, I want an editor designed
for that specifically.
Do you really want a different editor for each type of text file you have
to deal with?!?
Yes. Because there are not many. I have the VB6 IDE for VB6.
It provides "intellisense" popup menus for objects, code coloring,
debugging features, a COM object browser, etc. All of that is
specific support for VB6.

I have my own editor for HTML and VBScript. For HTML I have
color coding, quick insertion of tags, quick lists of possible
tag attributes, color coding for script, CSS and HTML separately,
a color picker to get hex codes, a toggle to view the page, which
also provides CSS values for any page element hovered over,
and so on. That's because I actually write HTML. So all of these
features are big time savers and hassle removers.

If you have something like Sublime, Atom, Notepad++, etc, you
get an adjustable UI and you get generic colorcoding that has
little value. And you get line numbers. Those are both useful, but
in a limited way. For example, variables can't be colorcoded in any
language because they don't follow a simple rule. Any other language-
specific features are missing because these editors don't actually
"support" multiple languages. They just offer rudimentary colorcoding
and call that support.

Aside from programming code and plain text, what else is there
for a text editor to handle? Plain text is plain text. For actual plain
text I use Notepad. Once you get beyond code features, it's no
longer plain text. Then you're getting into fonts, pictures, formatting,
and so on, which is a different thing.

Colorcoding colors plain text in a window. The plain text is not
changed. More complex formats, like RTF or DOC, are not plain text.
So plain text just means text, typically ANSI or possibly UTF-8,
which means you're either writing plain text or you're writing some
kind of code.

What these editors
advertise is endless code language support. If I remember correctly,
Notepad++ claims to support 50+ languages, and more can be added.
So they're being billed as code editors. No one serious about coding
a particular language would use such a generic tool.

That kind of support is like a $5 jackknife with 35 blades. Of course
it has a bottle opener, but the bottle opener will probably break the
first time you try to use it.

N++ is really just a thin wrapper around the Scintilla OSS editor
component, which is similar to a RichEdit window. The one good thing
about N++ is that it's very fast with very big files. But anyone who
actually writes any kind of code on any kind of regular basis will
greatly benefit from some kind of IDE -- a tool designed for the job --
not just a text editor with color-coded text to identify keywords
and strings.

It's like anything. If you want to cook you need more than a
saucepan. If you want to do carpenty you need more than a jigsaw.
If you want to repair your car you need more than vicegrip pliers.
You can, of course, get by with a saucepan if all you eat is snack
ramen. But that's not really cooking. That's MIT student dinner.

There seems to be a kind of macho sensibility with a lot of
geeks. "Sure, I can't throw a football or change a tire, but my
editor is black with white characters and it looks really primitive.
It's like heating my hot water over a campfire. Roughing it, man."
I'm not interested in roughing it. I like having a water heater
connected to plumbing so that I can get hot water in my kitchen
sink. There's nothing heroic about heating hot water over a campfile
in a suburban backyard. It's just dumb.
Carlos E.R.
2025-01-18 14:25:37 UTC
Permalink
...
   What these editors
advertise is endless code language support. If I remember correctly,
Notepad++ claims to support 50+ languages, and more can be added.
So they're being billed as code editors. No one serious about coding
a particular language would use such a generic tool.
Well, this is not true. Most Linux programmers use vi or emacs. Me,
coming from the Dos world prefer a dedicated IDE.
--
Cheers, Carlos.
Newyana2
2025-01-18 18:55:07 UTC
Permalink
Post by Carlos E.R.
...
    What these editors
advertise is endless code language support. If I remember correctly,
Notepad++ claims to support 50+ languages, and more can be added.
So they're being billed as code editors. No one serious about coding
a particular language would use such a generic tool.
Well, this is not true. Most Linux programmers use vi or emacs.
Most Linux fans, maybe. They're adamantly dedicated to
old-style tools and command line. But what are they writing?
Shell scripts? Maybe a little Perl? That's not programming code.
It's more like IT work. Anyone doing programming would likely
want an IDE if they can have it.

What we were talking about here was HTML. I very much doubt
that the average Linux fan is writing HTML. It's too rich and
colorful for their taste. If they do write HTML to do anything more
than very simple formatting then there would be no benefit in
using Notepad++, Emacs, etc. Even writing very simple HTML there's
little reason to use those editors. They offer only rudimentary
color-coding. If you're *really* writing HTML then you want the
extras.

I think there are two issues here. One is what's the best tool
for the job. Emacs can be OK for limited code writing where a
bit of colorcoding is helpful. But like the other generic editors, it
doesn't offer specialized tools for particular languages. So it's a
swiss army knife for small jobs.

The other issue is irrational, emotional attachment. That's what
makes people have tantrums about reasonable requests like having
a GUI for system settings in the 21st century. Those console window
fanatics are not doing it because it's the best tool. They're doing
it because they came of age (or their grandfather did) at a time
when men were men and men used console, because it's all there
was. Now they think console is more authentic or more macho. It
also serves as a kind of hazing challenge. They don't want computers
to be easy to use because then their skills would have little value.

Those same partially socialized, 60 year old Linux teenagers are
also fanatic about their choice of vi or emacs. ("No, the names are
not capitalized. Fuck you, you Windoze wimps. Capital letters are for
losers. If you can tell me what gnu stands for, and why that's cool,
then we might let you into our clubhouse.") It's like 12-year-olds with
secret decoder rings.

I had a friend back in the early 2000s who was a software project
manager. She did very well. Apparently few people are well suited to
managing anti-social geeks. .Net had recently come out but it was
booming. I asked my friend why .Net was so popular and Java was
not, despite being well established. Without hesitation she answered,
"The tools." That made sense. Microsoft have always bent over
backward to provide very good tools for people of varying levels of
expertise. When Visual Studio came out there was nothing else like
it. .Net, again, was designed to be RAD, usable, and not too hard
to learn.
Kenny McCormack
2025-01-18 20:15:59 UTC
Permalink
In article <vmgtcu$12ejq$***@dont-email.me>,
Newyana2 <***@invalid.nospam> wrote:
...
Post by Newyana2
Most Linux fans, maybe. They're adamantly dedicated to
old-style tools and command line. But what are they writing?
Shell scripts? Maybe a little Perl? That's not programming code.
It's more like IT work. Anyone doing programming would likely
want an IDE if they can have it.
You really, really, really need to understand and accept the fundamental
principle of argumentation: Namely, that when you find yourself in a hole,
the first thing to do is to stop digging.
--
The randomly chosen signature file that would have appeared here is more than 4
lines long. As such, it violates one or more Usenet RFCs. In order to remain
in compliance with said RFCs, the actual sig can be found at the following URL:
http://user.xmission.com/~gazelle/Sigs/ItsTough
Carlos E.R.
2025-01-18 20:19:06 UTC
Permalink
Post by Carlos E.R.
...
    What these editors
advertise is endless code language support. If I remember correctly,
Notepad++ claims to support 50+ languages, and more can be added.
So they're being billed as code editors. No one serious about coding
a particular language would use such a generic tool.
Well, this is not true. Most Linux programmers use vi or emacs.
    Most Linux fans, maybe. They're adamantly dedicated to
old-style tools and command line. But what are they writing?
Shell scripts? Maybe a little Perl? That's not programming code.
It's more like IT work. Anyone doing programming would likely
want an IDE if they can have it.
I know profesional programmers that never used an IDE. The same way that
you can not understand doing serious programming with vi, he can not
understand me wanting an IDE.

Linus Torvalds uses microEmacs.

https://en.wikipedia.org/wiki/MicroEMACS


...
--
Cheers, Carlos.
Lawrence D'Oliveiro
2025-01-18 20:55:07 UTC
Permalink
Post by Carlos E.R.
I know profesional programmers that never used an IDE.
IDEs only support limited ways of building things. Far better to have a
general-purpose editor, like Emacs, that is capable of driving any build
system.
Carlos E.R.
2025-01-18 22:29:39 UTC
Permalink
Post by Lawrence D'Oliveiro
Post by Carlos E.R.
I know profesional programmers that never used an IDE.
IDEs only support limited ways of building things. Far better to have a
general-purpose editor, like Emacs, that is capable of driving any build
system.
A good IDE can do things like set breakpoints in the source code, start
the application in debug mode, and run a line a time, while examining
the variables (even writing into the variables).

Not in the debugger, but in the IDE.
--
Cheers, Carlos.
Lawrence D'Oliveiro
2025-01-19 00:44:37 UTC
Permalink
Post by Carlos E.R.
Post by Lawrence D'Oliveiro
Post by Carlos E.R.
I know profesional programmers that never used an IDE.
IDEs only support limited ways of building things. Far better to have a
general-purpose editor, like Emacs, that is capable of driving any build
system.
A good IDE can do things like set breakpoints in the source code, start
the application in debug mode, and run a line a time, while examining
the variables (even writing into the variables).
Not in the debugger, but in the IDE.
Launch the debugger from within an editor window. Simples.
Carlos E.R.
2025-01-19 02:50:51 UTC
Permalink
Post by Lawrence D'Oliveiro
Post by Carlos E.R.
Post by Lawrence D'Oliveiro
Post by Carlos E.R.
I know profesional programmers that never used an IDE.
IDEs only support limited ways of building things. Far better to have a
general-purpose editor, like Emacs, that is capable of driving any build
system.
A good IDE can do things like set breakpoints in the source code, start
the application in debug mode, and run a line a time, while examining
the variables (even writing into the variables).
Not in the debugger, but in the IDE.
Launch the debugger from within an editor window. Simples.
That's not it. I don't want to launch the debugger.
--
Cheers, Carlos.
Carlos E.R.
2025-01-19 02:56:53 UTC
Permalink
Post by Carlos E.R.
Post by Lawrence D'Oliveiro
Post by Carlos E.R.
Post by Lawrence D'Oliveiro
Post by Carlos E.R.
I know profesional programmers that never used an IDE.
IDEs only support limited ways of building things. Far better to have a
general-purpose editor, like Emacs, that is capable of driving any build
system.
A good IDE can do things like set breakpoints in the source code, start
the application in debug mode, and run a line a time, while examining
the variables (even writing into the variables).
Not in the debugger, but in the IDE.
Launch the debugger from within an editor window. Simples.
That's not it. I don't want to launch the debugger.
Look, I understand that you are happy without a fully featured IDE. But
similarly, I am asking you to accept that I am not happy without a fully
featured IDE.

Both things are true for many programmers.
--
Cheers, Carlos.
Janis Papanagnou
2025-01-19 08:43:57 UTC
Permalink
Post by Carlos E.R.
Post by Carlos E.R.
Post by Lawrence D'Oliveiro
Post by Carlos E.R.
Post by Lawrence D'Oliveiro
Post by Carlos E.R.
I know profesional programmers that never used an IDE.
IDEs only support limited ways of building things. Far better to have a
general-purpose editor, like Emacs, that is capable of driving any build
system.
A good IDE can do things like set breakpoints in the source code, start
the application in debug mode, and run a line a time, while examining
the variables (even writing into the variables).
Not in the debugger, but in the IDE.
Launch the debugger from within an editor window. Simples.
That's not it. I don't want to launch the debugger.
Look, I understand that you are happy without a fully featured IDE. But
similarly, I am asking you to accept that I am not happy without a fully
featured IDE.
Yes. And I think you are right. But we should also sort things a bit.
An IDE is something completely different than an editor, of course.
It's a thing where typically tons of different features are combined
and _strongly interconnected_ to offer an integrated user experience.
That's a strength of IDEs, and a weakness. What LDO was implicitly
trying to point out was (I think) that it's good to have tools that
have a clear task (you don't pay for things that you don't want) and
a flexible interface (to make use of _powerful_ components). The tool
or IDE designers, for example, could provide a setting where you can
choose the (integrated) components. An editing interface, for example,
is quite simple and clear, and it would in principle be possible to
use any editor (per user setting) also in an IDE; for the interacting
features you'd just need a (typically small) "adapter layer". In fact
there's quite some well designed tools that allow to use own editors.
The advantages are multifold; it's not only that you can use for the
individual features specialized components - components that do their
respective job much better than any IDE-built-in re-implementation of
a feature (or a "clone"). During the decades of my IT practice I used
IDEs twice. The problems I had with them was, for one, that I had to
use exactly what was supported by the IDE, and use of any powerful
tools to efficiently perform tasks that I was used to was impossible
or overly cumbersome by clumsy workarounds. For someone who is used
to do _arbitrarily complex_ editing functions in an _efficient_ way
(with powerful editors) it's really a pain to work with common IDEs.
But many people I observed were doing quite _primitive editing_; they
don't know better given all the GUI based primitive editors that we
typically often find as inferior ad hoc editing (re-)implementation
and that folks got used to. With IDEs it's often just a mouse orgy of
clicking things together in a mixture of mouse/menu and text input,
no editing any more. The efficiency of keyboard(-only) input (e.g. in
editors) has to be compensated by other means (like auto-completion).
I think that's one reason why the opinions are so strong and why the
permeability from one group/type of users/programmers to the other
is so difficult. I'd only have wished that folks who speak about the
pros and cons [of IDEs and powerful editors] would not be completely
ignorant and full of prejudice; ignorance AND prejudice is a very bad
(and in Real Life topics even dangerous) combination.
Post by Carlos E.R.
Both things are true for many programmers.
Janis

PS (as an aside): While IDEs usually try to increase their feature
set for a yet better support of their dedicated tasks Emacs is often
[humorously] despised (especially by Vi users) as not being an editor
but more of an IDE.
Carlos E.R.
2025-01-19 13:16:38 UTC
Permalink
Post by Janis Papanagnou
Post by Carlos E.R.
Post by Carlos E.R.
Post by Lawrence D'Oliveiro
Post by Carlos E.R.
Post by Lawrence D'Oliveiro
Post by Carlos E.R.
I know profesional programmers that never used an IDE.
IDEs only support limited ways of building things. Far better to have a
general-purpose editor, like Emacs, that is capable of driving any build
system.
A good IDE can do things like set breakpoints in the source code, start
the application in debug mode, and run a line a time, while examining
the variables (even writing into the variables).
Not in the debugger, but in the IDE.
Launch the debugger from within an editor window. Simples.
That's not it. I don't want to launch the debugger.
Look, I understand that you are happy without a fully featured IDE. But
similarly, I am asking you to accept that I am not happy without a fully
featured IDE.
Yes. And I think you are right. But we should also sort things a bit.
An IDE is something completely different than an editor, of course.
It's a thing where typically tons of different features are combined
and _strongly interconnected_ to offer an integrated user experience.
That's a strength of IDEs, and a weakness. What LDO was implicitly
trying to point out was (I think) that it's good to have tools that
have a clear task (you don't pay for things that you don't want) and
a flexible interface (to make use of _powerful_ components). The tool
or IDE designers, for example, could provide a setting where you can
choose the (integrated) components. An editing interface, for example,
is quite simple and clear, and it would in principle be possible to
use any editor (per user setting) also in an IDE; for the interacting
features you'd just need a (typically small) "adapter layer". In fact
there's quite some well designed tools that allow to use own editors.
The advantages are multifold; it's not only that you can use for the
individual features specialized components - components that do their
respective job much better than any IDE-built-in re-implementation of
a feature (or a "clone"). During the decades of my IT practice I used
IDEs twice. The problems I had with them was, for one, that I had to
use exactly what was supported by the IDE, and use of any powerful
tools to efficiently perform tasks that I was used to was impossible
or overly cumbersome by clumsy workarounds. For someone who is used
to do _arbitrarily complex_ editing functions in an _efficient_ way
(with powerful editors) it's really a pain to work with common IDEs.
But many people I observed were doing quite _primitive editing_; they
don't know better given all the GUI based primitive editors that we
typically often find as inferior ad hoc editing (re-)implementation
and that folks got used to. With IDEs it's often just a mouse orgy of
clicking things together in a mixture of mouse/menu and text input,
no editing any more. The efficiency of keyboard(-only) input (e.g. in
editors) has to be compensated by other means (like auto-completion).
I think that's one reason why the opinions are so strong and why the
permeability from one group/type of users/programmers to the other
is so difficult. I'd only have wished that folks who speak about the
pros and cons [of IDEs and powerful editors] would not be completely
ignorant and full of prejudice; ignorance AND prejudice is a very bad
(and in Real Life topics even dangerous) combination.
Post by Carlos E.R.
Both things are true for many programmers.
Janis
PS (as an aside): While IDEs usually try to increase their feature
set for a yet better support of their dedicated tasks Emacs is often
[humorously] despised (especially by Vi users) as not being an editor
but more of an IDE.
Or an operating system :-D
--
Cheers, Carlos.
Marion
2025-01-19 21:27:15 UTC
Permalink
Post by Janis Papanagnou
PS (as an aside): While IDEs usually try to increase their feature
set for a yet better support of their dedicated tasks Emacs is often
[humorously] despised (especially by Vi users) as not being an editor
but more of an IDE.
The problem set is (& always was) to edit HTML templates in a single step.

CHANGE HTML FROM:
<A HREF=https://www.amazon.com/s?k=foo+bar>(amazon) foo bar</A><P>
<A HREF=https://www.amazon.com/vine/vine-items?search=foo%20bar>(vine) foo bar</A><P>

CHANGE HTML TO:
<A HREF=https://www.amazon.com/s?k=windows+pc>(amazon) windows pc</A><P>
<A HREF=https://www.amazon.com/vine/vine-items?search=windows%20pc>(vine) windows pc</A><P>

Has anyone yet proposed a solution of fewer steps than the following macro?

Step 1: firefox file:///C:/sys/myurls.html" bookmark & press Control+C
Step 2: press @q after the ad hoc desired macro is defined on the fly

qq: Starts recording a macro in the register q.
:'a,'bs/foo/windows/g<Enter>
This replaces "foo" with "windows" in the selected set.
<Enter> simulates pressing the Enter key.

:%'a,'bs/bar/pc/g<Enter>
This replaces all occurrences of "bar" with "pc" in the selected set.
q: Stops recording the macro.

To use the macro:
Open the file in Firefox & press Control+Q to edit in gvim
Enter the macro recording mode by pressing qq
Enter the commands as shown above
Press q to stop recording
To execute the macro, press @q

This will execute the entire macro, replacing "foo" with "windows"
and "bar" with "pc" within the selected area in a single step.

This approach effectively defines the two replacement operations as a
single unit within the macro, making it a one-step action for the user.

Has anyone proposed a simpler one-step solution than that above?
If so, I'd love to see it as I'm seeking real working actual solutions.
Eric Pozharski
2025-01-22 17:57:05 UTC
Permalink
["Followup-To:" header set to comp.editors.]
# a.c.o.w10 and a.c.s.f are irrelevant for this branch now
Post by Marion
Post by Janis Papanagnou
PS (as an aside): While IDEs usually try to increase their feature
set for a yet better support of their dedicated tasks Emacs is often
[humorously] despised (especially by Vi users) as not being an editor
but more of an IDE.
The problem set is (& always was) to edit HTML templates in a single step.
CHANGE HTML FROM: <A HREF=https://www.amazon.com/s?k=foo+bar>(amazon)
foo bar</A><P> <A
HREF=https://www.amazon.com/vine/vine-items?search=foo%20bar>(vine)
foo bar</A><P>
CHANGE HTML TO: <A HREF=https://www.amazon.com/s?k=windows+pc>(amazon)
windows pc</A><P> <A
HREF=https://www.amazon.com/vine/vine-items?search=windows%20pc>(vine)
windows pc</A><P>
*SKIP* [ 16 lines 1 level deep]
Post by Marion
Has anyone proposed a simpler one-step solution than that above? If
so, I'd love to see it as I'm seeking real working actual solutions.
Please define 'simpler one-step solution'. Preferably in terms others
can comprehend. (Also, "comprehend" and "value" are two distinct
concepts).

:%s,\<foo\>\(.\+\{-1,}\)\<bar\>,windows\1pc,gc

This looks pretty simple to me. But I'm not into IDEs, so there's that.
--
Torvalds' goal for Linux is very simple: World Domination
Stallman's goal for GNU is even simpler: Freedom
Lawrence D'Oliveiro
2025-01-20 01:14:45 UTC
Permalink
... Emacs is often [humorously] despised (especially by Vi users) as not
being an editor but more of an IDE.
An IDE integrates its own build system, debugger, version control etc.
Emacs does none of those things. It is an editor. It can work with
whatever build system, debugger, version control etc that you want to use.

Note also it is not (just) a *text* editor, it is an editor. It is quite
capable of editing non-text files.
Newyana2
2025-01-19 13:18:19 UTC
Permalink
Post by Carlos E.R.
Look, I understand that you are happy without a fully featured IDE. But
similarly, I am asking you to accept that I am not happy without a fully
featured IDE.
Lawrence sees only his own use case and extrapolates
from there. And his use case is very unique: Writing Lisp
customizations for an editor that he only uses for editing
one of a dozen basic text code languages.

It's like critiquing Linux. You say, "I don't like that Linux
doesn't have xyz." The Linux fans answer, "You shouldn't
want xyz because it's not in Linux." :)
Lawrence D'Oliveiro
2025-01-20 01:13:12 UTC
Permalink
for an editor that he only uses for editing one of a dozen basic text
code languages.
How many “text code languages” do you deal with?
Lawrence D'Oliveiro
2025-01-20 01:15:29 UTC
Permalink
Post by Carlos E.R.
That's not it. I don't want to launch the debugger.
You want to use a debugger, but you don’t want to start it running? How is
that supposed to work?
Carlos E.R.
2025-01-20 13:00:26 UTC
Permalink
Post by Lawrence D'Oliveiro
Post by Carlos E.R.
That's not it. I don't want to launch the debugger.
You want to use a debugger, but you don’t want to start it running? How is
that supposed to work?
The IDE has the debugger inside. I launch the IDE, the IDE does the
debugging. Not a stand alone debugger.


If you are asking that, you have not seen a proper IDE at work.
--
Cheers, Carlos.
Lawrence D'Oliveiro
2025-01-21 04:48:44 UTC
Permalink
Post by Carlos E.R.
The IDE has the debugger inside. I launch the IDE, the IDE does the
debugging. Not a stand alone debugger.
What difference does it make? Why do you want the debugger to run in the
same process as the IDE? Do you want it to run in the same process as your
program? That’s not how debuggers work on modern systems.
Carlos E.R.
2025-01-21 12:28:12 UTC
Permalink
Post by Lawrence D'Oliveiro
Post by Carlos E.R.
The IDE has the debugger inside. I launch the IDE, the IDE does the
debugging. Not a stand alone debugger.
What difference does it make? Why do you want the debugger to run in the
same process as the IDE? Do you want it to run in the same process as your
program? That’s not how debuggers work on modern systems.
It doesn't matter if it is the same process. It matters that this is
what defines a complete and powerful IDE, having these functionalities
inside, not on an external program (which also exists). This is
technology invented in the 90's or perhaps earlier by Borland.
--
Cheers, Carlos.
Newyana2
2025-01-21 13:39:59 UTC
Permalink
Post by Carlos E.R.
Post by Lawrence D'Oliveiro
Post by Carlos E.R.
The IDE has the debugger inside. I launch the IDE, the IDE does the
debugging. Not a stand alone debugger.
What difference does it make? Why do you want the debugger to run in the
same process as the IDE? Do you want it to run in the same process as your
program? That’s not how debuggers work on modern systems.
It doesn't matter if it is the same process. It matters that this is
what defines a complete and powerful IDE, having these functionalities
inside, not on an external program (which also exists). This is
technology invented in the 90's or perhaps earlier by Borland.
Do you realize that this bickering will continue as long as
you take part?

Lawrence reminds me of a couple of people
who used to frequent the photo editing newsgroup. They
probably still do. One was a know-it-all who would argue that
the sky is not blue. The other was a reasonable person but
couldn't stop when the bickering started. They'd sometimes
go on over 100 posts, with variations on "Is not!" and "Is so!"

Know-it-alls are highly skilled at twisting details and context
in order to assemble unassailable logic:

"Water is wet."
"Is not. Since when you idiot? Have you ever touched an ice cube with
cold hands?"
"When it's not frozen, it's wet."
"Why would you want to get wet?"

There's an obsession with winning and a notable lack of
interest in facts or relevance; an obscene paucity of curiosity.
Frank Slootweg
2025-01-21 14:00:14 UTC
Permalink
Post by Carlos E.R.
Post by Lawrence D'Oliveiro
Post by Carlos E.R.
The IDE has the debugger inside. I launch the IDE, the IDE does the
debugging. Not a stand alone debugger.
What difference does it make? Why do you want the debugger to run in the
same process as the IDE? Do you want it to run in the same process as your
program? That?s not how debuggers work on modern systems.
It doesn't matter if it is the same process. It matters that this is
what defines a complete and powerful IDE, having these functionalities
inside, not on an external program (which also exists). This is
technology invented in the 90's or perhaps earlier by Borland.
Yes, when you described debugging in the IDE, I remembered how it was
in Borland's Turbo C.

Not that I did that much with it. Most of my C programming was on
relatively 'dumb' Unix/UNIX environments, but I managed anyway. :-)
Lawrence D'Oliveiro
2025-01-22 00:09:13 UTC
Permalink
Post by Carlos E.R.
Post by Lawrence D'Oliveiro
Post by Carlos E.R.
The IDE has the debugger inside. I launch the IDE, the IDE does the
debugging. Not a stand alone debugger.
What difference does it make? Why do you want the debugger to run
in the same process as the IDE? Do you want it to run in the same
process as your program? That’s not how debuggers work on modern
systems.
It doesn't matter if it is the same process. It matters that this is
what defines a complete and powerful IDE ...
No, that is just how it was done back in the days when you thought single-
tasking MS-DOS was the bee’s knees. Your IDEs had to provide all this
functionality built-in because there was no way to call it externally.

That’s not how we do things on *real* computers. We run the debugger in a
separate process so that program crash cannot kill the debugger. The
debugger is just another off-the-shelf component, that can be used from
any editor/IDE, so you can mix and match your preferred components to I
your own DE: Integrate your own Development Environment, just the way you
like it. You don’t have to take or leave what some single vendor provides.
Newyana2
2025-01-18 21:56:21 UTC
Permalink
Post by Carlos E.R.
     Most Linux fans, maybe. They're adamantly dedicated to
old-style tools and command line. But what are they writing?
Shell scripts? Maybe a little Perl? That's not programming code.
It's more like IT work. Anyone doing programming would likely
want an IDE if they can have it.
I know profesional programmers that never used an IDE. The same way that
you can not understand doing serious programming with vi, he can not
understand me wanting an IDE.
Linus Torvalds uses microEmacs.
That could be. Are you still arguing that a simple, non-specialzed
editor is better than an IDE... because Linus Torvalds uses one?
Kenny McCormack
2025-01-18 21:57:05 UTC
Permalink
Post by Newyana2
Post by Carlos E.R.
Post by Newyana2
Most Linux fans, maybe. They're adamantly dedicated to
old-style tools and command line. But what are they writing?
Shell scripts? Maybe a little Perl? That's not programming code.
It's more like IT work. Anyone doing programming would likely
want an IDE if they can have it.
I know profesional programmers that never used an IDE. The same way that
you can not understand doing serious programming with vi, he can not
understand me wanting an IDE.
Linus Torvalds uses microEmacs.
That could be. Are you still arguing that a simple, non-specialzed
editor is better than an IDE... because Linus Torvalds uses one?
The thing you need to do is to realize and accept that when you find
yourself in a hole, the first thing to do is to stop digging.
--
I shot a man on Fifth Aveneue, just to see him die.
Newyana2
2025-01-18 22:40:45 UTC
Permalink
Post by Kenny McCormack
The thing you need to do is to realize and accept that when you find
yourself in a hole, the first thing to do is to stop digging.
I suppose you think it's clever to hide in the corner and throw
stones. It's not.

If you're going to take the trouble to post then
you should think through something useful to say. What you're doing
is what the kids like to call "ad hominem attacks", which basically
means telling people that their grandmother wears army boots,
without offering any insight or even criticism. Just a put-down.
Carlos E.R.
2025-01-18 22:33:46 UTC
Permalink
Post by Carlos E.R.
     Most Linux fans, maybe. They're adamantly dedicated to
old-style tools and command line. But what are they writing?
Shell scripts? Maybe a little Perl? That's not programming code.
It's more like IT work. Anyone doing programming would likely
want an IDE if they can have it.
I know profesional programmers that never used an IDE. The same way
that you can not understand doing serious programming with vi, he can
not understand me wanting an IDE.
Linus Torvalds uses microEmacs.
  That could be. Are you still arguing that a simple, non-specialzed
editor is better than an IDE... because Linus Torvalds uses one?
I am telling you that there are serious professionals programmers that
work without an IDE. Just accept it. I'm not saying that you change your
programming methodology, just accept that there are other very capable
people that do differently.

"Better" varies per person.
--
Cheers, Carlos.
Lawrence D'Oliveiro
2025-01-18 20:54:19 UTC
Permalink
Post by Newyana2
Shell scripts? Maybe a little Perl? That's not programming code.
db_user=
db_passwd=
db_host=
for ((;;)); do
if [ "${1:0:2}" != "--" ]; then
break
fi
opt="${1:2:${#1}}"
shift
val="${opt#*=}"
opt="${opt%%=*}"
if [ "$opt" = "user" ]; then
db_user="$val"
elif [ "$opt" = "password" ]; then
db_passwd="$val"
elif [ "$opt" = "host" ]; then
db_host="$val"
else
echo "bad option $opt" 1>&2
exit 3
fi
done
if [ $# != 1 ]; then
echo $'Usage:\n\t'"$0"$' [--user=user] [--password=passwd] <dbname>\n' 1>&2
exit 3
fi
dbname="$1"

basecmd="mysql"
if [ "$db_user" != "" ]; then
basecmd="$basecmd -u $db_user"
fi
if [ "$db_passwd" != "" ]; then
basecmd="$basecmd -p$db_passwd"
fi
if [ "$db_host" != "" ]; then
basecmd="$basecmd -h $db_host"
fi
echo "Tables for $dbname:"
for table in $($basecmd -B -e "show tables from $dbname" | tail -n+2); do
echo
echo "Fields for $table:"
$basecmd $dbname -e "show columns from $table"
done
Lawrence D'Oliveiro
2025-01-18 20:50:29 UTC
Permalink
Post by Newyana2
Post by Lawrence D'Oliveiro
I've never used regexp for anything. I don't know why I might use them
editing HTML.
Doing a word count, for example.
I have a very simple VBScript on my desktop if I need a word
count.
Is it as simple as the ELisp script I referenced? Remember, that
integrates into the editor, so it is just a few keystrokes away.
Post by Newyana2
Post by Lawrence D'Oliveiro
Do you really want a different editor for each type of text file you
have to deal with?!?
Yes. Because there are not many.
Each programming language has its own syntax rules. Then you have other
formats like Markdown, groff, HTML (as mentioned), XML, JSON, .ini files
commonly used for config purposes ... I suspect I probably have to deal
with about a dozen different formats, at least on an occasional basis.

I don’t want to have to run a dozen different editors for that.
Newyana2
2025-01-18 22:36:49 UTC
Permalink
Post by Lawrence D'Oliveiro
Is it as simple as the ELisp script I referenced? Remember, that
integrates into the editor, so it is just a few keystrokes away.
That's interesting. So in a way you're programming the editor
yourself, to whatever extent you find useful. I can see how that
would be appealing for a particular usage.

I don't think we're really disagreeing. We're talking about
different things. You have a very specialized usage, you're
capable of adapting your editor for personal optimization. Those
optimizations are more useful to you than specialized functionality.
However, your usage is extremely rare. Very few people are
coding in a dozen languages and very few are capable, or even
interested in, customizing an editor to the point of writing a lot
of its functionality.

I was talking about using a generic vs specialized editor
for a particular language. (In this case HTML.) The general
editors provide no specialized functions other than rudimentary
colorcoding and line numbers. Adding something like word count
is a plain text function.

In my HTML editor, for example, I can browse for a file and
then auto-insert an IMG tag without having to check the pixel
dimensions. I can display an image, click any
point, and get the hex code for that point, which can be very
useful for background and outline coloring. I can display a colorpicker
and get the hex code for a selected color. I can toggle to display
the webpage, hover over any point, and find the class/ID for
that element. I can quickly see a list of possible attributes for
an HTML tag.... Those are all things that make the job easier.

That might not be of much use to you. Maybe you couldn't care
less. But if you did a lot of HTML work, those functions would be
big hassle-savers.
Lawrence D'Oliveiro
2025-01-19 00:46:05 UTC
Permalink
Post by Newyana2
That's interesting. So in a way you're programming the editor
yourself, to whatever extent you find useful. I can see how that
would be appealing for a particular usage.
Or indeed, for all usages. A programmable machine is a universal machine.
Janis Papanagnou
2025-01-19 09:00:53 UTC
Permalink
Post by Lawrence D'Oliveiro
Post by Newyana2
That's interesting. So in a way you're programming the editor
yourself, to whatever extent you find useful. I can see how that
would be appealing for a particular usage.
Or indeed, for all usages. A programmable machine is a universal machine.
Given all the dreadful imaginations of the other poster about editors
we should emphasize that you don't need specialized programming to do
most of the complex editing functions. Personally I rarely program my
editor (Vim). But, of course, the scripting interface certainly also
makes it possible to support arbitrarily complex features. Or use just
some existing plug-in to support any special use case or higher level
functions. Or make use of other simple editor mechanisms (like macros)
to support own preferences or specific operations beyond the existing
(already powerful) basic editing features.

Janis
Marion
2025-01-19 21:16:24 UTC
Permalink
Post by Janis Papanagnou
all the dreadful imaginations of the other poster about editors
we should emphasize that you don't need specialized programming to do
most of the complex editing functions. Personally I rarely program my
editor (Vim). But, of course, the scripting interface certainly also
makes it possible to support arbitrarily complex features. Or use just
some existing plug-in to support any special use case or higher level
functions. Or make use of other simple editor mechanisms (like macros)
to support own preferences or specific operations beyond the existing
(already powerful) basic editing features.
+1 Agree.

We have a solution, which, if someone has a BETTER solution, I'm all ears.
The problem set is (& always was) to edit HTML templates in a single step.

Herbert Kleebauer proposed a solution, which nobody has been able to beat.
That working solution (that nobody yet can beat), has two components.

That 1st component brings up the users' editor of choice in one step.
The 2nd component is to make those edits, where this is the HTML template:

<HR>
<A HREF=https://www.amazon.com/s?k=foo+bar>(amazon) foo bar</A><P>
<A HREF=https://www.amazon.com/vine/vine-items?search=foo%20bar>(vine) foo bar</A><P>
<HR>

Has anyone yet proposed a solution of fewer steps than the following?
STEP 1. While viewing the "firefox file:///C:/sys/myurls.html" bookmark,
simply press "Control+U" to bring it up in your favorite editor
STEP 2. In that favorite editor, in as few steps as possible, change
CHANGE FROM: foo bar
CHANGE TO: laptop computer

What has anyone proposed that is SIMPLER (fewer steps) than this macro?
:'a,'bs/foo/laptop/g | 'a,'bs/bar/computer/g

That translates to from a to b, replace all instance of foo with laptop;
and do the same for bar by replacing it with computer (in a single macro).

What editor has anyone yet proposed which can do that in fewer steps?
Lawrence D'Oliveiro
2025-01-20 03:04:21 UTC
Permalink
... you don't need specialized programming to do most
of the complex editing functions.
I wonder, is it so many decades of conditioning by marketing departments
that constrains people to think in terms of market segments? So they
automatically think “this product is for marketing segment A, but I’m in
marketing segment B, so I don’t need it”?

In Emacs, most of the editor itself is written using the same programming
language you use for your own extensions. There is no “mode” or barrier or
wall (or extra-cost “addon”) to separate the situation of using the
existing code from that of creating and running your own. So switching
from one to the other is seamless: your code hooks into the same
invocation system, the same extensible help system, the same UI --
everything works the same for your code as for the built-in code.
Janis Papanagnou
2025-01-20 08:26:04 UTC
Permalink
Post by Lawrence D'Oliveiro
... you don't need specialized programming to do most
of the complex editing functions.
I wonder, is it so many decades of conditioning by marketing departments
that constrains people to think in terms of market segments? So they
automatically think “this product is for marketing segment A, but I’m in
marketing segment B, so I don’t need it”?
In Emacs, most of the editor itself is written using the same programming
language you use for your own extensions. [...]
I read: "GNU Emacs is written in C and provides Emacs Lisp, also
implemented in C, as an extension language."

Note that not all folks like functional programming in general or
specifically programming in Lisp-like languages.

In decades of using editors I could avoid to extend the powerful
basic editor functions by own editor-scripting. I think it's good
if the used editor is so powerful that you can avoid scripting;
makes it usable in any environment as it comes.

Janis
Lawrence D'Oliveiro
2025-01-21 04:47:30 UTC
Permalink
Post by Janis Papanagnou
Note that not all folks like functional programming in general or
specifically programming in Lisp-like languages.
ELisp is not a “functional programming” language. And like it or not, Lisp
has always been a cutting-edge language, with features not commonly found
in more conventional languages.

Consider that one of the Vim family, Neovim, I think it is, has decided
that the traditional Vim extension language isn’t good enough, so it has
adopted Lua as an extension language. At least it’s in the right
direction, but it still doesn’t have the power of Emacs.

Where is there an editor to compare with Emacs, with an extension language
that is not Lisp, yet is equally powerful? There isn’t one.
Janis Papanagnou
2025-01-21 06:41:49 UTC
Permalink
Post by Lawrence D'Oliveiro
Post by Janis Papanagnou
Note that not all folks like functional programming in general or
specifically programming in Lisp-like languages.
ELisp is not a “functional programming” language. And like it or not, Lisp
has always been a cutting-edge language, with features not commonly found
in more conventional languages.
Oh, I thought it would have something to do with Lisp because of the
chosen name. - And Wikipedia seems to support that; "Emacs Lisp is a
Lisp dialect made for Emacs."

(For discussion of programming languages; that's not the appropriate
newsgroups. I spare me a comment.)
Post by Lawrence D'Oliveiro
Consider that one of the Vim family, Neovim, I think it is, has decided
that the traditional Vim extension language isn’t good enough, so it has
adopted Lua as an extension language. At least it’s in the right
direction, but it still doesn’t have the power of Emacs.
I think it's better to use an existing script language in case any
tool wants to support scripting than to invent an own language.

Concerning Vim you can read it supports: "scripting languages (both
native and through alternative scripting interpreters such as Perl,
Python, Ruby, Tcl, etc.) including support for plugins". - Sounds
extremely flexible and powerful to me. And obviously also provides
choices for folks that don't like Elisp (or Lisp, or any scripting
language that is unknown to them).

But I anyway never felt the need to do any scripting [with script
languages] in Vim; it has (already natively) an extremely powerful
concept and editing feature set.
Post by Lawrence D'Oliveiro
Where is there an editor to compare with Emacs, with an extension language
that is not Lisp, yet is equally powerful? There isn’t one.
If the quote above is correct then Vim would clearly be such a
candidate. (It sounds even much better than what Emacs does with
its own implemented language dialect. - Not that I would care.)

(And in Vim you might not need Scripting that often as in Emacs?)[*]

I'm anyway not interested in starting or continuing the Editor War.
(And, to be honest, even less so with any "religious" fanatics that
we often find in Usenet.)[**]

Janis

[*] I recall someone in Usenet - it might even have been you? - showed
some Lisp-like code (15-20 lines, or so) for Emacs to support some new
function in Emacs. Vim supported that already natively.

[**] Personally I acknowledge that Emacs is a powerful editor; and it
even offers much more beyond editing. Concerning the _editing power_
I'd never trade Vim for Emacs, though. YMMV
Lawrence D'Oliveiro
2025-01-22 00:11:27 UTC
Permalink
Post by Lawrence D'Oliveiro
Post by Janis Papanagnou
Note that not all folks like functional programming in general or
specifically programming in Lisp-like languages.
ELisp is not a “functional programming” language. And like it or not,
Lisp has always been a cutting-edge language, with features not
commonly found in more conventional languages.
Oh, I thought it would have something to do with Lisp ...
Of course it does.
Concerning Vim you can read it supports: "scripting languages (both
native and through alternative scripting interpreters such as Perl,
Python, Ruby, Tcl, etc.) including support for plugins". - Sounds
extremely flexible and powerful to me.
Which of those languages can be used to write “plugins”? My feeling is,
none of them.
[*] I recall someone in Usenet - it might even have been you? - showed
some Lisp-like code (15-20 lines, or so) for Emacs to support some new
function in Emacs. Vim supported that already natively.
Was it the function to do word counts in HTML files? Where does Vim
support that natively?
Kenny McCormack
2025-01-22 13:13:54 UTC
Permalink
In article <vmqid8$varl$***@dont-email.me>,
Janis Papanagnou <janis_papanagnou+***@hotmail.com> wrote:
...
This is a strange question from someone who was elsethread advocating
an open, flexible editor interface (as Emacs or Vim have).
I think whoever posted the story about the guys in the photo editing group
hit the nail directly on the head.
--
The whole aim of practical politics is to keep the populace alarmed (and hence clamorous
to be led to safety) by menacing it with an endless series of hobgoblins, all of them imaginary.

H. L. Mencken
Marion
2025-01-22 19:54:21 UTC
Permalink
Post by Kenny McCormack
This is a strange question from someone who was elsethread advocating
an open, flexible editor interface (as Emacs or Vim have).
I think whoever posted the story about the guys in the photo editing group
hit the nail directly on the head.
Are you referring to a thread in this newsgroup perhaps?
<https://www.novabbs.com/computers/thread.php?group=alt.comp.os.windows-10>
Perhaps this specific thread maybe?
*How to edit HTML source file on Windows in one step (not two)?*
<https://www.novabbs.com/computers/article-flat.php?id=84218&group=alt.comp.os.windows-10#84218>

The original non-sidetracked goal was resolved by Herbert in this post:
<https://www.novabbs.com/computers/article-flat.php?id=84219&group=alt.comp.os.windows-10#84219>
Where that solution was further improved upon in this (& other) posts:
<https://www.novabbs.com/computers/article-flat.php?id=84220&group=alt.comp.os.windows-10#84220>
Which, generalized for any editor, is the following pseudocode example:
a. mozilla-based-browser.exe about:config
b. view_source.editor.external (change from the default of false to true)
c. view_source.editor.path C:\path\to\your\favorite\text\editor.exe
d. mozilla-based-browser.exe file:///C:/sys/bookmarks.html
e. Control+u

The proposed solution happened to use Firefox & the Windows gvim editor.
a. firefox.exe about:config
b. view_source.editor.external (change from the default of false to true)
c. view_source.editor.path C:\programs\editors\text\gvim.exe
d. firefox.exe file:///C:/sys/bookmarks.html
e. Control+u

But, later on, someone had asked about why anyone would want to use gVim.

I think the problem was that the person asking that didn't know about
regular expressions & hence he deprecated the use of regexp in editors.

That same person who deprecated regexp also said he had no idea why a
template would be useful when someone munches HTML code into useful links.

Later on, that same person who deprecated regexp also claimed to not
be aware that Notepad++ has wondrously powerful "xml" macro capabilities.
[C:\Program Files\Editors\Text\Notepad++\shortcuts.xml]

And, that same person advocated writing VBS code instead of simply using
the macros inherent in powerful editors such as Notepad, Emacs & Vim.

Yet, the most complex code that person could write, according to his own
claims, was a VBS script that did a simple word count (which, we all know,
can be accomplished with the wc macro in Vim, e.g., g+<control+G>.

The problem, as I saw it anyway, was that person stated that everything
he didn't know, he disliked - yet everything that he knew - he liked.

Which is fine - as everyone is welcome to their own opinions - but
his opinions were based only on what he did not know already existed.

Hence, he understood not a word of what the solution turned out to be.

An example that person was unable to understand was this one of changing
the "foo" & "bar" in the HTML template to something useful. For example:

CHANGE THIS TEMPLATE FROM:
<HR>
<A HREF=https://www.amazon.com/s?k=foo+bar>(amazon) foo bar</A><P>
<A HREF=https://www.amazon.com/vine/vine-items?search=foo%20bar>(vine) foo bar</A><P>
<HR>

CHANGE THAT TEMPLATE TO:
<HR>
<A HREF=https://www.amazon.com/s?k=windows+pc>(amazon) windows pc</A><P>
<A HREF=https://www.amazon.com/vine/vine-items?search=windows%20pc>(vine) windows pc</A><P>
<HR>

USING A REGEXP MACRO BELOW - which is described fully so as to add
value to every post so that everyone always benefits from every body.

qq
:%s/foo/windows/g<CR>
:%s/bar/pc/g<CR>
q

That efficient set of character inputs is fully described below:

qq: Starts recording a macro into register "q".
:%s/foo/windows/g<CR>: This line performs a global substitution.
% selects the entire file.
s initiates the substitution command.
foo is the pattern to be searched for.
windows is the replacement string.
/g replaces all occurrences of the pattern on the current line.
<CR> presses the Enter key to execute the command.
:%s/bar/pc/g<CR>: This line performs another global substitution,
replacing all instances of "bar" with "pc"
on the current line.
q: Stops recording the macro.

Once you've defined the macro, to use the macro:

Place the cursor on the line you want to modify.
Press @q to execute the recorded macro on the current line.

This macro will efficiently replace all occurrences of "foo"
with "windows" and "bar" with "pc" within the current line.

Note:
This macro only affects the current line.
To apply the macro to multiple lines, you can use visual mode
to select the desired lines and then execute the macro.

In summary, a working solution was proposed, but some people
didn't understand it (which is fine). One open item was there
doesn't seem to be a suitable platform-independent HTML editor.

Is there?
--
The goal is always to be purposefully helpful in adding value!
Marion
2025-01-23 04:29:17 UTC
Permalink
Post by Marion
Yet, the most complex code that person could write, according to his own
claims, was a VBS script that did a simple word count (which, we all
know, can be accomplished with the wc macro in Vim, e.g., g+<control+G>.
Remember, the code I linked to was doing a count of the words of text in
an HTML file, ignoring markup.
Oh. Thanks. I stand corrected. Me culpa.

I publicly apologize for deprecating the "wc" that you were discussing.

My mistake.

In my defense, I was concentrating on solving the problem, where writing a
VBS script to munge HTML wasn't likely to be the general purpose solution.

Back to the main topic, I think Herbert's general purpose solution works
for everyone on Mozilla-based web browsers, which is to define your
favorite HTML editor and then to bring it up in one step using Control+u.

In my case, that favorite editor is the venerable cross-platform gvim,
which, in my case, I've been using in some form or other for decades.

As described prior, I employ gvim macros to convert a template into a line
of HTML code for Amazon Vine orders <https://amazon.com/vine/about>.

That's my specific need - but - I'm always all about general purpose
solutions, where my proposal works as well for a platform-independent
browser-independent machine-independent global bookmarks.htm file.

I am currently using gvim, for example, to add to that bookmarks.htm file.
Each URL I want to add, I simply add it by copying & munging this template.
<HR>
<A HREF=https://foo.com/bar>foo bar</A><P>
<HR>

With this method, a single bookmarks.htm file is used by the whole system.
The editing capability of gvim allows me to munge that HTML to do that.

I even posted this article (and every Usenet post) using telnet & gvim,
since Marek Novotny (may he rest in peace) originally wrote my newsreader.

While gvim isn't intended to be an HTML editor, it would be nice to find a
free cross-platform simple-to-use yet powerful HTML editor for this task.

Does anyone have a suggestion for a good cross-platform free HTML editor?
Marion
2025-01-23 21:02:07 UTC
Permalink
Post by Marion
Does anyone have a suggestion for a good cross-platform free HTML editor?
Ha! You scandalous turncoat, you.
WTF?

What's needed for general use is a bookmarks file editor.
But we can start simpler than that, with a bookmarks file "appendor".

By that, I mean we can run a batch script to append a new bookmark
to the global bookmark file that works for all browsers, all platforms.

The input to that script is the easy part as that would be only 2 things:
1. The link (e.g., https://www.google.com/search?q=foo+bar)
2. The description of that link (my search)

That 'easy' part can be done with a Windows batch script:
@echo off
REM addbm.bat adds another link to the global bookmark file
setlocal
setlocal EnableDelayedExpansion

set bmfile=C:\path\to\bm.htm
echo.Global bookmark file is %bmfile%

:input
echo.Enter URL:
set /p "url="
echo.Enter Description:
set /p "description="

echo.Adding... %url% and %description%

:append_html
REM I need help escaping the angle brackets below!
REM echo.<A HREF="%url%">%description%</A><P> >> %bmfile%
REM echo.\<A HREF="%url%"\>%description%\<\/A\>\<P\> >> %bmfile%
REM echo.^<^A HREF="%url%"^>^%description%^<^/A^>^^<P^>^ >> %bmfile%

This works but I had to replace angle brackets with square brackets:
echo.[A HREF="%url%"]%description%[/A][P] >> %bmfile%

echo.%url% of %description% added to %bmfile%
pause
endlocal

My main problem above is simply I can't figure out (yet) how to
escape the angle brackets "<" & ">" in the echo command.

Anyone know how to escape those angle brackets in a batch script?
Marion
2025-01-23 22:18:24 UTC
Permalink
Post by Marion
Anyone know how to escape those angle brackets in a batch script?
I solved that problem so that everyone can benefit from this simple batch
script, which you can tie to your Win+R runbox pinned to your taskbar:
Taskbar:Runbox > addbm
Where in the Registry you have added the "addbm.exe" key below:
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\
addbm.exe = C:\path\to\addbm.bat

And where the addbm.bat file contains the following working code:

@echo off
REM addbm.bat adds another link to the global bookmark file
setlocal
setlocal EnableDelayedExpansion

set bmfile=C:\path\to\global\bookmarks\bm.htm
echo.Global bookmark file is %bmfile%

:input
echo.Enter URL:
set /p "url="
echo.Enter Description:
set /p "description="

echo.Adding... %url% and %description% to the global bookmarks file

:append_html
echo.^<A HREF="%url%"^>%description%^</A^>^<P^> >> %bmfile%
echo.%url% of %description% added to the global bookmark file %bmfile%
pause

REM What would be nice is to bring up a simple HTML editor also
set editor=gvim
%editor% %bmfile%

endlocal

Please improve so that billions of people can benefit from this script
which appends a new URL & description to the users' global bookmarks.
Frank Miller
2025-01-23 23:25:01 UTC
Permalink
Marion wrote:
[..snip..]
Post by Marion
Please improve so that billions of people can benefit from this script
which appends a new URL & description to the users' global bookmarks.
WOW!I'm really impressed! That's a new level of super egocentric hubris.
Tried that right now on my Linux-System and it didn't do *anything*!
A really crappy programmed script.
Marion
2025-01-23 23:35:01 UTC
Permalink
Post by Frank Miller
Post by Marion
Please improve so that billions of people can benefit from this script
which appends a new URL & description to the users' global bookmarks.
WOW!I'm really impressed! That's a new level of super egocentric hubris.
Tried that right now on my Linux-System and it didn't do *anything*!
A really crappy programmed script.
Funny you mention what I was working on for my dual-boot desktop PC...

It's not done yet, but even though the linux newsgroups were NOT on the
newsgroups list, since you complained that the script worked for only
Windows users, here's an unfinished yet equivalent Linux Bash script, which
I'm sure you will certainly test for the team since you are a purposefully
helpful poster, Frank Miller.

Please post back with your comments on how well it worked in your tests.
Thanks!

#!/bin/bash

# 1. Set your preferred text or HTML editor
editor="vi" # Replace with your preferred editor (e.g., nano, vim)

# 2. Set the location of your global bookmark HTML file
bmfile="/path/to/your/bookmarks/file/bm.htm" # Replace with the path

echo "Global bookmark file is $bmfile"

read -p "Enter URL: (e.g., https://amazon.com/vine/about) " url
read -p "Enter Description: (e.g., Amazon Vine Program) " description

echo "Adding... \"$url\" as \"$description\""

echo "<A HREF=\"$url\">$description</A><P>" >> "$bmfile"
echo "\"$url\" as \"$description\" added to \"$bmfile\""

read -p "Do you want to edit the global bookmark file? [y/n] " choice

if [[ $choice == "y" || $choice == "Y" ]]; then
echo "Editing file: $bmfile"
$editor "$bmfile"
elif [[ $choice == "n" || $choice == "N" ]]; then
echo "File editing canceled."
fi

read -p "Press Enter to continue..."
--
Lawrence D'Oliveiro
2025-01-23 23:48:11 UTC
Permalink
Post by Marion
# 1. Set your preferred text or HTML editor
editor="vi" # Replace with your preferred editor (e.g., nano, vim)
Why not use the standard EDITOR or VISUAL environment variables? That’s
what they’re for.
Marion
2025-01-24 00:48:58 UTC
Permalink
Post by Marion
# 1. Set your preferred text or HTML editor
editor="vi" # Replace with your preferred editor (e.g., nano, vim)
Why not use the standard EDITOR or VISUAL environment variables? That�s
what they�re for.
Good idea! Thanks for the improvement! Much appreciated. Will do!

I'm currently busy writing a more complicated version of the bookmarks
batch file that creates the Vine & Amazon links, which is far more
difficult because I have to convert the spaces in Windows to plus signs (+)
for Amazon search links, and to %20 characters for Vine search links.

<A HREF=https://amazon.com/s?k=gas+camp+stove>[amazon] gas camp stove</A><P>
<A HREF=https://amazon.com/vine/vine-items?search=gas%20camp%20stove>[vine] gas camp stove</A><P>

Here's a snippet of how difficult it was to do in Windows, where we'd just
use sed/awk/grep on Linux to convert the spaces to those characters.

:input_item
echo.Enter search item: ; for example, gas camp stove
set /p "item="

:replace_spaces_with_+
set "amazon_item=%item: =+%"

:replace_spaces_with_%20
set "vine_item="
for %%a in (%item%) do (
if "%%a"=="" (
set "vine_item=!vine_item!%%20"
) else (
if defined vine_item (
set "vine_item=!vine_item!%%20"
)
set "vine_item=!vine_item!%%a"
)
)

echo Original item: %item%
echo Amazon item: %amazon_item%
set vine_item=!vine_item!
echo Vine item: %vine_item%
echo.Adding... "%amazon_item%" and "!vine_item!" to %vinefile

It's not lost on me (nor on you, I'm sure) how miserable this task is on Windows.
Janis Papanagnou
2025-01-24 10:30:03 UTC
Permalink
Post by Marion
Post by Lawrence D'Oliveiro
Post by Marion
# 1. Set your preferred text or HTML editor
editor="vi" # Replace with your preferred editor (e.g., nano, vim)
Why not use the standard EDITOR or VISUAL environment variables?
That�s what they�re for.
Good idea! Thanks for the improvement! Much appreciated. Will do!
Just note that these variables may not (or not all) be defined.
(In my environment, for example, $EDITOR is empty, but $VISUAL
is set.) - Typically, applications check them sequentially and
provide a default (as you've done) [only] if none is set.

Janis
Post by Marion
[...]
Frank Miller
2025-01-23 23:49:52 UTC
Permalink
Post by Marion
Post by Frank Miller
Post by Marion
Please improve so that billions of people can benefit from this script
which appends a new URL & description to the users' global bookmarks.
WOW!I'm really impressed! That's a new level of super egocentric hubris.
Tried that right now on my Linux-System and it didn't do *anything*!
A really crappy programmed script.
Funny you mention what I was working on for my dual-boot desktop PC...
It's not done yet, but even though the linux newsgroups were NOT on the
newsgroups list, since you complained that the script worked for only
Windows users, here's an unfinished yet equivalent
[..snip..]

You didn't read the part of "super egocentric hubris" in relation to
"billions of people can benefit from this script" - did you?
You have a sense of satire or cynicism? Doesn't seem so.
Janis Papanagnou
2025-01-24 09:40:15 UTC
Permalink
Post by Marion
Post by Frank Miller
Post by Marion
Please improve so that billions of people can benefit from this script
which appends a new URL & description to the users' global bookmarks.
WOW!I'm really impressed! That's a new level of super egocentric hubris.
Yeah, that's what made me laugh when I read it; imagining "billions"
of MS *.bat programmers.
Post by Marion
Post by Frank Miller
Tried that right now on my Linux-System and it didn't do *anything*!
A really crappy programmed script.
Funny you mention what I was working on for my dual-boot desktop PC...
It's not done yet, but even though the linux newsgroups were NOT on the
newsgroups list, since you complained that the script worked for only
Windows users, here's an unfinished yet equivalent Linux Bash script, [...]
It would be yet more useful if you'd not have restricted your script
to Bash and Linux. The script is so primitive (i.e. it has no special
features) that it can be written in standard shell for any standard
Unix.

Hints: use no "read -p" and no "[[...]]". And I'd replace 'echo' by
'printf' for a good measure (and also less [unnecessary] escaping).

Janis
Marion
2025-01-24 18:03:06 UTC
Permalink
Post by Janis Papanagnou
Post by Marion
Post by Frank Miller
WOW!I'm really impressed! That's a new level of super egocentric hubris.
Yeah, that's what made me laugh when I read it; imagining "billions"
of MS *.bat programmers.
Hi Janis,

Amazon told me they only select one out of a million of their customers to
be invited to the Amazon Vine program, so I'm not normal in that sense.

Your point is well taken that I have higher hopes to help more people than
others feel can be helped - which is a valid criticism of anyone who is
trying to buck the fiasco that is currently how web browsers do bookmarks.

In my (mathematical) defense, I presume all of you must be aware that there
is the concept of the TAM (but maybe nobody here took Marketing 101?).

The TAM is one of the first things you look at for any new solution
(in this case, a solution to the current misguided browser bookmarks
offering that Mozilla & Chrome-based browsers all errantly employ).

The TAM on solving this trainwreck of web-browser bookmarks debacles
is huge, but at the same time I note that web-browser developers are
shockingly clueless how bookmarks 'should' work; as are most users.

Most users have no clue that there should only be a single bookmark file.
It's beyond their comprehension to THINK about things philosophically.

And no browser developer wants anyone to be able to have one file either.
It's not in browser developers' interest to supply what everyone needs.

Browser developers are desperate to lock people into their specific use
model (much like Apple does for almost anything in their product line).

It takes an uncommonly intelligent person to buck powerful MARKETING.

Given one has to be aware enough first to understand the huge problem we
fact, where I feel only the most intelligent and/or philosophically
enlightened people will own the ability to see the value of a single
bookmarks file for all web browsers on all platforms (for any given user).

I was hoping 1 or 2 of those rare enlightened few would be here. :)
Post by Janis Papanagnou
Post by Marion
Post by Frank Miller
Tried that right now on my Linux-System and it didn't do *anything*!
A really crappy programmed script.
Funny you mention what I was working on for my dual-boot desktop PC...
It's not done yet, but even though the linux newsgroups were NOT on the
newsgroups list, since you complained that the script worked for only
Windows users, here's an unfinished yet equivalent Linux Bash script, [...]
It would be yet more useful if you'd not have restricted your script
to Bash and Linux. The script is so primitive (i.e. it has no special
features) that it can be written in standard shell for any standard
Unix.
Hints: use no "read -p" and no "[[...]]". And I'd replace 'echo' by
'printf' for a good measure (and also less [unnecessary] escaping).
If you look at the time stamps, I hacked out that script in less than five
minutes, so while I accept all criticism, I'm focusing on Windows first.

Once I have everything working on Windows, I can port to Linux & Android.

At the moment, here's the latest Windows script to edit browser bookmarks,
where working suggestions for improvements are always welcome because the
goal, always, is to add value to every post so that everyone benefits.

Solving the horrid browser-bookmark debacle is a team effort after all!
Luckily, the browser bookmark script was MUCH EASIER than the Vine script.

@echo off
REM 20240124 addbm.bat appends links to the global bookmark file
setlocal
setlocal EnableDelayedExpansion

REM Action#1 set your favorite text HTML editor
REM set editor=notepad++
set editor=gvim

REM Action#2 set the location of your global bookmarks file
set bmfile=C:\path\to\your\global\bookmark\file\bm.htm
if not exist "%bmfile%" (
echo.The file "%bmfile%" does not exist. Exiting...
goto :end
) else (
echo.Global bookmark file is %bmfile%
)

:input_html
echo.Enter URL: ; for example, https://amazon.com/vine/about
set /p "url="
echo.Enter Description: ; for example, Amazon Vine Program
set /p "description="

echo.Adding... "%url%" as "%description%"

:append_html
echo.^<A HREF="%url%"^>%description%^</A^>^<P^> >> %bmfile%
echo."%url%" as "%description%" added to "%bmfile%"

set /p repeat=Do you want to add another browser bookmark? [y/n]:
if %repeat%== y goto input_html
if not %repeat%== y goto edit_html

:edit_html
echo Do you want to edit the global bookmark file? [y/n]
set /p "choice="
if /i "%choice%"=="y" (
echo Editing file: %bmfile%
%editor% %bmfile%
) else if /i "%choice%"=="n" (
echo File editing canceled.
)

:end
pause
endlocal
exit /B 0
--
This is intended to be a web-findable resource for future users.
Marion
2025-01-24 18:14:05 UTC
Permalink
Post by Marion
Amazon told me they only select one out of a million of their customers to
be invited to the Amazon Vine program, so I'm not normal in that sense.
Oops. Too many zeros. One out of about ten-thousand customers. My bad.
While we're correcting mistakes, here's the Vine script for all to benefit.

The miserable part was escaping all the special characters in the URIs.

@echo off
REM 20240124 addvine.bat adds Amazon/Vine search links to global HTML
setlocal
setlocal EnableDelayedExpansion

REM #1 set your favorite text HTML editor
REM set editor=notepad++
set editor=gvim

REM #2 set the location of your global vine search file
set vinefile=C:\path\to\your\global\search\link\html\file\vine.htm
if not exist "%vinefile%" (
echo.The file "%vinefile%" does not exist. Exiting...
pause
goto :END
) else (
echo.Global Vine HTML search file is %vinefile%
)

:input_item
echo.Enter search item: ; for example, gas camp stove
set /p "item="

:replace_spaces_with_+
set "amazon_item=%item: =+%"

:replace_spaces_with_%20
set "vine_item="
for %%a in (%item%) do (
if "%%a"=="" (
set "vine_item=!vine_item!%%20"
) else (
if defined vine_item (
set "vine_item=!vine_item!%%20"
)
set "vine_item=!vine_item!%%a"
)
)

echo Original item: %item%
echo Amazon item: %amazon_item%
set vine_item=!vine_item!
echo Vine item: %vine_item%
echo.Adding... "%amazon_item%" and "!vine_item!" to %vinefile%

:append_html
echo.^<HR^> >> %vinefile%
echo.^<A HREF=https://amazon.com/vine/vine-items?search=%vine_item%^>[vine] %item%^</A^>^<P^> >> %vinefile%
echo.^<A HREF=https://amazon.com/s?k=%amazon_item%^>[amazon] %item%^</A^>^<P^> >> %vinefile%
echo.^<HR^> >> %vinefile%

set /p repeat=Do you want to add another search term? [y/n]:
if %repeat%== y goto input_item
if not %repeat%== y goto edit_html

:edit_html
echo Do you want to edit the global vine HTML file? [y/n]
set /p "choice="
if /i "%choice%"=="y" (
echo Editing file: %vinefile%
%editor% %vinefile%
) else if /i "%choice%"=="n" (
echo File editing canceled.
)

END:
endlocal
exit /B 0
--
As always, this is to help others now, and far into the future.
Janis Papanagnou
2025-01-25 13:22:57 UTC
Permalink
[...]
I wanted to answer per email but got an error.

Janis
Carlos E.R.
2025-01-25 13:39:39 UTC
Permalink
Post by Janis Papanagnou
[...]
I wanted to answer per email but got an error.
An email to Marion, aka Arlen? All his addresses are faked.
--
Cheers, Carlos.
Janis Papanagnou
2025-01-25 16:48:44 UTC
Permalink
Post by Carlos E.R.
Post by Janis Papanagnou
[...]
I wanted to answer per email but got an error.
An email to Marion, aka Arlen? All his addresses are faked.
Ah, didn't know. - Thanks.

(I think my email isn't appropriate for above newsgroups, so I
spare a post of the email contents here.)

Janis

Lawrence D'Oliveiro
2025-01-23 23:46:18 UTC
Permalink
... VSCode. It's free, cross-platform and probably less than 2 GB.
Is that the bar for what might be considered a “svelte” or “petite”
package nowadays?

***@theon:~> du -ks /usr/*/emacs*/ /usr/*/*/emacs*/
16988 /usr/lib/emacs/
68 /usr/lib/emacsen-common/
15660 /usr/libexec/emacs/
105452 /usr/share/emacs/
12 /usr/share/emacsen-common/
8 /usr/local-orig/share/emacs/
8 /usr/local/share/emacs/
52 /usr/share/doc/emacs/
52 /usr/share/doc/emacs-bin-common/
72 /usr/share/doc/emacs-common/
52 /usr/share/doc/emacs-el/
24 /usr/share/doc/emacsen-common/
96 /usr/share/info/emacs/
Carlos E.R.
2025-01-16 14:05:21 UTC
Permalink
    I just tried Vim for the
first time. It looks like a relic from 1980, without even support for
non-fixed-width fonts. Really? That's your favorite editor? Few people
actually hand-code HTML anymore, but there must still be decent
editors around.
Vim is certainly ancient (it is a clone of 'vi'), but it is actively
developed. It is designed for Linux/Unix (all linuxes and unixes have it
by default), and it has tons of features, but you have to be accustomed
to it in order to profit from them.

It is a plain text editor, not a word processor. It makes no use of
proportional fonts, that would be ridiculous. Many programmers use and
love it, and will have you shot if you dare criticizing it :-P
--
Cheers, Carlos.
Newyana2
2025-01-16 16:08:56 UTC
Permalink
Post by Carlos E.R.
     I just tried Vim for the
first time. It looks like a relic from 1980, without even support for
non-fixed-width fonts. Really? That's your favorite editor? Few people
actually hand-code HTML anymore, but there must still be decent
editors around.
Vim is certainly ancient (it is a clone of 'vi'), but it is actively
developed. It is designed for Linux/Unix (all linuxes and unixes have it
by default), and it has tons of features, but you have to be accustomed
to it in order to profit from them.
It is a plain text editor, not a word processor. It makes no use of
proportional fonts, that would be ridiculous. Many programmers use and
love it, and will have you shot if you dare criticizing it :-P
Indeed. People can be quite irrational in their attachment to
the past, like a man who insists on making a campfire to cook
his dinner because "that's how we did it growing up". But it
gets more irrational when people make excuses to claim that
their campfire works better than a stove. The Internet is loaded
with such editors, that are deliberately designed not to have
any conveniences. In fact, I've noticed a new fashion of white
on black GUI, trying to make all windows look like console. But
I don't know if it's the old men or the kids who are promoting
that fad. (My own cmd.exe is set to a white window with dark
brown text. There's no actual reason that it needs to look like
a DOS screen out of 1990.)

Forcing only fixed-width fonts, though, is something I've never
seen before. I use Notepad for plain text editing and my own
editor for HTML. In both I use Verdana because it's clear for
reading and wide enough to easily see typos. Neither plain text
nor code requires fixed-width.

I'm imaging two cranky old men. One proclaims that he will
only eat food from a campfire. The other teases him for using
matches instead of rubbing sticks together.

None of this has anything to do with actually coding HTML,
which would make sense to do in an editor designed for the job.
Arlen is talking about writing automations in gvim to convert
UTF-8 to ANSI text, or writing BAT files to automate editing a
simple HTML file. So our two campfire buddies are not even
actually cooking their dinner. They just like to feel rustic. :)
Carlos E.R.
2025-01-16 22:03:16 UTC
Permalink
Post by Carlos E.R.
     I just tried Vim for the
first time. It looks like a relic from 1980, without even support for
non-fixed-width fonts. Really? That's your favorite editor? Few people
actually hand-code HTML anymore, but there must still be decent
editors around.
Vim is certainly ancient (it is a clone of 'vi'), but it is actively
developed. It is designed for Linux/Unix (all linuxes and unixes have
it by default), and it has tons of features, but you have to be
accustomed to it in order to profit from them.
It is a plain text editor, not a word processor. It makes no use of
proportional fonts, that would be ridiculous. Many programmers use and
love it, and will have you shot if you dare criticizing it :-P
   Indeed. People can be quite irrational in their attachment to
the past, like a man who insists on making a campfire to cook
his dinner because "that's how we did it growing up". But it
gets more irrational when people make excuses to claim that
their campfire works better than a stove. The Internet is loaded
with such editors, that are deliberately designed not to have
any conveniences. In fact, I've noticed a new fashion of white
on black GUI, trying to make all windows look like console. But
I don't know if it's the old men or the kids who are promoting
that fad. (My own cmd.exe is set to a white window with dark
brown text. There's no actual reason that it needs to look like
a DOS screen out of 1990.)
   Forcing only fixed-width fonts, though, is something I've never
seen before.
Coding has to be done with monospace fonts. If you are not, then you are
doing it wrong™.
I use Notepad for plain text editing and my own
editor for HTML. In both I use Verdana because it's clear for
reading and wide enough to easily see typos. Neither plain text
nor code requires fixed-width.
  I'm imaging two cranky old men. One proclaims that he will
only eat food from a campfire. The other teases him for using
matches instead of rubbing sticks together.
   None of this has anything to do with actually coding HTML,
which would make sense to do in an editor designed for the job.
Arlen is talking about writing automations in gvim to convert
UTF-8 to ANSI text, or writing BAT files to automate editing a
simple HTML file. So our two campfire buddies are not even
actually cooking their dinner. They just like to feel rustic. :)
You can dislike vim, but there are millions of happy vi(m) users,
because it is actually very powerful for plain text tasks like coding.
Many of those millions are actually kids.

And no, I am not a vim user. I some times *have* to use it, though, so I
know the minimal.
--
Cheers, Carlos.
Marion
2025-01-24 01:07:36 UTC
Permalink
For everyone to benefit who cares about creating a search HTML bookmark that
will create clickable links to any desired search engines, below is my latest
attempt at appending to a dual global Amazon/Vine search bookmarks file.

Note that the syntax for a purely Amazon search is the following:
<A HREF=https://amazon.com/s?k=gas+camp+stove>[amazon] gas camp stove</A><P>

Note that the syntax for any specific Amazon Vine search is the following:
<A HREF=https://amazon.com/vine/vine-items?search=gas%20camp%20stove>[vine] gas camp stove</A><P>

It was a pain getting the angle brackets escaped in the Windows batch
file but that was nothing in effort compared to the way Amazon does things
where there are plus signs ("+") and %20 characters in real search terms.

Specifically, it was most miserable getting the Vine %20 to be escaped.

Having figured it out today, the advantage of me kind-heartedly generously
posting my results for you to benefit from is that you can munge what I
provide below to fit any search engine terms that you need to add for
your own global bookmarks search file (which everyone should have).

That makes all my effort writing this leveraged to everyone out there.
As always, please test & improve so that everyone benefits from every post.

@echo off
REM addvine.bat adds amazon & vine search links to a global Vine html file
setlocal
setlocal EnableDelayedExpansion

REM #1 set your favorite text HTML editor
REM set editor=notepad++
set editor=gvim

REM #2 set the location of your global vine search file
set vinefile=C:\path\to\your\global\search\file\vine.htm
echo.Global vine HTML search file is %vinefile%

:input_item
echo.Enter search item: ; for example, gas camp stove
set /p "item="

:replace_spaces_with_+
set "amazon_item=%item: =+%"

:replace_spaces_with_%20
set "vine_item="
for %%a in (%item%) do (
if "%%a"=="" (
set "vine_item=!vine_item!%%20"
) else (
if defined vine_item (
set "vine_item=!vine_item!%%20"
)
set "vine_item=!vine_item!%%a"
)
)

echo Original item: %item%
echo Amazon item: %amazon_item%
set vine_item=!vine_item!
echo Vine item: %vine_item%
echo.Adding... "%amazon_item%" and "!vine_item!" to %vinefile%

:append_html
echo.^<A HREF=https://amazon.com/s?k=%amazon_item%^>[amazon] %item%^</A^>^<P^> >> %vinefile%
echo.^<A HREF=https://amazon.com/vine/vine-items?search=%vine_item%^>[vine] %item%^</A^>^<P^> >> %vinefile%

:edit_html
echo Do you want to edit the global vine HTML file? [y/n]
set /p "choice="
if /i "%choice%"=="y" (
echo Editing file: %vinefile%
%editor% %vinefile%
) else if /i "%choice%"=="n" (
echo File editing canceled.
)

pause
endlocal
--
Loading...