From: Ryan Thompson <rct@thompsonclan.org>
To: Carsten Dominik <carsten.dominik@gmail.com>
Cc: Org-Mode List <emacs-orgmode@gnu.org>,
"David A. Gershman" <dagershman_dgt@dagertech.net>
Subject: Re: org-sort-multi??
Date: Fri, 29 Jan 2010 08:51:50 -0800 [thread overview]
Message-ID: <2a4ba2fd1001290851q4b3a01d7sb6f9e0f00d67ae94@mail.gmail.com> (raw)
In-Reply-To: <3E25C708-CE63-40EB-B6F3-EFE9C62033A4@gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 2819 bytes --]
Hi.
Anyone can freely use any code I post here for any purpose, unless I
specifically say otherwise for a particular piece of code (I can't think of
any reason why would do this, though).
I've included the code for org-sort-multi below. Carsten is correct, it is
not an interactive function. In fact, it isn't really meant to be used
directly at all in its current form. I use it for defining specific custom
sort functions, of which I have also given an example below.
(defun org-sort-multi (&rest sort-types)
"Sort successively by a list of criteria.
For example, sort first by TODO status, then by priority, then by date, then
alphabetically, case-sensitive.
Each criterion is either a character or a cons pair (BOOL . CHAR), where
BOOL is whether or not to sort case-sensitively, and CHAR is one of the
characters defined in ``org-sort-entries-or-items''.
So, the example above could be accomplished with:
(org-sort-multi ?o ?p ?t (t . ?a))"
(mapc #'(lambda (sort-type)
(org-sort-entries-or-items
(car-safe sort-type)
(or (cdr-safe sort-type) sort-type)))
(reverse sort-types)))
(defun org-sort-custom ()
"Sort children of node by todo status and by priority, so the * TODO [#A]
items go to the top. Then fold it the way I like it."
(interactive)
(org-sort-multi ?o ?p ?T)
(dotimes (x 2) (org-cycle)))
On Fri, Jan 29, 2010 at 1:23 AM, Carsten Dominik
<carsten.dominik@gmail.com>wrote:
> Hi David,
>
> org-sort-multi is a utility function written by Ryan Thompson.
> So far it has not made it into Org-mode. I seem to
> remember that I did not have a convenient interactive
> interface for it, but I am not sure if I remember correctly.
>
> Another issue is that I am not sure if Ryan has signed the
> papers with the FSF, which would be required for this
> non-trivial change to Org.
>
> Why don't you take Ryan's function and play with it, check
> if it works for you, and if yes, try to convince me
> to add it to Org-mode..?
>
> Ryan, would you be willing to sign the papers with the FSF?
> Did I ask you that before?
>
> - Carsten
>
>
>
> On Jan 28, 2010, at 11:49 PM, David A. Gershman wrote:
>
>
>> Hello Again,
>>
>> I'm looking to sort my outline (headlines, top level) by multi criteria
>> (2 really). I see online references to 'org-sort-multi' as recently as
>> August 2009. But my emacs can't find it.
>>
>> Help?
>>
>> ----------------------------------------
>> David A. Gershman
>> gershman@dagertech.net
>> http://dagertech.net/gershman/
>> "It's all about the path!" --d. gershman
>>
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Please use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>
>
> - Carsten
>
>
>
>
[-- Attachment #1.2: Type: text/html, Size: 3881 bytes --]
[-- Attachment #2: Type: text/plain, Size: 201 bytes --]
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
prev parent reply other threads:[~2010-01-29 16:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-28 22:49 org-sort-multi?? David A. Gershman
2010-01-29 9:23 ` org-sort-multi?? Carsten Dominik
2010-01-29 16:51 ` Ryan Thompson [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2a4ba2fd1001290851q4b3a01d7sb6f9e0f00d67ae94@mail.gmail.com \
--to=rct@thompsonclan.org \
--cc=carsten.dominik@gmail.com \
--cc=dagershman_dgt@dagertech.net \
--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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.