GitXplorerGitXplorer
a

org-heading-checkbox

public
4 stars
0 forks
2 issues

Commits

List of commits on branch main.
Unverified
7ee293726b9a9fadcdd90373ea1b166aafb57f8f

Replaced string-replace with regex replace

aamno1 committed 4 years ago
Unverified
72ca116bd8e1bbb378d82db38b955b7345043384

Removed some rest code.

aamno1 committed 4 years ago
Unverified
a28da9c94af2f86f155c3183ecd01767a7159ca7

More readme updates.

aamno1 committed 4 years ago
Unverified
2cabd49697e9741ea8612cdd79b53e6963c58bb8

Edited readme file.

aamno1 committed 4 years ago
Unverified
872e9dec636ea27f2f82dbd457fe99f4aa2825cb

Edited readme file.

aamno1 committed 4 years ago
Unverified
d75023265c6239c71ff913564c996b58f12429b6

Initial commit.

aamno1 committed 4 years ago

README

The README file for this repository.
  • About

This package implements a minor mode to enable checkboxes in headings in style of org-mode checkboxes as used in lists. It is very light and simple.

This is not a package yet, but if I get good feedback on this one, I am thinking of making it into a Melpa package.

[[./screenshot2.png]]

[[./screenshot.png]]

  • Installation

To install either clone this repo, or just download org-heading-checkbox.el somewhere where your Emacs can find it. Alternatively you can also download it and install it with:

`M-x package-install-file'.

  • Usage

Enable the mode with M-x org-heading-checkbox-mode, or from lisp with:

#+begin_src emacs-lisp (org-heading-checkbox-mode 1) #+end_src

You could also add it to org-mode-hook:

#+begin_src emacs-lisp (add-hook 'org-mode-hook (lambda () (org-heading-checkbox-mode 1))). #+end_src

Create a heading with either "[ ]" or "[x]" after the leading stars, but beffore the heading text. Number of spaces after stars and before the heading itself does not matter. Now you have a heading with a checkbox. You can place point somewhere on the heading line, and use S+up/down to toggle the checkbox.

Currently S+up/down arrows are already bound by org-mode, but so is every other possible modifier or modifier combination. They have really seen to use every meaningful key combo for something in org, which leaves any third party or user with only option to overwrite something, or define own prefixes. I have done it so that keys will toggle on/off the checkbox when a heading has one, but when there is not one, it will just do whatever org-mode already does. But feel free to redefine keys to your liking.

Sometimes just having a graphical representation of something enabled or disabled is enough. But often times, we would also like something to happen when we disable or enable a checkbox. I haven't come to implement this functionality yet, it is on TODO list :). I have some thoughts on implementing this via text properties, but I haven't had time to test that idea yet.

However, there are two general hooks defined, which you can use in usual Emacs manner to add your own hooks which will be run when you toggle a checkbox. Yes it is very limited/awkward and inneficient, but it is possible to check some regex at point and do something based on that, but for now it is all there is to it.

If you manually place point between square braces and change char to something else than x or space, or even toggle the box, the heading will not be recognized as a checkbox heading. Depending on your point of view it is a feature or a bug.

  • Issues

This is a work in progress, both conceptually and implementation wise. Hooks per checkbox to be implemented maybe. Trees of headings are not implemented either. Probably lots of bugs in regard to other org-features. Feedback is welcome.

  • License

GPL v3, see [[file:LICENSE][featured License]] file for details.