# What is the correct way to end a hanging indent section in Context?

In an earlier question I got help to get hanging indents working in my text.

I now suspect that I've not been terminating the hanging indent in the right way. Have tried some different things, but still can't get back the regular indent after the hanging indent section.

Looking forward to any clues!

\setuppapersize[A5]
\starttext

\everypar{\hangafter=1\hangindent=1em\relax} % Comment out this line and it works

\subject{Section with hanging indent}

Jaynes, Julian. {\os 1990}.
{\em The Origin of Consciousness in the
Breakdown of the Bicameral Mind}. New York City: Houghton Mifflin Company.

Pye, David. {\os 1995}. {\em The Nature and Art of Workmanship}.
London: The Herbert Press.

\everypar{\hangafter=0\relax} % Comment out this line and it works

\setupindenting[yes, next, 9mm]
\subject{Section with regular identing}
I would expect this line to begin at the margin,
not having an indent \ldots\ and so is the case, but only
if I delete the above {\em Section with hanging indent}.

This next paragraph would be intented.
\stoptext

-
In general, do not use \everypar in ConTeXt. Use \EveryPar instead. –  Aditya Mar 14 '13 at 12:32
See also this question regarding \everypar versus \EveryPar. –  PetaspeedBeaver Mar 25 '13 at 23:06

still can't get back the regular indent after the hanging indent section.

Firstly, if you want to stick with your workaround, you should make the modifications to indentation local. To do so, just wrap them into a group:

\setuppapersize[A5]
\starttext

\bgroup
\everypar{\hangafter=1\hangindent=1em\relax}

\subject{Section with hanging indent}

Jaynes, Julian. {\os 1990}.
{\em The Origin of Consciousness in the
Breakdown of the Bicameral Mind}. New York City: Houghton Mifflin Company.

Pye, David. {\os 1995}. {\em The Nature and Art of Workmanship}.
London: The Herbert Press.

\everypar{\hangafter=0\relax}
\egroup

\setupindenting[yes,first, 9mm]
\subject{Section with regular identing}
I would expect this line to begin at the margin,
not having an indent \ldots\ and so is the case, but only
if I delete the above {\em Section with hanging indent}.

This next paragraph would be intented.
\stoptext


This way the original indentation behavior should return.

However, may I suggest you use the high-level Context interface instead? The inverted indentation can be achieved by combining a couple ordinary macros (at least as far as the example you gave is concerned), and the code certainly looks a bit more idiomatic. I’ll call the environment negindent for “negative indentation”.

\definestartstop [negindent] [
before={%
\startnarrower[left]%
\setupindenting[-\leftskip,yes,first]%
},
after=\stopnarrower,
]

\setuppapersize[A5]

\starttext
\startnegindent % ····················································%
\subject{Section with hanging indent}

Jaynes, Julian. {\os 1990}.
{\em The Origin of Consciousness in the
Breakdown of the Bicameral Mind}. New York City: Houghton Mifflin Company.

Pye, David. {\os 1995}. {\em The Nature and Art of Workmanship}.
London: The Herbert Press.
\stopnegindent % ·····················································%

\setupindenting[yes, next, 9mm]
\subject{Section with regular identing}
I would expect this line to begin at the margin,
not having an indent \ldots\ and so is the case, but only
if I delete the above {\em Section with hanging indent}.

This next paragraph would be intented.
\stoptext


Update: In order to make this work with MkII, the indenting has to be registered in advance:

\defineindentingmethod [negative] {\parindent-\leftskip}

\definestartstop [negindent] [
before={%
\startnarrower[left]%
\setupindenting[yes,first,negative]%

Thanks, can confirm that the first solution works perfectly! But I'm also very interested in the later one. However I get a l.13 \startnegindent when trying to compile the MWE. I'm using pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012) and ConTeXt version 2012.05.30 11:26 MKII fmt: 2012.12.8, but guess it has do to with my installation in some way? –  PetaspeedBeaver Mar 10 '13 at 20:22