The documentations says that "CellEvaluationFunction is applied to the BoxData expression representing the input to be evaluated". So I think Identity is working normally here. See the followings:
SetOptions[EvaluationNotebook[], CellEvaluationFunction -> function]
In[1]:= 2 + 2
5 + 7
Out[1]= function[BoxData[{RowBox[{"2", "+", "2"}], RowBox[{"5", "+", "7"}]}], StandardForm]
So, if we take the BoxData structure of the above input, we can do some tests:
Identity[BoxData[{RowBox[{"2", "+", "2"}], RowBox[{"5", "+", "7"}]}]]
(* BoxData[{RowBox[{"2", "+", "2"}], RowBox[{"5", "+", "7"}]}] *)
# &[BoxData[{RowBox[{"2", "+", "2"}], RowBox[{"5", "+", "7"}]}]]
(* BoxData[{RowBox[{"2", "+", "2"}], RowBox[{"5", "+", "7"}]}] *)
So, Identity sends the expression BoxData[{RowBox[{"2", "+", "2"}], RowBox[{"5", "+", "7"}]}] to the kernel and it produces the two lines of output with different Out[number] like
In[1]:= 2 + 2
5 + 7
On the other hand, ToExpression is declared as working on strings and boxes interpreting them as inputs, that means if set as CellEvaluationFunction it manipulates the box structure before to send it to the kernel:
ToExpression[BoxData[{RowBox[{"2", "+", "2"}], RowBox[{"5", "+", "7"}]}]]
12
So, I guess Identity is actually the CellEvaluationFunction's default.
The only think I cannot understand is why when we set an arbitrary function (like in my first example) as CellEvaluationFunction, the result includes the StandardForm as second argument (function[BoxData[{RowBox[{"2", "+", "2"}], RowBox[{"5", "+", "7"}]}], StandardForm]) while Identity doesn't accept a second argument and, indeed, it's not used.
EDIT
Using (#&) it fails but using (#)& it works:
SetOptions[EvaluationNotebook[], CellEvaluationFunction -> (# &)]
In[78]:= 2 + 2
Out[78]= BoxData[RowBox[{"2", "+", "2"}]]
In[79]:= 2 + 2
5 + 7
Out[79]= BoxData[{RowBox[{"2", "+", "2"}], RowBox[{"5", "+", "7"}]}]
SetOptions[EvaluationNotebook[], CellEvaluationFunction -> (#) &]
In[74]:= 2 + 2
Out[74]= 4
In[75]:= 2 + 2
5 + 7
Out[75]= 4
Out[76]= 12
MakeExpression? The docs say "MakeExpressionis used whenever boxes are supplied as input to Mathematica." – Simon Woods Jul 27 '13 at 08:49SetOptions[EvaluationNotebook[], CellEvaluationFunction -> Function[Null, MakeExpression[##], HoldAll]]you'll getErrorBoxfor output. (Not thatHoldAllshould not be necessary for Box form but I'm covering that as well.) Once again there appears to be something funny going on here, whereIdentityandMakeExpressionare handled specially. I'm trying to figure out how to change the Box form then send it to the true default function for correct processing. – Mr.Wizard Jul 27 '13 at 11:44CellEvaluationFunction :> (Null; Identity)doesn't work. – Simon Woods Jul 27 '13 at 18:16MakeExpression. The FE sendsEnterExpressionPacket@MakeExpression@BoxData[..]. I get errors like you do, if I do it myself, so it must be handled specially. – Michael E2 Jul 30 '13 at 20:28InputNamePacket,OutputNamePacket. If you're lucky, a solution won't be version dependent. – Michael E2 Jul 30 '13 at 20:28