Subject: bug#5753: something, something, org-mode, shift-select, something

From: "N. Jackson" <[email-masked]>
Date: Sat, 08 Feb 2014 21:25:31 -0400

The following message is a courtesy copy of an article
that has been posted to gnu.emacs.bug as well.

Lars Ingebrigtsen <[email-masked]> writes:

> Lennart Borgman <[email-masked]> writes:
>
>> Shift-select in cua-mode does not work in org-mode although
>> org-replace-disputed-keys is t, org-disputed-keys are set for shift
>> arrow keys and org-support-shift-select is always
>
> Is this problem still present in Emacs 24.3?

Naturally I can't answer for the OP (and I don't know about disputed
keys) but I can report that in general this problem persists in Emacs
24.3.

On GNU Emacs 24.3.1 [1], shift select does not work in org mode. I'm not
certain this is a bug, as my understanding is that the org authors did
not design it to work with shift select?

In any case, I use a very simple workaround which makes shift select
work just fine in org mode; I've never had any problems with it. It
looks like this (Note: It is of unknown provenance, aside from the
attribution in the comment.):

;; This snippit from jisang-yoo on reddit to enable shift select in org
;; mode when cua-mode is on.
(eval-after-load "org"
    '(progn
       (eval-after-load "cua-base"
         '(progn
            (defadvice org-call-for-shift-select (before
            org-call-for-shift-select-cua activate)
              (if (and cua-mode
                       org-support-shift-select (not (use-region-p)))
                  (cua-set-mark)))))))
;; End jisang-yoo snippit

With this in my org settings, I have no problems with shift select
except that you cannot start a selection on a timestamp (because shift
with cursor keys adjusts timestamps), but I've learnt to automatically
start my selection from the end of the line above the timestamp so I
don't have any problems.

I hope this information is of some use.

[1] GNU Emacs 24.3.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.8.2) of
2013-08-14 on buildvm-15.phx2.fedoraproject.org