emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: Vikas Rawal <vikaslists@agrarianresearch.org>
Cc: orgmode <emacs-orgmode@gnu.org>
Subject: Re: org-sort random
Date: Sun, 21 Nov 2021 22:12:34 -0500	[thread overview]
Message-ID: <87zgpwrihp.fsf@kyleam.com> (raw)
In-Reply-To: <20211122021035.dwa7thm7gmhwoagx@dalkati>

On 11/22/21 07:40:35 +0530, Vikas Rawal wrote:
> I am trying to sort a sub-tree of headings randomly. But `C-c ^ f
> random RET` asks for a "function for comparing keys". What am I
> supposed to do?

Here's the prompt:

  Function for comparing keys (empty for default `sort-subr' predicate):

And here's what sort-subr's docstring says about the behavior of the
default predicate:

  If PREDICATE is nil, comparison is done with ‘<’ if
  the keys are numbers, with ‘compare-buffer-substrings’ if the
  keys are cons cells (the car and cdr of each cons cell are taken
  as start and end positions), and with ‘string<’ otherwise.

That sounds like that should handle random's return value fine, so try
entering an empty string at that prompt.


  reply	other threads:[~2021-11-22  3:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-22  2:10 org-sort random Vikas Rawal
2021-11-22  3:12 ` Kyle Meyer [this message]
     [not found]   ` <CAFVt51+4Y9njvdS-UZFVWXjr=M933QpUpDrGhD0GcHMmpQYhPw@mail.gmail.com>
2021-11-23  5:08     ` Kyle Meyer
2021-11-23 15:14       ` Vikas Rawal
2021-11-24  1:52         ` Samuel Wales
2021-11-24  1:55           ` Samuel Wales

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=87zgpwrihp.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=vikaslists@agrarianresearch.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).