({{, (RefLink[CellProlog, paclet:ref/CellProlog]) 
is an option to (RefLink[Cell, paclet:ref/Cell]) that gives an expression to evaluate before each ordinary evaluation of the contents of the cell.}})

OpenersNotesSection(Spacer1)Details

CellProlog:>expr evaluates expr for every ordinary kernel evaluation done in the cell, as initiated for example by (Key1[shift, MacOSXreturnenter]) or by (MenuGrayLink[Evaluate in Place, paclet:ref/menuitem/EvaluateInPlace]).

(RefLink[CellProlog, paclet:ref/CellProlog]) is not evaluated for evaluations associated with (RefLink[Dynamic, paclet:ref/Dynamic]) objects.

The default setting is (RefLink[CellProlog, paclet:ref/CellProlog])->(RefLink[None, paclet:ref/None]).

(RefLink[CellProlog, paclet:ref/CellProlog]) is often set at a style or notebook level, rather than for individual cells.

OpenersPrimaryExamplesSection(Spacer1)Examples  (2)

OpenersExampleSection1(Spacer1)Applications  (2)

Rules for temporarily setting (RefLink[$Post, paclet:ref/$Post]):

{CellProlog:>($Post=N),CellEpilog:>($Post=.)}

Rules for setting up local package contexts for a cell:

{CellProlog:>BeginPackage["c1`"],CellEpilog:>EndPackage[]}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[CellEpilog, paclet:ref/CellEpilog])  ▪  (RefLink[CellContext, paclet:ref/CellContext])  ▪  (RefLink[$Pre, paclet:ref/$Pre])  ▪  (RefLink[Evaluator, paclet:ref/Evaluator])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Evaluation Options in Notebooks, paclet:guide/EvaluationOptionsInNotebooks])}})}})