title: Evaluate current cell without leaving or losing the position in it in Mathematica
body: <p>I am experimenting with logo designs in Mathematica (8 or above) using the notebook interface and I want to change the generating formula A LOT. The problem is I only know SHIFT + ENTER which makes me jump outside my current cell and lose my position.</p>
  
  <p>Is there a way to evaluate the current cell without leaving it and losing your position within it? So: Evaluate a cell and land back <strong>inside</strong> the same cell <strong>at the exact position I pressed SHIFT + ENTER at</strong>.</p>
  
  <p>What I once came to use was along the lines:</p>
  
  <pre><code>a = Exp[1.994 \[Pi]/(3 I)];
  
  b = Nest[{#, a #, a\[Conjugate] #, #} &amp;, 1, 5];
  
  {Re[#], Im[#]} &amp; /@ 
     Accumulate[
      Flatten[{0, a b, a\[Conjugate] b, -b}]] // {\[Rho]\[Chi], # // 
       Line} &amp; // Graphics
  
  NotebookFind[EvaluationNotebook[], "E" &lt;&gt; "xp", Previous];
  </code></pre>
  
  <p>but I hope there is just another key combination or sth. that I am not aware of.</p>
  
  <p><strong>Edit:</strong></p>
  
  <pre><code>a = Exp[(*1*)1.994 \[Pi]/(3 I)];
  
  b = Nest[{#, a #, a\[Conjugate] #, #} &amp;, (*2*)1, (*3*)5];
  
  {Re[#], Im[#]} &amp; /@ 
     Accumulate[
      Flatten[{0, a b, a\[Conjugate] b, -b}]] // {\[Rho]\[Chi], # // 
       Line} &amp; // Graphics
  
  Do[NotebookFind[EvaluationNotebook[], "(*1*)", Previous], {2}];
  </code></pre>
  
  <p>is a nice little improvement to my solution as partly suggested by Chris Dengen.</p>
  
  <p><strong>Edit 2:</strong></p>
  
  <pre><code>NotebookFind[EvaluationNotebook[], "(*1*)", EvaluationCell]
  </code></pre>
  
  <p>This solves:</p>
  
  <ul>
  <li>these only work with cells that produce one or a known number of output cells</li>
  </ul>
  
  <p>EvaluationCell is sparsely documented so hard to find in fact I just stumbled upon it. Using the EvaluationCell the search starts from above (eliminating the Do twice construct) as we do not come from an output cell further down the screen.</p>
  
  <p>What remains to be solved:</p>
  
  <ul>
  <li>one needs to do manual cell-keeping (bookkeeping at cell level) to land at places of interest</li>
  <li>using comment-based landing markers clutters the input cells</li>
  </ul>
  
  <p><strong>Note</strong>
  This question is about not losing current position when one presses SHIFT + ENTER inside a Mathematica notebook cell. It is not about content or Manipulate. Sorry for not making that clear at the beginning.</p>
  
  <p><strong>Temporary Note</strong></p>
  
  <p>Now trying the following:</p>
  
  <ol>
  <li>use event handlers to define an alternative evaluation key combination</li>
  <li>when triggered, find a way to store the exact keyboard position in the current input cell</li>
  <li>evaluate the current input cell</li>
  <li>restore the position in the current input cell</li>
  </ol>
  
  <p>I internally hope some function might just take care of the store/restore by chance being optimistic. Being realistic though, I first hope I can even find a way to get at the current keyboard position. Will follow up here if anything materializes out of my attempt.</p>