In my lisp code, I need to switch to cc-mode, do something and back to original mode (text mode). How to do that ?
Any time you want to compose function calls in a sequence, you just put them one after the other inside of a function, like this:
(defun do-the-thing () (interactive) (cc-mode) (indent-region) (normal-mode))
There are a few cases where you need to use
progn instead, but we’ll leave that for the advanced course.