emacscua-mode

Emacs: Disable shift-selection in CUA-mode


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).


Solution

  • 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))))