Re: Re: Re: use monospaced still there
Philippe Lhoste <PhiLho <at> gmx.net>
2004-07-06 10:49:06 GMT
> ... by the fact that scripts are for programemrs, not for users. ;)
> *nix folks may see this differently, but IMHO configuring basic
> options should not be a programming task.
>
> Bruce, I saw your posting and I noticed you had a script, but
> anything that just sounds Luaish is skipped here immediately ... I
> do a lot of HTML stuff, mostly with Homesite, but quick edits in
> SciTE, and out of necessity I scratch the surface of Javascript,
> Python and, most recently, PHP using SciTE, but getting into even
> one more programming or scripting language just to configure the
> editor is something I really do not need ... For me and my needs
> an editor is a tool like a hammer that should work without first
> needing another degree (usual learning curve aside). IOW my aim
> is producing content, not becoming or being a programmer.
I fully understand your point of view, as I keep repeating I wish to
learn some other languages, like Python, but just don't have the time to
do so (and perhaps the motivation? I started to learn PHP, but it can be
useful in my future job, and I currently spend quite some time on SVG,
but I like vector graphics...).
Well, my arguments aren't the same as your, but it reduces down to one
point: one has only limited time.
That said, Lua is nice and simple, and Lua use in SciTE is probably even
more simple. If you ever have the slightest wish/need to take a look,
don't hesitate, it is very easy to learn.
But of course, you have to spend some hours for that, nothing is really
free, if you don't pay with money, you pay with time...
That said, sometime using a simple script can save quite some time in
hand editing. For example, to reduce floating point precision of
coordinates pairs in a SVG file, I just wrote some lines (I added
formating and comments for you
It was smaller and faster to type!):
function ReduceFPP()
-- Read current selection
local text, len = editor:GetSelText()
-- Search FP number pairs separated by comas
-- and provide them to a function that round them
-- and spit them out to replace orignal values
text = string.gsub(text, "([.%d]+),([.%d]+)",
function (n1, n2)
return math.floor(n1*10 + 0.5)/10 .. ',' ..
math.floor(n2*10 + 0.5)/10
end)
-- Replace current selection with modified text
editor:ReplaceSel(text)
end
I also used this to translate coordinates, etc.
You can use similar code to renumber a series of numbers, reformat HTML
code, convert high Ascii to entities, etc.
And even if you are not a programmer, you can easily use scripts
provided by others, you just have to set up some bindings to call them.
I don't try to evangelize you
of course. Just to say that scripting
is good, even for non-programmers (and you already have programming
basics anyway...).
Regards.
--
--
--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist
http://Phi.Lho.free.fr
--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--