From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 3PXpL9IKm2HFUQAAgWs5BA (envelope-from ) for ; Mon, 22 Nov 2021 04:13:22 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id CCj/KtIKm2HfEQAAB5/wlQ (envelope-from ) for ; Mon, 22 Nov 2021 03:13:22 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 628AE3770B for ; Mon, 22 Nov 2021 04:13:22 +0100 (CET) Received: from localhost ([::1]:42258 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mozlh-00086f-45 for larch@yhetil.org; Sun, 21 Nov 2021 22:13:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49756) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mozlA-0007wi-30 for emacs-orgmode@gnu.org; Sun, 21 Nov 2021 22:12:48 -0500 Received: from out2.migadu.com ([188.165.223.204]:22625) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mozl6-0000Fv-9j for emacs-orgmode@gnu.org; Sun, 21 Nov 2021 22:12:47 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1637550756; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iibjuDUk5mGLcF805Lmn4yqAoVfKxV65btaZECcFRxs=; b=gCSioR+g8p51CsxPZSQjpnhMu/U6RGfegfGdcpdq2pBl2JqlXBH7DYFUArfZaTcZ4B3OQG lA+IQVmbTvMNqjyAYFHuI9csWk4gaZGdWTqOmZPBrJ17Ut9Occ/AKOPuNb8GVVeFVvKF36 hNFsZjVjG9UmXpFfgZoDPumqSHcCtDnL0xHyIGSnQlaq6mRqoiYf8K+1BA8Q4iPYZyWMO1 VT7ZUU9W+S71MnJgRdogLFd+Bmm3mo9a9rtzjg3n4xZAUSbinTIqWOnk0vwkELqEO69iM5 4Fzs5BXh3MpDWDJYP3/aqYcvYoby/47gblonTgY3fJGJHpAFF21X1yNdiKHgiQ== From: Kyle Meyer To: Vikas Rawal Subject: Re: org-sort random In-Reply-To: <20211122021035.dwa7thm7gmhwoagx@dalkati> References: <20211122021035.dwa7thm7gmhwoagx@dalkati> Date: Sun, 21 Nov 2021 22:12:34 -0500 Message-ID: <87zgpwrihp.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=188.165.223.204; envelope-from=kyle@kyleam.com; helo=out2.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: orgmode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1637550802; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=iibjuDUk5mGLcF805Lmn4yqAoVfKxV65btaZECcFRxs=; b=WpHDeTXiAKZtBUIrH5LAm6jJeHWcpfYBP4npzj3Dik7oQpPYsF8CeK8ek/KETDLe8SHvD+ TX9gDfuvg4akmmcDl3FN6ArmS2crcSKb8u+CRUVKLBFgSqjOgciJh1Lci2aki6YPz95flD 4rCNppnCmVs+MKsm+wszkiX4Pk6CX113Y7XPDTBf7cppilFU0t+M4n8aR/B+qKXmrZuJw8 ZuXE6Mz/mF9/qoTZZ3/xudcUcTKzZLR+rIZqcBnINCfmfjQKQcwGJwmQ4MObodRsD6vd2I qTUb1WxAWzFTnQt85nALioVuIHDPcIzcYMLwhf6quv24F4jLXvr/ULtE8kH53g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1637550802; a=rsa-sha256; cv=none; b=fQgudNlKsHbOK4lmwW1YfN/7miCMUD7EXNB6x7LMkijxKW21yXQCS6eMwrVrpO8fdg3hjz gbgGpy335NThzfjuGiHUris83JnR8nEenW6d8blq1MqjWQ+LSXXG8eaS8/239mYz+6uw4R fstYY8uxmZ1X4NGl2lfRVuXLRLXm+oWQB4fBdY9gcPKSUCOHCZYMutdR115IUvWZ4zprto x8WCQa1x7hOS731K5Rxs22FbaqfzArlU3EpMfYYaUi3X1W1aJ5u1g5HpYj6jcmdHQbjbdl AdsSwU4/BL0UWzb2K0q1jA0PQ6iklGk65zoebUaub/PE+22yEPEXeIyIkChF7w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=kyleam.com header.s=key1 header.b=gCSioR+g; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.58 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=kyleam.com header.s=key1 header.b=gCSioR+g; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 628AE3770B X-Spam-Score: -3.58 X-Migadu-Scanner: scn1.migadu.com X-TUID: lI1zdSxA+nYB 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 =E2=80=98<=E2=80=99 if the keys are numbers, with =E2=80=98compare-buffer-substrings=E2=80=99 if= the keys are cons cells (the car and cdr of each cons cell are taken as start and end positions), and with =E2=80=98string<=E2=80=99 otherwise. That sounds like that should handle random's return value fine, so try entering an empty string at that prompt.