* Provide org-insert-subitem
@ 2019-09-22 9:04 Dmitrii Korobeinikov
2020-02-02 7:49 ` Bastien
0 siblings, 1 reply; 10+ messages in thread
From: Dmitrii Korobeinikov @ 2019-09-22 9:04 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 205 bytes --]
In short:
org-insert-heading -> org-insert-subheading
org-insert-todo-heading -> org-insert-todo-subheading
org-insert-item -> ?
Maybe should provide org-insert-subitem for consistency?
Regards,
Dmitrii
[-- Attachment #2: Type: text/html, Size: 307 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Provide org-insert-subitem
2019-09-22 9:04 Provide org-insert-subitem Dmitrii Korobeinikov
@ 2020-02-02 7:49 ` Bastien
2020-02-02 10:11 ` Dmitrii Korobeinikov
2020-02-02 17:43 ` Adam Porter
0 siblings, 2 replies; 10+ messages in thread
From: Bastien @ 2020-02-02 7:49 UTC (permalink / raw)
To: Dmitrii Korobeinikov; +Cc: emacs-orgmode
Hi Dmitrii,
Dmitrii Korobeinikov <dim1212k@gmail.com> writes:
> In short:
> org-insert-heading -> org-insert-subheading
> org-insert-todo-heading -> org-insert-todo-subheading
> org-insert-item -> ?
>
> Maybe should provide org-insert-subitem for consistency?
`org-insert-subheading' and `org-insert-todo-subheading' are not used
anywhere in Org's code. Do you them? How?
I'm more inclined to delete these commands since they have no binding
than to add an `org-insert-subitem'.
Hitting <M-RET> then <M-right> seems swift and handy enough.
WDYT?
--
Bastien
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Provide org-insert-subitem
2020-02-02 7:49 ` Bastien
@ 2020-02-02 10:11 ` Dmitrii Korobeinikov
2020-02-02 17:43 ` Adam Porter
1 sibling, 0 replies; 10+ messages in thread
From: Dmitrii Korobeinikov @ 2020-02-02 10:11 UTC (permalink / raw)
To: Bastien; +Cc: emacs-orgmode
Hi, Bastien,
> `org-insert-subheading' and `org-insert-todo-subheading' are not used
> anywhere in Org's code. Do you them? How?
I use them as intended: for convenience. Basically, I have a binding for this:
(defun my/insert-heading ()
(interactive)
(end-of-line)
(cond
((string-match (rx (and bol (0+ white) "- [")) (thing-at-point
'line t)) (command-execute 'org-insert-todo-heading))
((string-match (rx (and bol (0+ white) "-")) (thing-at-point
'line t)) (command-execute 'org-insert-item))
(t (if (my/org-heading-collapsed-p) (evil-open-below 1))
(command-execute 'org-insert-heading) (evil-normal-state))))
and a similar function for sub-things. This makes it very easy to
insert (sub)headings/items/todo-items, all with just two bindings.
> Hitting <M-RET> then <M-right> seems swift and handy enough.
Sometimes that would have to be <M-RET> <M-RET> <M-right> when the
items in the list are seperated with a newline. That's an awful lot of
combinations for such a basic task, which I do quite often.
> WDYT?
To me, these functions seem fundamental enough to warrant the
according out-of-the-box experience.
Best,
Dmitrii
вс, 2 февр. 2020 г. в 13:49, Bastien <bzg@gnu.org>:
>
> Hi Dmitrii,
>
> Dmitrii Korobeinikov <dim1212k@gmail.com> writes:
>
> > In short:
> > org-insert-heading -> org-insert-subheading
> > org-insert-todo-heading -> org-insert-todo-subheading
> > org-insert-item -> ?
> >
> > Maybe should provide org-insert-subitem for consistency?
>
> `org-insert-subheading' and `org-insert-todo-subheading' are not used
> anywhere in Org's code. Do you them? How?
>
> I'm more inclined to delete these commands since they have no binding
> than to add an `org-insert-subitem'.
>
> Hitting <M-RET> then <M-right> seems swift and handy enough.
>
> WDYT?
>
> --
> Bastien
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Provide org-insert-subitem
2020-02-02 7:49 ` Bastien
2020-02-02 10:11 ` Dmitrii Korobeinikov
@ 2020-02-02 17:43 ` Adam Porter
2020-02-12 8:33 ` Bastien
1 sibling, 1 reply; 10+ messages in thread
From: Adam Porter @ 2020-02-02 17:43 UTC (permalink / raw)
To: emacs-orgmode
Bastien <bzg@gnu.org> writes:
> `org-insert-subheading' and `org-insert-todo-subheading' are not used
> anywhere in Org's code. Do you them? How?
>
> I'm more inclined to delete these commands since they have no binding
> than to add an `org-insert-subitem'.
>
> Hitting <M-RET> then <M-right> seems swift and handy enough.
Please do not delete org-insert-subheading! I use it every day and have
for years. :) It would be much less convenient to have to use two
commands.
BTW, in my version of Org, org-insert-subheading works on both list
items and subheadings, so there's no need for a separate
org-insert-subitem command:
Insert a new subheading and demote it.
Works for outline headings and for plain lists alike.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Provide org-insert-subitem
2020-02-02 17:43 ` Adam Porter
@ 2020-02-12 8:33 ` Bastien
2020-02-12 21:28 ` Adam Porter
0 siblings, 1 reply; 10+ messages in thread
From: Bastien @ 2020-02-12 8:33 UTC (permalink / raw)
To: Adam Porter; +Cc: emacs-orgmode
Adam Porter <adam@alphapapa.net> writes:
> Please do not delete org-insert-subheading!
Done :)
I still find it strange to keep functions that are used nowhere in the
Org's core--except of course for functions that explicitely mention as
usable by the user (e.g. `org-clock-persistence-insinuate'.)
I'd rather have these functions stored in a org-utils.el library for
those who care.
This is not urgent, of course, we can have this discussion later on.
--
Bastien
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Provide org-insert-subitem
2020-02-12 8:33 ` Bastien
@ 2020-02-12 21:28 ` Adam Porter
2020-02-13 5:13 ` Corwin Brust
2020-02-13 8:04 ` Bastien
0 siblings, 2 replies; 10+ messages in thread
From: Adam Porter @ 2020-02-12 21:28 UTC (permalink / raw)
To: emacs-orgmode
Hi Bastien,
Bastien <bzg@gnu.org> writes:
> I still find it strange to keep functions that are used nowhere in the
> Org's core--except of course for functions that explicitely mention as
> usable by the user (e.g. `org-clock-persistence-insinuate'.)
>
> I'd rather have these functions stored in a org-utils.el library for
> those who care.
I'm not sure what you mean about functions mentioned as usable by the
user. org-insert-subheading is an interactive command, so it's
explicitly usable by the user. And it's in org.el, so it's in Org's
"core", right? I guess we're thinking in different terms.
Inserting a subheading or subitem is a very common operation in an
outlining and list-making tool, so it would seem like a significant
regression to remove it.
I'm not opposed to reorganizing the code, of course, as long as it
remains loaded as a command when org-mode is activated.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Provide org-insert-subitem
2020-02-12 21:28 ` Adam Porter
@ 2020-02-13 5:13 ` Corwin Brust
2020-02-13 8:04 ` Bastien
1 sibling, 0 replies; 10+ messages in thread
From: Corwin Brust @ 2020-02-13 5:13 UTC (permalink / raw)
To: Adam Porter; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1121 bytes --]
Hi,
On Wed, Feb 12, 2020, 15:28 Adam Porter <adam@alphapapa.net> wrote:
> Hi Bastien,
>
> Bastien <bzg@gnu.org> writes:
>
> > I still find it strange to keep functions that are used nowhere in the
> > Org's core--except of course for functions that explicitely mention as
> > usable by the user (e.g. `org-clock-persistence-insinuate'.)
>
[snip]
And it's in org.el, so it's in Org's
> "core", right? I guess we're thinking in different terms.
>
> Inserting a subheading or subitem is a very common operation in an
> outlining and list-making tool, so it would seem like a significant
> regression to remove it.
>
I think there's an implied -and usually misleading‐ correlation between the
importance of a function and the count of self-references -meaning uses in
the defining package- shown from help buffers. It would be cool to see
uses tracked as we byte-compile or something.
I'm not opposed to reorganizing the code, of course, as long as it
> remains loaded as a command when org-mode is activated.
>
I'm a fan of interactive methods in obvious, easy to reach places.
[-- Attachment #2: Type: text/html, Size: 2083 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Provide org-insert-subitem
2020-02-12 21:28 ` Adam Porter
2020-02-13 5:13 ` Corwin Brust
@ 2020-02-13 8:04 ` Bastien
2020-02-13 18:45 ` Adam Porter
1 sibling, 1 reply; 10+ messages in thread
From: Bastien @ 2020-02-13 8:04 UTC (permalink / raw)
To: Adam Porter; +Cc: emacs-orgmode
Hi Adam,
First of all, don't be afraid, I don't have a grand plan for "cleaning
up" things.
> I'm not sure what you mean about functions mentioned as usable by the
> user. org-insert-subheading is an interactive command, so it's
> explicitly usable by the user.
Yes, org-insert-subheading is interactive and usable and in Org's core
but how can a user *discover* this command?
There is no keybinding for it and no mention in the manual. Even as a
function, it is not even used in Org codebase.
The ways I can see for a user to discover this command is by trying to
complete M-x org-insert TAB or by reading Org's code (or other code in
the wild using it.)
So to me it's a "utility" command: something that Org does not depend
on, something that provides a useful feature, but not useful enough to
have a keybinding in Org's core or to be used as a function in Org's
core.
> And it's in org.el, so it's in Org's
> "core", right? I guess we're thinking in different terms.
Well, my thinking is not about core vs not-core, it is more on how to
advertize such commands and functions. I would recommand putting them
in org-utils.el but I'm not sure. And yes, I'm not entirely convinced
such a library, if it existed, should live in Org's core :)
Best,
--
Bastien
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Provide org-insert-subitem
2020-02-13 8:04 ` Bastien
@ 2020-02-13 18:45 ` Adam Porter
2020-02-14 10:02 ` Bastien
0 siblings, 1 reply; 10+ messages in thread
From: Adam Porter @ 2020-02-13 18:45 UTC (permalink / raw)
To: emacs-orgmode
Bastien <bzg@gnu.org> writes:
> First of all, don't be afraid, I don't have a grand plan for "cleaning
> up" things.
Don't worry, I trust you. :) Org wouldn't be what it is today without
your work, and I'm grateful for how much time you've been putting into
improving Org lately.
>> I'm not sure what you mean about functions mentioned as usable by the
>> user. org-insert-subheading is an interactive command, so it's
>> explicitly usable by the user.
>
> Yes, org-insert-subheading is interactive and usable and in Org's core
> but how can a user *discover* this command?
>
> There is no keybinding for it and no mention in the manual. Even as a
> function, it is not even used in Org codebase.
>
> The ways I can see for a user to discover this command is by trying to
> complete M-x org-insert TAB or by reading Org's code (or other code in
> the wild using it.)
I guess what happened here is that I found that command years ago,
probably from either reading someone else's config online or, as you
say, using completion (I discover so many things using Helm
completion--I'm constantly using "C-h f org-" when working on
Org-related code). Then I bound it to S-RET in my config, and I've been
using it ever since. To me it feels like just as much a part of Org as
any other Org command.
> So to me it's a "utility" command: something that Org does not depend
> on, something that provides a useful feature, but not useful enough to
> have a keybinding in Org's core or to be used as a function in Org's
> core.
What if we document it in the manual? For example, in section 2.5,
"Structure editing", we have:
`M-<RET>' (`org-insert-heading')
Insert a new heading/item with the same level as the one at point.
`C-<RET>' (`org-insert-heading-respect-content')
Insert a new heading at the end of the current subtree.
`M-S-<RET>' (`org-insert-todo-heading')
Insert new TODO entry with same level as current heading. See
also the variable `org-treat-insert-todo-heading-as-state-change'.
`C-S-<RET>' (`org-insert-todo-heading-respect-content')
Insert new TODO entry with same level as current heading. Like
`C-<RET>', the new headline will be inserted after the current
subtree.
What if we add:
`S-<RET>' (`org-insert-subheading')
Insert a new subheading and demote it.
Works for outline headings and for plain lists alike.
Note that I also propose binding it to S-<RET>. It seems that, by
default, that key is currently bound in Org buffers to
org-table-copy-down:
Copy the value of the current field one row below.
That's surely a useful function, but I feel like it probably isn't
widely used enough to deserve to be bound to S-<RET> in all contexts.
Of course, frequent users of this command, feel free to correct me, lest
I be a hypocrite. ;)
If that seems agreeable, then I'd also propose renaming the command
(preserving its old name in an alias, of course) to something which
would not imply that it only works in outlines, perhaps
org-insert-subitem or org-insert-demoted.
In the longer term , perhaps we could make a new, contextual command
that would call one command in tables and another command in non-table
contexts. If there were a clever way we could make similar, roughly
corresponding actions in both tables and tree structures use the same
bindings contextually, that might be useful. I think it would be
reasonable, because if point is in a table, the user probably won't want
to insert a new outline heading in the middle of it.
What do you think? Thanks.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Provide org-insert-subitem
2020-02-13 18:45 ` Adam Porter
@ 2020-02-14 10:02 ` Bastien
0 siblings, 0 replies; 10+ messages in thread
From: Bastien @ 2020-02-14 10:02 UTC (permalink / raw)
To: Adam Porter; +Cc: emacs-orgmode
Hi Adam,
Adam Porter <adam@alphapapa.net> writes:
> What do you think?
I think that's a good idea to promote org-insert-subheading either by
binding it to a key or another way.
I already have some drafty code that might touch things in this (very
sensible) area, so if you don't mind, I'll come back to the details of
your suggestions when I can articulate them with the few ideas I have
in mind. And after 9.4 is out.
But yes, there is room for enhancements here.
Don't hesitate to bump this thread in a few weeks if I don't share my
ideas since then.
Best,
--
Bastien
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2020-02-14 10:02 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-22 9:04 Provide org-insert-subitem Dmitrii Korobeinikov
2020-02-02 7:49 ` Bastien
2020-02-02 10:11 ` Dmitrii Korobeinikov
2020-02-02 17:43 ` Adam Porter
2020-02-12 8:33 ` Bastien
2020-02-12 21:28 ` Adam Porter
2020-02-13 5:13 ` Corwin Brust
2020-02-13 8:04 ` Bastien
2020-02-13 18:45 ` Adam Porter
2020-02-14 10:02 ` Bastien
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).