Skip to navigation

Emacs 22 does not highlight region

Well, I doubt many people have this problem. For some reason, on a server I use the installed Emacs version is Emacs 22, not the current Emacs 23, and I ran into the problem that I was expecting transient-mark-mode when it was in persistent-mark-mode, as I figured out here. However, it’s the kind of solution you don’t easily find when you don’t know Emacs terminology (mark, point, region, active), so an attempt to make this more googleable especially for Emacs newbies:

The symptom was that in an Emacs buffer, after hitting Ctrl and the spacebar (C-space) and then moving the cursor, I was expecting the text in between (between mark and point) to be highlighted (indicating an active region), but the region was not highlighted and not active. Accordingly, then doing a replace-string and expecting it to replace text in the region that is “normally” (in Emacs 23) highlighted did not replace anything. (I was, however, able to cut and paste (kill and yank) the same region. In Emacs-speak, the region was not active. Another symptom: after M-x replace-string where I normally see “Replace string in region” in the minibuffer, it now only said “Replace string”.

The solution:

M-x transient-mark-mode

to enable transient-mark-mode and get the expected behaviour (this command toggles it on and off).

Comments are closed.