emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Automatically update plain list checkboxes when removing nested list items?
@ 2024-08-29 22:06 Rohit Patnaik
  2024-09-01 16:38 ` Ihor Radchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Rohit Patnaik @ 2024-08-29 22:06 UTC (permalink / raw)
  To: emacs-orgmode

Hello, 

I have a question about plain list checkboxes. If I have a plain list, as
follows:

- [ ] Item 1
  - [ ] Sub-item 1
  - [ ] Sub-item 2
  - [ ] Sub-item 3

when I complete sub-items 1 and 2, the list is as follows:

- [-] Item 1
  - [X] Sub-item 1
  - [X] Sub-item 2
  - [ ] Sub-item 3

Then, if it turns out that Sub-item 3 is unnecessary, I can delete it with C-k:

- [-] Item 1
  - [X] Sub-item 1
  - [X] Sub-item 2

However, Item 1's checkbox is in the intermediate state, even though all of its
sub-items have been completed.

I'm wondering if there's a way that I can delete Sub-item 3 and update the Item
1 checkbox all at once. Right now, I have to move the cursor back up to Item 1
and hit C-c C-c to force the checkbox to update.

Thanks,
Rohit Patnaik


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Automatically update plain list checkboxes when removing nested list items?
  2024-08-29 22:06 Automatically update plain list checkboxes when removing nested list items? Rohit Patnaik
@ 2024-09-01 16:38 ` Ihor Radchenko
  2024-09-01 17:57   ` Sławomir Grochowski
  0 siblings, 1 reply; 3+ messages in thread
From: Ihor Radchenko @ 2024-09-01 16:38 UTC (permalink / raw)
  To: Rohit Patnaik; +Cc: emacs-orgmode

"Rohit Patnaik" <quanticle@quanticle.net> writes:

> I have a question about plain list checkboxes. If I have a plain list, as
> follows:
> ...
> Then, if it turns out that Sub-item 3 is unnecessary, I can delete it with C-k:
>
> - [-] Item 1
>   - [X] Sub-item 1
>   - [X] Sub-item 2
>
> However, Item 1's checkbox is in the intermediate state, even though all of its
> sub-items have been completed.
>
> I'm wondering if there's a way that I can delete Sub-item 3 and update the Item
> 1 checkbox all at once. Right now, I have to move the cursor back up to Item 1
> and hit C-c C-c to force the checkbox to update.

There is no such way readily available, AFAIK.

You might be able to do with appropriate after-change function, but
such things may cause performance degradation.

Another way might be an advice for org-kill-line (if your C-k is bound
to org-kill-line).

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Automatically update plain list checkboxes when removing nested list items?
  2024-09-01 16:38 ` Ihor Radchenko
@ 2024-09-01 17:57   ` Sławomir Grochowski
  0 siblings, 0 replies; 3+ messages in thread
From: Sławomir Grochowski @ 2024-09-01 17:57 UTC (permalink / raw)
  To: Ihor Radchenko, Rohit Patnaik; +Cc: emacs-orgmode

Ihor Radchenko <yantar92@posteo.net> writes:
> There is no such way readily available, AFAIK.

I also noticed that there is no command to remove an item from a plain
list. But I've never needed that functionality.

I made a simple comparison table to better understand the org mode
interface, maybe it will be useful to someone:

|                    | heading        | plain list | table              | column view        |
|--------------------+----------------+------------+--------------------+--------------------|
| move item left     | M-left         | M-left     | M-left             | M-left             |
| move item right    | M-right        | M-right    | M-right            | M-right            |
| move item up       | M-up           | M-up       | M-up               | M-up               |
| move item down     | M-down         | M-down     | M-down             | M-down             |
| visibility cycling | TAB            | TAB        | -                  | TAB                |
| change state       | S-[left&right] | C-c C-c    | -                  | -                  |
|--------------------+----------------+------------+--------------------+--------------------|
| add item           | M-RET          | M-RET      | M-S-down (row)     | -                  |
|                    |                |            | M-S-right (column) | M-S-right (column) |
|--------------------+----------------+------------+--------------------+--------------------|
| remove item        | C-c C-x C-w    | -          | M-S-up (row)       | -                  |
|                    |                |            | M-S-left (column)  | M-S-left (column)  |


Regards, 
-- 
Slawomir Grochowski


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-09-01 17:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-29 22:06 Automatically update plain list checkboxes when removing nested list items? Rohit Patnaik
2024-09-01 16:38 ` Ihor Radchenko
2024-09-01 17:57   ` Sławomir Grochowski

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