3

I managed to disable the built-in shift-selection via (set-variable 'shift-select-mode nil). And I like the C-Ret-column-selection of CUA-mode. But CUA automatically enables shift-selection (but seemingly not via the variable shift-select-mode).

  • So, is there a possibility to disable shift-selection within CUA-mode?
  • Or: Is there a way to use the column-selection-feature of CUA-mode exclusively, i.e. without any other CUA-things?
phimuemue
  • 34,669
  • 9
  • 84
  • 115

3 Answers3

0

Specifically, to disable the shift-selection for cua-mode, add the following to your init file (e.g. .emacs) prior to turning on cua-mode:

(setq cua-enable-cua-keys nil)
(setq cua-highlight-region-shift-only t) ;; no transient mark mode
(setq cua-toggle-set-mark nil) ;; original set-mark behavior, i.e. no transient-mark-mode

...
(cua-mode)

Originally answered https://superuser.com/a/77453/223457

Community
  • 1
  • 1
mattc
  • 485
  • 3
  • 9
0

To only enable rectangle (column) editing from Cua you can use the following (from emacs-fu)

(setq cua-enable-cua-keys nil) ;; only for rectangles (cua-mode t)

Jonathan Leech-Pepin
  • 7,684
  • 2
  • 29
  • 45
0

This isn't a solution, but FYI...

I noticed this variable mentioned in the help for cua-mode

cua-highlight-region-shift-only is a variable defined in `cua-base.el'.

*If non-nil, only highlight region if marked with S-<move>.
When this is non-nil, CUA toggles `transient-mark-mode' on when the region
is marked using shifted movement keys, and off when the mark is cleared.
But when the mark was set using M-x cua-set-mark, Transient Mark mode
is not turned on.

cua-mode does this:

(setq shift-select-mode nil)
(setq transient-mark-mode (and cua-mode
               (if cua-highlight-region-shift-only
                   (not cua--explicit-region-start)
                 t))))
phils
  • 71,335
  • 11
  • 153
  • 198