In earlier versions of emacs (<23, I believe), when a region ( e.g., 'some text') was selected in AucTeX, and C-e was entered to include the text an environment, the following was obtained:

some text

However, in Emacs 24, it is not possible to use C-e if a region has been selected. Rather, I have to unselect the region and then type C-e. If the point is on the text, the environment is inserted after the text with C-e:

some text


and the cursor is within the environment.

Is it possible to get the old behaviour back?

  • 3
    The feature you describe works also with Emacs 24, so probably you have some settings in your init file preventing this from working. – giordano Oct 22 '15 at 10:57
  • Thank you. I found the culprit: '(cua-mode t nil (cua-base)) – user3607807 Oct 22 '15 at 14:58
  • 1
    You may want to answer your own question then ;-) – giordano Oct 22 '15 at 16:26

The selected text does not seem to be included if cua-mode is turned on, so it needs to be turned off:

(cua-mode 0)
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.