Discussion:
[PATCH] C-M-a now selects section if outside insets
Scott Kostyshak
2014-10-07 05:24:00 UTC
Permalink
inset-select-all is not useful outside an inset. It used to be
equivalent to "select all", but is now disabled outside of insets.
Outside of insets, for the cua and mac C-M-a bind, command-alternatives
thus passes dispatch to section-select. This is useful in beamer to select
a frame and useful more generally to select a section to delete or copy.

Any comments?

Scott
Jean-Marc Lasgouttes
2014-10-07 13:48:23 UTC
Permalink
Post by Scott Kostyshak
inset-select-all is not useful outside an inset. It used to be
equivalent to "select all", but is now disabled outside of insets.
Outside of insets, for the cua and mac C-M-a bind, command-alternatives
thus passes dispatch to section-select. This is useful in beamer to select
a frame and useful more generally to select a section to delete or copy.
So this means that inside a branch inset, C-M-a will not work the same
as outside of this branch inset? I do not like much this idea...

JMarc
Scott Kostyshak
2014-10-07 17:05:06 UTC
Permalink
Post by Scott Kostyshak
inset-select-all is not useful outside an inset. It used to be
equivalent to "select all", but is now disabled outside of insets.
Outside of insets, for the cua and mac C-M-a bind, command-alternatives
thus passes dispatch to section-select. This is useful in beamer to select
a frame and useful more generally to select a section to delete or copy.
So this means that inside a branch inset, C-M-a will not work the same as
outside of this branch inset? I do not like much this idea...
If you are inside a branch inset and inside another inset (e.g. Note),
C-M-a will select everything in the note. If you are inside a branch
inset and not inside any other inset, C-M-a will select everything
inside the branch inset. These two behaviors are the same with and
without the patch. What is different is that if you are outside every
inset, C-M-a without the patch selects the entire text of the buffer.
This is not very useful because if that was the intention of the user,
why not just do select all? With the patch, if you are outside every
inset, C-M-a does section-select.

Thus, if you are inside any inset (e.g. branch), the behavior is
unchanged because inset-select-all has priority.
Jean-Marc Lasgouttes
2014-10-07 17:16:06 UTC
Permalink
Post by Scott Kostyshak
If you are inside a branch inset and inside another inset (e.g. Note),
C-M-a will select everything in the note. If you are inside a branch
inset and not inside any other inset, C-M-a will select everything
inside the branch inset. These two behaviors are the same with and
without the patch. What is different is that if you are outside every
inset, C-M-a without the patch selects the entire text of the buffer.
This is not very useful because if that was the intention of the user,
why not just do select all? With the patch, if you are outside every
inset, C-M-a does section-select.
Yes, I understood what it does. What I said is that the behavior of a
command should not depend on the context in this way. Assuming that
people find it very nice to select sections with C-M-a, then this
behavior should work in branches/notes too.

A possibility could be to disable section-select when there is no
section to select and to bind C-M-a to
command-alternatives section-select ; inset-select-all

JMarc
Scott Kostyshak
2014-10-07 18:09:35 UTC
Permalink
Post by Jean-Marc Lasgouttes
Post by Scott Kostyshak
If you are inside a branch inset and inside another inset (e.g. Note),
C-M-a will select everything in the note. If you are inside a branch
inset and not inside any other inset, C-M-a will select everything
inside the branch inset. These two behaviors are the same with and
without the patch. What is different is that if you are outside every
inset, C-M-a without the patch selects the entire text of the buffer.
This is not very useful because if that was the intention of the user,
why not just do select all? With the patch, if you are outside every
inset, C-M-a does section-select.
Yes, I understood what it does. What I said is that the behavior of a
command should not depend on the context in this way. Assuming that people
find it very nice to select sections with C-M-a, then this behavior should
work in branches/notes too.
Ah, I see now. I thought you were concerned that I was changing
something but you're concerned that I'm _not_ changing something and
that it leads to inconsistency.

I'm not at all convinced that people would find it very nice. I would
like feedback on this.
Post by Jean-Marc Lasgouttes
A possibility could be to disable section-select when there is no section to
select and to bind C-M-a to
command-alternatives section-select ; inset-select-all
[My definition in the following paragraphs of "the section you're in":
the section that contains your cursor, even if the cursor is not in
the section title.]

Makes sense. I wanted to extend section-select to select the section
you're in, as I define that phrase above. This would not allow me to
purse your proposal though. But perhaps extending section-select to
work that way was not a good idea anyway for other reasons?

Even if users would find the ability to select a section useful, maybe
it would make more sense to make a new shortcut instead of trying to
interfere with inset-select-all.

Still, I think that inset-select-all should be disabled outside of
insets. The entire buffer is not an inset, so it should not be
selected.

Scott
Jean-Marc Lasgouttes
2014-10-07 18:16:43 UTC
Permalink
Post by Scott Kostyshak
Still, I think that inset-select-all should be disabled outside of
insets. The entire buffer is not an inset, so it should not be
selected.
I think actually that inset-select-all should be bound to C-a and be the
default way if selecting all. It is a better function actually.

JMarc
Scott Kostyshak
2014-10-07 18:24:42 UTC
Permalink
Post by Jean-Marc Lasgouttes
Post by Scott Kostyshak
Still, I think that inset-select-all should be disabled outside of
insets. The entire buffer is not an inset, so it should not be
selected.
I think actually that inset-select-all should be bound to C-a and be the
default way if selecting all. It is a better function actually.
I agree with this. In this case would you suggest C-M-a for select-all
or have it unbound?

Scott

Loading...