# Wrapping at evaluation for inline cell

I've been playing with inline evaluation and I've came to the conclusion that it's most convenient to put the Dynamic@ inside the inline cell, so I've started to search for a way to omit typing it altogether. I've tried using CellEvaluationFunction and CellProlog, but with no luck. How can I achieve this?

Also, it would be best if the wrapping with Dynamic[] occurred only in inline cell evaluations (which happen in ordinary text cells)

-
Well, that seems like a good enough solution. I mean I could do an input alias with a placeholder and set the focus to the placeholder. Why is Dynamic such a bad thing? I mean, beside the irritating information when I open the document it seems to work fine... Different, but related problem is how to evaluate an inline cell without having to select it first (even though I can do it with keyboard) –  Ranza May 8 '14 at 18:21
Not a big problem but each Dynamic cell uses part of processor. Is my answer ok? –  Kuba May 8 '14 at 19:46
It's perfect, thanks :) You're also right about the CPU, drains the battery waaay faster. –  Ranza May 8 '14 at 21:25

You need to add this piece of code and use it instead of Ctrl+9 for you own inline cell:

Item[KeyEvent["t", Modifiers -> {Control}],
FrontEndExecute[
FrontEndNotebookWrite[
FrontEndInputNotebook[],
Cell[ BoxData[ RowBox[{"Dynamic", "[", "\[Placeholder]", "]"}] ],
CellEventActions -> {{"MenuCommand", "HandleShiftReturn"} :> {
SelectionMove[EvaluationCell[], All, CellContents];
SelectionEvaluate[EvaluationNotebook[]]}}
]
];
FrontEndSelectionMove[FrontEndInputNotebook[], Previous, Character, 2];
FrontEndSelectionMove[FrontEndInputNotebook[], All, Character]
]
]

• Now with Ctrl+f, or whatever you want that is free, you will create a cell with Dynamic already written.

• Also Shift+Enter results in evaluation in place without selecting it.

### Edit:

If you want numeric keypad Enter to do this Evaluation In Place you can use {"MenuCommand", "EvaluateCells"} event instead of "HandleShiftReturn". For me it would be great since I hardly ever use Shift+Enter

### Ref:

Here is a tutorial how to add a new shortcut: Automating Esc [[ Esc formatting?