all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [BUG] org-toggle-headline inserts "TODO" regardless of local definitions [9.5 (9.5-g0a86ad @ /home/rasmus/.emacs.d/elpa/org-9.5/)]
@ 2021-10-17 14:06 autofrettage
  2021-10-17 14:23 ` Ihor Radchenko
  0 siblings, 1 reply; 5+ messages in thread
From: autofrettage @ 2021-10-17 14:06 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

Dear all,

Here comes a minor gripe.
If I start with:
-------------------------
#+TODO: foo bar | baz

+ [X] Apple
+ [ ] Banana
------------------------
...and then apply org-toggle-headline (C-c *) on the two items,
one after the other, I end up with these headlines:

* DONE Apple
** TODO Banana

...instead of these:

* baz Apple
** foo Banana

Yours
Rasmus


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

* Re: [BUG] org-toggle-headline inserts "TODO" regardless of local definitions [9.5 (9.5-g0a86ad @ /home/rasmus/.emacs.d/elpa/org-9.5/)]
  2021-10-17 14:06 [BUG] org-toggle-headline inserts "TODO" regardless of local definitions [9.5 (9.5-g0a86ad @ /home/rasmus/.emacs.d/elpa/org-9.5/)] autofrettage
@ 2021-10-17 14:23 ` Ihor Radchenko
  2021-10-17 17:53   ` Tim Cross
  2022-10-08  4:43   ` Ihor Radchenko
  0 siblings, 2 replies; 5+ messages in thread
From: Ihor Radchenko @ 2021-10-17 14:23 UTC (permalink / raw)
  To: autofrettage; +Cc: emacs-orgmode@gnu.org

autofrettage <autofrettage@protonmail.ch> writes:

> * DONE Apple
> ** TODO Banana
>
> ...instead of these:
>
> * baz Apple
> ** foo Banana

Confirmed.

Currently, checkbox to todo keyword mapping is hard-coded in
org-list-to-subtree.

We may use something like
[ ] -> (car org-not-done-keywords);
[-] -> (car org-not-done-keywords);
[X] -> (car org-done-keywords);

Though it may still be not ideal when there are multiple keywords to
choose from.

Best,
Ihor


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

* Re: [BUG] org-toggle-headline inserts "TODO" regardless of local definitions [9.5 (9.5-g0a86ad @ /home/rasmus/.emacs.d/elpa/org-9.5/)]
  2021-10-17 14:23 ` Ihor Radchenko
@ 2021-10-17 17:53   ` Tim Cross
  2022-10-08  4:48     ` Ihor Radchenko
  2022-10-08  4:43   ` Ihor Radchenko
  1 sibling, 1 reply; 5+ messages in thread
From: Tim Cross @ 2021-10-17 17:53 UTC (permalink / raw)
  To: emacs-orgmode


Ihor Radchenko <yantar92@gmail.com> writes:

> autofrettage <autofrettage@protonmail.ch> writes:
>
>> * DONE Apple
>> ** TODO Banana
>>
>> ...instead of these:
>>
>> * baz Apple
>> ** foo Banana
>
> Confirmed.
>
> Currently, checkbox to todo keyword mapping is hard-coded in
> org-list-to-subtree.
>
> We may use something like
> [ ] -> (car org-not-done-keywords);
> [-] -> (car org-not-done-keywords);
> [X] -> (car org-done-keywords);
>

I would agree hard coded todo keywords is an issue given we allow
people to define the set of todo keywords. I think your suggestion to
use the car of 'org-not-done-keywords and 'org-done-keywords is an
improvement (even if not perfect).

I do wonder if the doc string for org-toggle-heading needs updating. It
makes no reference to making a list item a todo heading if it looks like
a todo item. I was actually surprised that org-toggle-heading adds
keywords at all. While headings and todo items are certainly related, my
expectation would be that a function called org-toggle-heding would do
just that - add stars if none exist and remove them if they do. I would
not necessarily expect a list item to be converted to a todo heading,
only a heading. 


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

* Re: [BUG] org-toggle-headline inserts "TODO" regardless of local definitions [9.5 (9.5-g0a86ad @ /home/rasmus/.emacs.d/elpa/org-9.5/)]
  2021-10-17 14:23 ` Ihor Radchenko
  2021-10-17 17:53   ` Tim Cross
@ 2022-10-08  4:43   ` Ihor Radchenko
  1 sibling, 0 replies; 5+ messages in thread
From: Ihor Radchenko @ 2022-10-08  4:43 UTC (permalink / raw)
  To: autofrettage; +Cc: emacs-orgmode@gnu.org

Ihor Radchenko <yantar92@gmail.com> writes:

> autofrettage <autofrettage@protonmail.ch> writes:
>
>> * DONE Apple
>> ** TODO Banana
>>
>> ...instead of these:
>>
>> * baz Apple
>> ** foo Banana
>
> Confirmed.
>
> Currently, checkbox to todo keyword mapping is hard-coded in
> org-list-to-subtree.
>
> We may use something like
> [ ] -> (car org-not-done-keywords);
> [-] -> (car org-not-done-keywords);
> [X] -> (car org-done-keywords);

Fixed on main as I described.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=fcd38174500f9a18ee34ed8179a0e75c2892c8f5

If requested, we may also allow customization of the exact keywords to
be used during the conversion.

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

Fixed.


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

* Re: [BUG] org-toggle-headline inserts "TODO" regardless of local definitions [9.5 (9.5-g0a86ad @ /home/rasmus/.emacs.d/elpa/org-9.5/)]
  2021-10-17 17:53   ` Tim Cross
@ 2022-10-08  4:48     ` Ihor Radchenko
  0 siblings, 0 replies; 5+ messages in thread
From: Ihor Radchenko @ 2022-10-08  4:48 UTC (permalink / raw)
  To: Tim Cross; +Cc: emacs-orgmode

Tim Cross <theophilusx@gmail.com> writes:

> I do wonder if the doc string for org-toggle-heading needs updating. It
> makes no reference to making a list item a todo heading if it looks like
> a todo item. I was actually surprised that org-toggle-heading adds
> keywords at all. While headings and todo items are certainly related, my
> expectation would be that a function called org-toggle-heding would do
> just that - add stars if none exist and remove them if they do. I would
> not necessarily expect a list item to be converted to a todo heading,
> only a heading. 

I now added the relevant explanation to the docstring.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=ae028d0a2546eea90fdb3d8d84b084bcb03f0d9c

Note that I do find the checkbox/TODO conversion logical.

We may, of course, add a customization for this behaviour if sufficient
interest is present.

-- 
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] 5+ messages in thread

end of thread, other threads:[~2022-10-08  4:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-17 14:06 [BUG] org-toggle-headline inserts "TODO" regardless of local definitions [9.5 (9.5-g0a86ad @ /home/rasmus/.emacs.d/elpa/org-9.5/)] autofrettage
2021-10-17 14:23 ` Ihor Radchenko
2021-10-17 17:53   ` Tim Cross
2022-10-08  4:48     ` Ihor Radchenko
2022-10-08  4:43   ` Ihor Radchenko

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.