Discussion:
new indentation in context
Adam Duck
2005-03-11 16:03:17 UTC
Permalink
Hi,

while filing a bug report to the ConTeXt-ML I discovered a bug in the
new indentation-code. I have this code:

--- ConTeXt code ---

\setupFLOWcharts[offset=50pt]

\startFLOWchart[test]

\startFLOWcell
\name{one}
\location{1,1}
....

--- end ---

as you can see, there should be no indentation after a "\setup.*" or
"\define.*", and after "\define.*" there isn't. The funny thing is:
every line with a \setup-command gets indented -2 chars and the
following line +2 (so you don't see it if you have more than one line
of \setup-commands).

bye, Adam.
Ralf Angeli
2005-03-11 22:04:07 UTC
Permalink
Post by Adam Duck
while filing a bug report to the ConTeXt-ML I discovered a bug in the
--- ConTeXt code ---
\setupFLOWcharts[offset=50pt]
\startFLOWchart[test]
\startFLOWcell
\name{one}
\location{1,1}
....
--- end ---
as you can see, there should be no indentation after a "\setup.*" or
every line with a \setup-command gets indented -2 chars and the
following line +2 (so you don't see it if you have more than one line
of \setup-commands).
Well, that's actually a feature. According to code I didn't change
with the last check-in, \setup... commands should be treated like
\item commands.

What are \setup... commands for and how are they used? (I tried to
download that 2.4MB monster of a ConTeXt manual from pragma-ade.nl,
but this is not really fun via a 56k connection, especially if the
modem hangs up after one MB.)
--
Ralf
Adam Duck
2005-03-11 23:15:15 UTC
Permalink
Post by Ralf Angeli
Well, that's actually a feature. According to code I didn't change
with the last check-in, \setup... commands should be treated like
\item commands.
Well, that's nice for \item because you now they end after
\stopitemize, so you can easily indent correctly. However, for
\setup*-commands, this is not true.
Post by Ralf Angeli
What are \setup... commands for and how are they used? (I tried to
download that 2.4MB monster of a ConTeXt manual from pragma-ade.nl,
but this is not really fun via a 56k connection, especially if the
modem hangs up after one MB.)
I'm sorry to hear that, so ... If you have something like this:

\startitemize[n]
\item hello
\item test
\stopitemize

you can setup this itemization with

\setupitemize[1][packed][symbol=a]

this means itemization at level 1 should be tightly packed and the
"bullets" should be "a", "b", and so on (which, in this example would
be superseded by the "n" and therefore become "1", "2", and so on).
It's more like \renewcommand in LaTeX and therefore the next lines
should not be indented like \items but differently, because you can
write code like this:

\setupitemize[1][packed]
[symbol=a]


Btw, I managed to pinpoint my problems with `transient-mark-mode'. It
seemed to be my call to "(icomplete-mode)" in my init-files. Which is
strange, but it works now. Actually, I even don't know what it's for
because I do have iswitchb, which is all I want.

bye, Adam.
Ralf Angeli
2005-03-11 23:57:56 UTC
Permalink
Post by Adam Duck
Post by Ralf Angeli
Well, that's actually a feature. According to code I didn't change
with the last check-in, \setup... commands should be treated like
\item commands.
Well, that's nice for \item because you now they end after
\stopitemize, so you can easily indent correctly. However, for
\setup*-commands, this is not true.
[...]
Post by Adam Duck
It's more like \renewcommand in LaTeX and therefore the next lines
should not be indented like \items but differently, because you can
Ah, okay, thanks for the explanation. In case you need a quick
remedy, you can put

(setq ConTeXt-indent-item-re "\\\\\item\\>")

into your init file. I'll check if this would be the correct way to
handle this in context.el as soon as I find some time (not this
weekend, though).
Post by Adam Duck
Btw, I managed to pinpoint my problems with `transient-mark-mode'. It
seemed to be my call to "(icomplete-mode)" in my init-files. Which is
strange, but it works now. Actually, I even don't know what it's for
because I do have iswitchb, which is all I want.
Okay, with icomplete-mode I can reproduce this. It is doing something
funny with the marked region. For example in LaTeX mode the marked
region stays highlighted for about one second.
--
Ralf
Loading...