emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: nljlistbox2@gmail.com (N. Jackson)
To: Bastien <bzg@altern.org>
Cc: Lars Ingebrigtsen <larsi@gnus.org>,
	Lennart Borgman <lennart.borgman@gmail.com>,
	5753@debbugs.gnu.org
Subject: bug#5753: something, something, org-mode, shift-select, something
Date: Mon, 10 Feb 2014 17:29:55 -0400	[thread overview]
Message-ID: <87mwhy4pws.fsf@moondust.localdomain> (raw)
In-Reply-To: <877g938loa.fsf@bzg.ath.cx> (Bastien's message of "Mon, 10 Feb 2014 08:35:33 +0100")

Bastien <bzg@altern.org> writes:

> Can you try the two recipes I gave here:
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=5753#26

Wherein Bastien <bzg <at> gnu.org> writes:

>> With Emacs from trunk:

Ah, that sounds like the start of a new adventure...

... which went _far_ more smoothly than I expected! I am now testing
with GNU Emacs 24.3.50.1 Repository revision: 116400 and Org-mode
version 8.2.5c.

>> ~$ emacs RET 
>> C-x C-f test.org RET 
>> M-x cua-mode RET 
>> M-: (setq org-support-shift-select t) RET 
>> M-: (insert "blahblah") RET C-a
>> S-<right>
>> 
>> will select correctly here.
>> 
>> ~$ emacs RET 
>> M-: (setq org-support-shift-select t) RET 
>> M-: (setq org-replace-disputed-keys t) RET 
>> M-: (insert "* A headline") RET 
>> C-a
>> S-<right>
>> 
>> will also select correctly instead of switching the TODO keyword.

> and tell me where it does not produce the expected output?

The first recipe is ambiguous because M-x cua-mode RET toggles the
on/off or off/on state of cua-mode, so it depends on how it is set in
one's configuration files.

In any case, with both recipes, Org behaves correctly in 24.3.50.1. The
first recipe fails in 24.3.1 when cua-mode is not enabled in one's
configuration files (i.e. when you turn it on at the beginning of the
recipe).

Here's a simpler recipe:

    emacs -Q 
    M-: (org-support-shift-select t) RET 
    M-x cua-mode RET    ; Turn _on_ cua mode 
    C-x C-f new-test.org RET 
    a 
    S-<left>    ; Expected: "a" is selected / highlighted 
    C-x         ; Expected: "a" is removed to the clipboard

In Emacs 24.3.1 (as, I believe, in Emacs 23), the S-<left> just moves
the cursor, no selection is highlighted, and the C-x fails to remove the
"a" to the clipboard. This defect is fixed in Emacs 24.3.50.1. :)

As far as shift selection over headlines, todos, and datestamps is
concerned, in general, shift selection behaviour in Emacs 24.3.50.1
(unlike in Emacs 24.3.1) now seems to behave as it is described in the
doc string:

    C-h v org-support-shift-select RET

as follows:

    org-support-shift-select is a variable defined in `org.el'.  Its
    value is always Original value was nil

    Documentation: Non-nil means make shift-cursor commands select text
    when possible.

    In Emacs 23, when `shift-select-mode' is on, shifted cursor keys
    start selecting a region, or enlarge regions started in this way.
    In Org-mode, in special contexts, these same keys are used for other
    purposes, important enough to compete with shift selection.  Org
    tries to balance these needs by supporting `shift-select-mode'
    outside these special contexts, under control of this variable.

    The default of this variable is nil, to avoid confusing behavior.
    Shifted cursor keys will then execute Org commands in the following
    contexts:
    - on a headline, changing TODO state (left/right) and priority
    - (up/down) on a time stamp, changing the time in a plain list item,
    - changing the bullet type in a property definition line, switching
    - between allowed values in the BEGIN line of a clock table
    - (changing the time block).
    Outside these contexts, the commands will throw an error.

    When this variable is t and the cursor is not in a special context,
    Org-mode will support shift-selection for making and enlarging
    regions.  To make this more effective, the bullet cycling will no
    longer happen anywhere in an item line, but only if the cursor is
    exactly on the bullet.

    If you set this variable to the symbol `always', then the keys will
    not be special in headlines, property lines, and item lines, to make
    shift selection work there as well.  If this is what you want, you
    can use the following alternative commands: `C-c C-t' and `C-c ,' to
    change TODO state and priority, `C-u C-u C-c C-t' can be used to
    switch TODO sets, `C-c -' to cycle item bullet types, and properties
    can be edited by hand or in column view.

    However, when the cursor is on a timestamp, shift-cursor commands
    will still edit the time stamp - this is just too good to give up.

    XEmacs user should have this variable set to nil, because
    `shift-select-mode' is in Emacs 23 or later only.

    You can customize this variable.

This is very very helpful stuff, clearly presented, and I feel it ought
to be in the info manual as well.

[The only part that I don't see working properly is the changing of
bullet types. As far as I can tell, this doesn't happen -- but it's not
something I've ever tried to do and maybe I'm not using it right.]

I just did a cursory look at the effect of org-replace-disputed-keys,
because I don't use this. Was an issue with this reported in the
original bug? If so, I can test it more thoroughly.

I hope the above report is of some use.

Regards,
N.

  reply	other threads:[~2014-02-10 21:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <e01d8a51003221746i42766220y6936e98a85f78234@mail.gmail.com>
2014-02-03  0:21 ` bug#5753: something, something, org-mode, shift-select, something Lars Ingebrigtsen
2014-02-09 14:06   ` Bastien
2014-02-09 14:12     ` Lennart Borgman
2014-02-09 14:29       ` Bastien
2014-02-09 21:45         ` N. Jackson
2014-02-10  7:35           ` Bastien
2014-02-10 21:29             ` N. Jackson [this message]
2014-02-11  2:22               ` N. Jackson
2014-02-11 16:29               ` Bastien
2014-02-11 17:12                 ` N. Jackson
2014-02-11 17:20                   ` Bastien
2014-02-11 21:01                   ` Lennart Borgman
     [not found] ` <mailman.13581.1391387010.10748.bug-gnu-emacs@gnu.org>
2014-02-09  1:25   ` N. Jackson
2014-02-09 11:05     ` Lennart Borgman
2014-02-09 11:08       ` Lennart Borgman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mwhy4pws.fsf@moondust.localdomain \
    --to=nljlistbox2@gmail.com \
    --cc=5753@debbugs.gnu.org \
    --cc=bzg@altern.org \
    --cc=larsi@gnus.org \
    --cc=lennart.borgman@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).