0

While working with term or ansi-term in term-line mode, I am not able to use cua-mode bindings. Is this possible?

1

I was experiencing this from some time now, and never had the time/energy to look at it. But it seems it is pretty straightforward as it is described in AnsiTermHints:

;; enable cua and transient mark modes in term-line-mode
(defadvice term-line-mode (after term-line-mode-fixes ())
  (set (make-local-variable 'cua-mode) t)
  (set (make-local-variable 'transient-mark-mode) t))
(ad-activate 'term-line-mode)

;; disable cua and transient mark modes in term-char-mode
(defadvice term-char-mode (after term-char-mode-fixes ())
  (set (make-local-variable 'cua-mode) nil)
  (set (make-local-variable 'transient-mark-mode) nil))
(ad-activate 'term-char-mode)

So cua-mode works in term-line mode and does not in term-char mode.

  • You can use setq-local if you're running Emacs 24.3+ – phils Jun 8 '16 at 4:59

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.