2

How to determine if in the current buffer some text is selected?

1
  • 4
    region-active-p
    – abo-abo
    Commented Apr 17, 2015 at 11:41

1 Answer 1

3

You can use region-active-p.

Just to add something to the short answer, region-active-p won't work in -batch, so you need to enable this (which is actually default in plain Emacs):

(transient-mark-mode 1)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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