emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: James Harkins <jamshark70@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: C-c ^ for plain lists? Why not?
Date: Fri, 28 Dec 2012 03:27:00 +0000 (UTC)	[thread overview]
Message-ID: <loom.20121228T042256-316@post.gmane.org> (raw)
In-Reply-To: 540B116A-148E-46E5-94EA-5965B206613B@gmail.com

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

  parent reply	other threads:[~2012-12-28  3:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-08 14:41 C-c ^ for plain lists? Why not? James Harkins
2012-10-08 18:25 ` Nicolas Goaziou
2012-10-09  0:06   ` James Harkins
2012-10-09  7:58   ` Carsten Dominik
2012-10-27  7:57     ` Bastien
2012-12-28  3:27     ` James Harkins [this message]
2012-12-28 10:02       ` Bastien
2012-12-29  0:59         ` James Harkins
2012-12-29  5:04           ` Bastien
2012-10-11 17:48 ` François Pinard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20121228T042256-316@post.gmane.org \
    --to=jamshark70@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public 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 read-only IMAP folder(s) and NNTP newsgroup(s).