From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 8ELcCRxt1GZgDgEA62LTzQ:P1 (envelope-from ) for ; Sun, 01 Sep 2024 13:33:16 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id 8ELcCRxt1GZgDgEA62LTzQ (envelope-from ) for ; Sun, 01 Sep 2024 15:33:16 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=LrTch95D; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1725197596; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=XwVTtSQn/wChSUwUKWOULnSmCgpLXuGEaqX2d6DASZs=; b=mxK0kBXZ+haXPa4mtAMKIAYxEKzeeLm1kbARxZ/1TNt+XeIzXnP55xJDNPmbF1eeIO/Rpo yeo0WUAMkrg0xGsZGS2E58ipVIwCeO5hYIhHT/R9hXGuIuNzuC7YiJ6UTv5CBguXFrmX9Z ifBEZTjgiqFS5nke3av7H2VbzS93EUx6rJlrUNJcsk8anCqUX6a6Exnxo+n7lvBYcP9BxJ hlqFdfT1hbWKqG1JeMQz1AypJ5D4I7uU6ksVFkvozp3n++JEgZXwk9vBud81Q/uTCG63N2 bRsuWSr8oL7ZauW7aHeYKpU0hLLCK9ESpYa1cyAHjHm7eWhpIZ8kwjliCd0NSw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1725197596; a=rsa-sha256; cv=none; b=j//9N47NErqNM8NRK7knDVhUH+sI0MiRW23kpX8e5/8cxDfKkbvmuD7aGR0i559APKNiDo hZR9bnZAransT6W/oMqJgos3Z13327BQ5Dzkj2XAtvhmqP5DpdOWBGHCNKwSfGL5LE78sR KMhRqrN3WhSIgvJ4Y5UHOw/84e4N0FKKWauKtpYb5u4sw2cpiFMNTgeDfZqN7I01e1tEfR Jw3w2PsjJZFmxEwMTlCeBHdTNcwbaqbK5meNmrRJYL85tuWeZeVa17RFRJvPsbaxPxDKFu yVaZqLBBJ18TVd0h47Eb6LPFWN37XOu81JgB2IKpoDM0toNnT24EfWkgoJzrFg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=LrTch95D; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" 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 F00F8778B5 for ; Sun, 01 Sep 2024 15:33:15 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1skkgg-0004Wa-9I; Sun, 01 Sep 2024 09:32:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1skkgf-0004WC-2F for emacs-orgmode@gnu.org; Sun, 01 Sep 2024 09:32:13 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1skkgd-0004BC-2n for emacs-orgmode@gnu.org; Sun, 01 Sep 2024 09:32:12 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id A48D3240028 for ; Sun, 1 Sep 2024 15:32:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1725197528; bh=PNI8Sh0rnvqKmz++3SAd0c52QObsPL9JLadv6ia/gPM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=LrTch95DRFSBukfCsG3E5OeL2tX7ROYZ9zwx7Y/yQxDQTYkTp2OjoiwADr1nz3mB7 TVTKxGNm/eJRsTImWW4XlQ8/+PZtkk9Pn9BHY7VfnajEIRO/zRbmcyCaYT+DCZ77W1 j8m6Jz7ka0duQ9SicRXKhU4v3MNL474xby4LtAVW85vGZnlB03suYTzYIvybGzfvRF M7D3fdt3pkdYOfkWIH9bDU4Xl7GLAlMduqAVuimtElbIRwxGBHuLRl0pKqcNUcxDw1 +4hYBS7wdxnuAIDlLaCgnfxwdUF2zpha8rCQ5/G67WDGBJD7JOg2txpjM2gBbFdj09 HMdFcuUdtAr0w== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WxXqW6RQTz9rxG; Sun, 1 Sep 2024 15:32:07 +0200 (CEST) From: Ihor Radchenko To: Morgan Smith Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] Testing: Add tests for `org-tags-sort-function' In-Reply-To: References: Date: Sun, 01 Sep 2024 13:33:32 +0000 Message-ID: <8734mj8pn7.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -6.70 X-Spam-Score: -6.70 X-Migadu-Queue-Id: F00F8778B5 X-Migadu-Scanner: mx11.migadu.com X-TUID: rIYww8Nf4VxF Morgan Smith writes: > diff --git a/testing/lisp/test-org-agenda.el b/testing/lisp/test-org-agenda.el > index 778f91e8e..c1092df3b 100644 > --- a/testing/lisp/test-org-agenda.el > +++ b/testing/lisp/test-org-agenda.el Thanks for the patch! > + ;; Sorting doesn't care about `org-tag-alist'. This is only > + ;; here for later when we add sorting methods that do > .... Then, please refrain from setting alist in this patch and add it later, when testing the relevant methods. > + (org-test-agenda-with-agenda > + (string-join > + '("* TODO group_a :group_a:" > + "* TODO tag_a_1 :tag_a_1:" > + "* TODO tag_a_2 :tag_a_2:" > + "* TODO tag_b_1 :tag_b_1:" > + "* TODO tag_b_2 :tag_b_2:" > + "* TODO groupless :groupless:" > + "* TODO lonely :lonely:") > + "\n") > + (dolist (org-tags-sort-function '(nil org-string< org-string>)) > + (should > + (string-equal > + (progn > + (org-agenda nil "f") > + (substring-no-properties (buffer-string))) > + (pcase org-tags-sort-function > + ;; TODO: a value of `nil' sorts it! That's not what the > + ;; customize menu of `org-tags-sort-function' says! It > + ;; says "No sorting". Right. When sort function is not set agenda specifically (but not other users of org-tags-sort-function) falls back to alphabetical sorting. In fact, the docstring does not at all mention that `org-tags-sort-function' is honored at all: (defcustom org-agenda-sorting-strategy ... ... tag-up Sort alphabetically by last tag, A-Z. tag-down Sort alphabetically by last tag, Z-A. We need to fix this docstring documenting `org-tags-sort-function', I think. > + ((or 'nil 'org-string<) > + "group_a\ngroupless\nlonely\ntag_a_1\ntag_a_2\ntag_b_1\ntag_b_2\n") > + ('org-string> > + "tag_b_2\ntag_b_1\ntag_a_2\ntag_a_1\nlonely\ngroupless\ngroup_a\n")))))))) Nitpick: it would be more readable to use `string-join' here as well. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at