I can imagine another way of handling the whole problem, if my
previous
assumptions are correct. We could write sort of pre-python-code,
which is
manipulated by our code cleaner script afterwards. Inside this code
we could
write normal python code and mark the endings of code blocks
syntactically
with 'end' as in pascal for instance. Just a hack, but perhaps that
works.
All of those sorts of things are doable. I even think I vaguely
remember some kind of *alternative* to indenting code, but all this
presupposes that you've written it yourself. As I pointed out in an
earlier post to this thread, if you've written the code yourself,
it's nowhere near as bad, but all of it falls appart as soon as
you're trying to read module code or something that other people've
written.
But I really think it would be better to write an applescript which
determines
the number of blank characters and spits them out using via voice.
Any ideas how to get the displayed string of the line where the
cursor or
something similar is located from within an editor?
Do you know how to count bpossible blank characters at the
beginning of the
line?
Which line of applescript-code hands over a new string containing the
information about the number of blank characters to voice over?
And how is it possible to disable the default behaviour of reading
lines
and enable the code of our non-existing applescript temporarily?
Maybe someone knows the answers to these questions or knows someone
who knows
them :-)
Perhaps I forgot something or made a mistake while thinking about it.
As I think I also pointed out, I really hadn't gotten that far in
thinking about it. I haven't actually had to do any significant
work in python for quite some time, and so the issue kind of fell
into my "interesting too look at later" bucket.
I *did* have some ideas, though. As far as the speech bit goes, I
wasn't actually planning on trying to do what emacspeak does and
speak the indent level while moving down each line. For a start, I
don't actually think you can do much manipulation of VO that way. In
other words, I don't think you *can* override the speak line code.
What I was planning on doing was just having a hotkey that would tell
you how many characters the line was indented by, probably using
whatever the applescript equivalent of the say commandline program
is. Not that I even know if *that* exists, but I think it probably does.
As for the rest, I honestly don't know, which is why it was on my
backburner project list. Even though I'm a developer, I often find
that applescript has a tendency to give me a headache. It also has
the unfortunate problem that it often depends on what the application
you're scripting exposes. In other words, applescript ends up being
very application specific a lot of the time, so I think you'd havve
to try a couple of different editors before you found one that you
could get to do what you wanted.
Anyway, that's about all I've thought of. It's not even 9 o'clock in
the morning here, though, so my brain may be malfunctioning a bit,
<grin>.