Re: Checkboxes in headings - opinions wanted

2021-05-04 Thread Arthur Miller
Ihor Radchenko  writes:

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




Re: Checkboxes in headings - opinions wanted

2021-05-03 Thread Ihor Radchenko
Arthur Miller  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,




Re: Checkboxes in headings - opinions wanted

2021-05-03 Thread Arthur Miller
Russell Adams  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 Adamsrlad...@adamsinfoserv.com
>
> PGP Key ID: 0x1160DCB3   http://www.adamsinfoserv.com/
>
> Fingerprint:1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3



Re: Checkboxes in headings - opinions wanted

2021-05-03 Thread Russell Adams
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 Adamsrlad...@adamsinfoserv.com

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

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



Re: Checkboxes in headings - opinions wanted

2021-05-03 Thread Arthur Miller
Timothy  writes:

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



Re: Checkboxes in headings - opinions wanted

2021-05-03 Thread Arthur Miller
Bastien  writes:

> Hi Arthur,
>
> Arthur Miller  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.



Re: Checkboxes in headings - opinions wanted

2021-05-03 Thread Timothy


Bastien  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



Re: Checkboxes in headings - opinions wanted

2021-05-03 Thread Bastien
Hi Arthur,

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



Checkboxes in headings - opinions wanted

2021-05-03 Thread Arthur Miller


org-heading-checkbox.el
Description: application/emacs-lisp

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