Create a new file foo.txt and type this code in it:
(+ 1 2)
Move the cursor to the end of the line (right after the close-paren) and press
C-x C-e. The expression is evaluated.
Move the cursor to somewhere within the expression and press
C-M-x. There is an error message:
C-M-x is undefined.
Now replicate the same steps in a buffer foo.el. In foo.el both
C-x C-e and
C-M-x work successfully.
C-x C-e work in foo.txt but
C-M-x not work in foo.txt?