[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] C-c ^ for plain lists? Why not?
From: |
James Harkins |
Subject: |
Re: [O] C-c ^ for plain lists? Why not? |
Date: |
Fri, 28 Dec 2012 03:27:00 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
Carsten Dominik <carsten.dominik <at> gmail.com> writes:
> Playing with this idea I noticed that the sorting function
> did not accept their additional arguments like sorting-key
> and get key-function in they way they should. So I patched
> them, to make the following work in the current master:
>
> (defun org-sort-list-by-checkbox-type ()
> "Sort list items according to Checkbox state."
> (interactive)
> (org-sort-list
> nil ?f
> (lambda ()
> (if (looking-at org-list-full-item-re)
> (cdr (assoc (match-string 3)
> '(("[X]" . 1) ("[-]" . 2) ("[ ]" . 3) (nil . 4))))
> 4))))
I finally had a chance to play with this -- works nicely, except I managed to
get emacs into an infinite loop this way:
1. C-c ^ f org-sort-list-by-checkbox-type
2. This puts the done items at the top, which I didn't want, so... C-c ^ F org-
sort-list-by-checkbox-type.
3. Emacs goes into a tailspin (recovered by C-g).
> I would think that
>
> checked - transitionary - unchecked - no box
>
> is a pretty decent default.
I disagree. I'd suggest unchecked - transitionary - checked - no box. It makes
more sense to pull the not-done items to the top, no?
But it's easy to modify the function for my environment. Thanks!!
hjh
- Re: [O] C-c ^ for plain lists? Why not?,
James Harkins <=