emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Checkboxes in headings - opinions wanted
@ 2021-05-03  7:00 Arthur Miller
  2021-05-03  8:32 ` Bastien
  2021-05-03 15:50 ` Russell Adams
  0 siblings, 2 replies; 9+ messages in thread
From: Arthur Miller @ 2021-05-03  7:00 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: org-heading-checkbox.el --]
[-- Type: application/emacs-lisp, Size: 4104 bytes --]

[-- Attachment #2: Type: text/plain, Size: 854 bytes --]


Last night I have been playing with a minor mode to enable a checkbox in
a heading, or rather to fake a checkbox. To be honest, it was a 10
minute job. Took me way moare time to figure out avialable key
combination to use (which I didn't found).

In general, enable mode and use S+up/down to toggle a checkbox. A
heading with a checkbox is of form [ \t]*\\*+.*? followed by a [ ] or
[x] before a heading. It means a [ ] can be placed somewhere after the
leading stars, whitespaces ignored.

This has nothing todo with my previous hacks of todo keywords. This one
does not uses todo states at all so it can be used with todo states.

It is just a small prototype. I will use something else than
replace-string later on.

Just wonder if the approach is sane.

There is also a repo on gh for interested one:

https://github.com/amno1/org-heading-checkbox 

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

* Re: Checkboxes in headings - opinions wanted
  2021-05-03  7:00 Checkboxes in headings - opinions wanted Arthur Miller
@ 2021-05-03  8:32 ` Bastien
  2021-05-03  8:42   ` Timothy
  2021-05-03 15:21   ` Arthur Miller
  2021-05-03 15:50 ` Russell Adams
  1 sibling, 2 replies; 9+ messages in thread
From: Bastien @ 2021-05-03  8:32 UTC (permalink / raw)
  To: Arthur Miller; +Cc: emacs-orgmode

Hi Arthur,

Arthur Miller <arthur.miller@live.com> writes:

> Last night I have been playing with a minor mode to enable a checkbox in
> a heading, or rather to fake a checkbox.

Interesting, thanks.

For now you can use statistics cookies in headline:
https://orgmode.org/manual/Checkboxes.html

What would perhaps make sense would be to support [ ]/[X] on top of
the already supported [0%]/[100%] and [0/n]/[n/n].

What do you think?  (I tried your mode and unless I didn't try it
correctly, it does not seem to do that.)

Thanks,

-- 
 Bastien


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

* Re: Checkboxes in headings - opinions wanted
  2021-05-03  8:32 ` Bastien
@ 2021-05-03  8:42   ` Timothy
  2021-05-03 15:25     ` Arthur Miller
  2021-05-03 15:21   ` Arthur Miller
  1 sibling, 1 reply; 9+ messages in thread
From: Timothy @ 2021-05-03  8:42 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode, Arthur Miller


Bastien <bzg@gnu.org> writes:
> For now you can use statistics cookies in headline:
> https://orgmode.org/manual/Checkboxes.html
>
> What would perhaps make sense would be to support [ ]/[X] on top of
> the already supported [0%]/[100%] and [0/n]/[n/n].

I've always used
* TODO heading [/]

as a substitute for
+ [  ] task [/]

Other than it not automatically switching to done upon reaching 100%,
I've been pretty happy with this.

Just my 2c.

--
Timothy


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

* Re: Checkboxes in headings - opinions wanted
  2021-05-03  8:32 ` Bastien
  2021-05-03  8:42   ` Timothy
@ 2021-05-03 15:21   ` Arthur Miller
  2021-05-04  3:18     ` Ihor Radchenko
  1 sibling, 1 reply; 9+ messages in thread
From: Arthur Miller @ 2021-05-03 15:21 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2307 bytes --]

Bastien <bzg@gnu.org> writes:

> Hi Arthur,
>
> Arthur Miller <arthur.miller@live.com> writes:
>
>> Last night I have been playing with a minor mode to enable a checkbox in
>> a heading, or rather to fake a checkbox.
>
> Interesting, thanks.
>
> For now you can use statistics cookies in headline:
> https://orgmode.org/manual/Checkboxes.html
>
> What would perhaps make sense would be to support [ ]/[X] on top of
> the already supported [0%]/[100%] and [0/n]/[n/n].
>
> What do you think?  (I tried your mode and unless I didn't try it
> correctly, it does not seem to do that.)

Indeed, it does not do that :). It was explicitly designed to work
independently of TODO tasks/progress, so I can use it side by side with
TODO labels. With other words I just needed a plain old GUI-style
checkbox to indicate on/off value. As I understand stats checkboxes are
displaying progress based on TODO tasks and list checkboxes, so they can
not be used independently of TODO states. Maybe I am wrong, I never used
them to be honest, so I am not sure how much and what is possible there.

Anyway, I am not sure how interesting is this to a wider org-mode
community. Org-mode seems to be geared mostly toward process tracking
which is of course great for project and tasks tracking. However, I see
lots of useful things in org-mode outside of project tracking for some
other strucutured data. Example can be seen in attached screenshot from
my init file where I use org headings to form a list of packages to
install, and checkboxes to indicate if a package configuration is used
or not. 

I was able to re-purpose TODO keywords to act as checkboxes, the other
day, and it worked very well, I can "switch on/off states" with
S-left/right arrows, and I was able to disable initial and done states,
so arrows just shift between [x] and [ ] states. But that locks todo
states to this particular sequence. If I would like to be able to use
TODO states in their normal context, I can't. I needed a more "general
purpose" checkbox, so I wrote that small minor mode.

The biggest problem is, I am not sure how to connect a function per
checkbox in some convenient and simple to use way yet, I am still
thinking what would be the easiest way to add programmability, and I am
not sure why empty checkbox losses fontification.


[-- Attachment #2: screenshot.png --]
[-- Type: image/png, Size: 68255 bytes --]

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

* Re: Checkboxes in headings - opinions wanted
  2021-05-03  8:42   ` Timothy
@ 2021-05-03 15:25     ` Arthur Miller
  0 siblings, 0 replies; 9+ messages in thread
From: Arthur Miller @ 2021-05-03 15:25 UTC (permalink / raw)
  To: Timothy; +Cc: Bastien, emacs-orgmode

Timothy <tecosaur@gmail.com> writes:

> Bastien <bzg@gnu.org> writes:
>> For now you can use statistics cookies in headline:
>> https://orgmode.org/manual/Checkboxes.html
>>
>> What would perhaps make sense would be to support [ ]/[X] on top of
>> the already supported [0%]/[100%] and [0/n]/[n/n].
>
> I've always used
> * TODO heading [/]
>
> as a substitute for
> + [  ] task [/]
>
> Other than it not automatically switching to done upon reaching 100%,
> I've been pretty happy with this.
>
> Just my 2c.

I am affraid I am not that familiar with org-mode to note what you are
suggesting there :-). I am sorry, it is on my.

What I needed as I just wrote in answer to Bastien, is something
independent of TOTO states, so I can use it side by side with TODO
labels. I am not sure how your proposal fits into that, but that is
mostly because I am really not very good with org-mode.


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

* Re: Checkboxes in headings - opinions wanted
  2021-05-03  7:00 Checkboxes in headings - opinions wanted Arthur Miller
  2021-05-03  8:32 ` Bastien
@ 2021-05-03 15:50 ` Russell Adams
  2021-05-03 18:28   ` Arthur Miller
  1 sibling, 1 reply; 9+ messages in thread
From: Russell Adams @ 2021-05-03 15:50 UTC (permalink / raw)
  To: emacs-orgmode

Arthur,

Could you just use unicode checkbox symbols instead of TODO and DONE?

https://kdr2.com/tech/emacs/1405-orgmode-checkbox-unicode.html

That ought to be just a string, and need no patch.

On Mon, May 03, 2021 at 09:00:40AM +0200, Arthur Miller wrote:

>
> Last night I have been playing with a minor mode to enable a checkbox in
> a heading, or rather to fake a checkbox. To be honest, it was a 10
> minute job. Took me way moare time to figure out avialable key
> combination to use (which I didn't found).
>
> In general, enable mode and use S+up/down to toggle a checkbox. A
> heading with a checkbox is of form [ \t]*\\*+.*? followed by a [ ] or
> [x] before a heading. It means a [ ] can be placed somewhere after the
> leading stars, whitespaces ignored.
>
> This has nothing todo with my previous hacks of todo keywords. This one
> does not uses todo states at all so it can be used with todo states.
>
> It is just a small prototype. I will use something else than
> replace-string later on.
>
> Just wonder if the approach is sane.
>
> There is also a repo on gh for interested one:
>
> https://github.com/amno1/org-heading-checkbox



------------------------------------------------------------------
Russell Adams                            RLAdams@AdamsInfoServ.com

PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/

Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3


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

* Re: Checkboxes in headings - opinions wanted
  2021-05-03 15:50 ` Russell Adams
@ 2021-05-03 18:28   ` Arthur Miller
  0 siblings, 0 replies; 9+ messages in thread
From: Arthur Miller @ 2021-05-03 18:28 UTC (permalink / raw)
  To: emacs-orgmode

Russell Adams <RLAdams@AdamsInfoServ.Com> writes:

> Arthur,
>
> Could you just use unicode checkbox symbols instead of TODO and DONE?
>
> https://kdr2.com/tech/emacs/1405-orgmode-checkbox-unicode.html
>
> That ought to be just a string, and need no patch.

No, I am sorry, that is completely off.

I have done this minor mode to make it independent of TODO states. Just
replacing TODO and DONE (as I already did as described in other thread 2
days ago), is effectively locking TODO to ack as checkboxes. I would
like to be able to use TODO states together with a checkbox,
independently of each other, so no, I need something more general then
just renamed todo states.

Also unicode will depend on some font to be installed, I don't want to pay
that dependency, since I am using this for my init file.

By the way, this is not a patch, this is a small minor mode that can be
installed and enabled/disabled like an extra package.

By the way, there is a widghet.el library included in Emacs, if I wanted
to use checkboxes as in screenshot there, I could use that library, but
that would be much more involved than those few lines to write the code
I attached in first mail.

> On Mon, May 03, 2021 at 09:00:40AM +0200, Arthur Miller wrote:
>
>>
>> Last night I have been playing with a minor mode to enable a checkbox in
>> a heading, or rather to fake a checkbox. To be honest, it was a 10
>> minute job. Took me way moare time to figure out avialable key
>> combination to use (which I didn't found).
>>
>> In general, enable mode and use S+up/down to toggle a checkbox. A
>> heading with a checkbox is of form [ \t]*\\*+.*? followed by a [ ] or
>> [x] before a heading. It means a [ ] can be placed somewhere after the
>> leading stars, whitespaces ignored.
>>
>> This has nothing todo with my previous hacks of todo keywords. This one
>> does not uses todo states at all so it can be used with todo states.
>>
>> It is just a small prototype. I will use something else than
>> replace-string later on.
>>
>> Just wonder if the approach is sane.
>>
>> There is also a repo on gh for interested one:
>>
>> https://github.com/amno1/org-heading-checkbox

>
>
> ------------------------------------------------------------------
> Russell Adams                            RLAdams@AdamsInfoServ.com
>
> PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/
>
> Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3


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

* Re: Checkboxes in headings - opinions wanted
  2021-05-03 15:21   ` Arthur Miller
@ 2021-05-04  3:18     ` Ihor Radchenko
  2021-05-04 10:47       ` Arthur Miller
  0 siblings, 1 reply; 9+ messages in thread
From: Ihor Radchenko @ 2021-05-04  3:18 UTC (permalink / raw)
  To: Arthur Miller; +Cc: Bastien, emacs-orgmode

Arthur Miller <arthur.miller@live.com> writes:
> ... Example can be seen in attached screenshot from
> my init file where I use org headings to form a list of packages to
> install, and checkboxes to indicate if a package configuration is used
> or not. 

Depending on details of your workflow, you might also use
org-toggle-comment for indication of configuration usage. As a bonus, if
you use literate config, commenting the heading will also disable
tangling for that heading.

Ihor
Best,



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

* Re: Checkboxes in headings - opinions wanted
  2021-05-04  3:18     ` Ihor Radchenko
@ 2021-05-04 10:47       ` Arthur Miller
  0 siblings, 0 replies; 9+ messages in thread
From: Arthur Miller @ 2021-05-04 10:47 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Bastien, emacs-orgmode

Ihor Radchenko <yantar92@gmail.com> writes:

> Arthur Miller <arthur.miller@live.com> writes:
>> ... Example can be seen in attached screenshot from
>> my init file where I use org headings to form a list of packages to
>> install, and checkboxes to indicate if a package configuration is used
>> or not. 
>
> Depending on details of your workflow, you might also use
> org-toggle-comment for indication of configuration usage. As a bonus, if
Actually I am thinking of re-purposing TODO for "pin to repository"
purpose, so that is why I needed a more general checkbox independent of
TODO states. I am using planning on using tags for some other stuff.

> you use literate config, commenting the heading will also disable
> tangling for that heading.
>
I don't use tangling
from org-mode, I tangle all code myself. I have written a small
optimizer so I am generating actual init file from the literal config,
it is a small application in org-mode. You can see hacked TODO (per
file) in "Generator" section below the ";; og hacks" comment of
init.org, if you are interested.

https://github.com/amno1/.emacs.d



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

end of thread, other threads:[~2021-05-04 10:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-03  7:00 Checkboxes in headings - opinions wanted Arthur Miller
2021-05-03  8:32 ` Bastien
2021-05-03  8:42   ` Timothy
2021-05-03 15:25     ` Arthur Miller
2021-05-03 15:21   ` Arthur Miller
2021-05-04  3:18     ` Ihor Radchenko
2021-05-04 10:47       ` Arthur Miller
2021-05-03 15:50 ` Russell Adams
2021-05-03 18:28   ` Arthur Miller

Code repositories for project(s) associated with this 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 NNTP newsgroup(s).