From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id cGhgDcBqrGIFYgEAbAwnHQ (envelope-from ) for ; Fri, 17 Jun 2022 13:51:28 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 2BglDcBqrGLT+wAAauVa8A (envelope-from ) for ; Fri, 17 Jun 2022 13:51:28 +0200 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 BB12B11351 for ; Fri, 17 Jun 2022 13:51:27 +0200 (CEST) Received: from localhost ([::1]:37072 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o2AVa-0006Mu-AS for larch@yhetil.org; Fri, 17 Jun 2022 07:51:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38498) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o2ATa-0006MF-6o for emacs-orgmode@gnu.org; Fri, 17 Jun 2022 07:49:22 -0400 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]:45037) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o2ATY-00008E-Am for emacs-orgmode@gnu.org; Fri, 17 Jun 2022 07:49:21 -0400 Received: by mail-pg1-x532.google.com with SMTP id 31so3847141pgv.11 for ; Fri, 17 Jun 2022 04:49:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=/2B1am2Zb7Xf1Bc6GVRrY3ab3j6+q1bSfFTHg9xbOM4=; b=PH+k+HXfNid28z3+gDY6pXbM+G2NcJYQZKGqRO/wn5CpJC1mnGMyCQbsiteupsvGSN 6IxZg53s7MdlAz+OaJ5uAzGJXVj+fk0dDUDt5QHh+n8waLhIJanMHfyHVWtVqIGCyYdq LrE4928jNqE48CfOLfbu6pq0+kk9T//CkeuALkq32iQgXZJ6t4GerBigH77xO147UmoF B0o6/ho6RGVuuwRn4YwdPJ8MsP9pR9nyxYeYRwt18Hvcf7xDMM1GLHO8aa0CcgPI0ZQL Pa4b3dRCeazIw6JX+hIYhm51MDdL7F/bAQUDyeWmVbosOrwsfP8gOSUzM04PPBk+Wjqz q10A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=/2B1am2Zb7Xf1Bc6GVRrY3ab3j6+q1bSfFTHg9xbOM4=; b=Am3tN5gVILMiHXjX6H9UCCY8AlbwckBKfiIcksgAtdGYMb3J2Y6cgPAOl+WoiRuTRC aXvsfGj0vNMOAPPzjqic04aZy0QS6Ci4TxpliUDHMZ+eRhX8a5ZfVx5tYl0uXONPrkpD FoI2RyNvObVy1NVZadroikCIVhQQF/rp8GztrHVnGBQqs1fPJmfpyyWKO2APhIvXyzNF 0jLRbFIRozwPEz2Cgfy9KQT3QPVC9csOCW+sgjrtlExkEKHKcMMciZNu+iTHxA3atGPG tptMwkdyxNr5yux1Mt0Y5WoEDuD/cY6XHA5qgMDPQB87Qv7rj1lqUL826jLWK1lidN4m 9MbQ== X-Gm-Message-State: AJIora+pKoTZ4eaiuymwhkqavnyfhigv9Co0r6apXtjCh5q8q/kpkdXu mfDPD6JCEFawoTsXuZpTcyY= X-Google-Smtp-Source: AGRyM1tfPHJwIT4rmfkUQEWyoyq/gfrjcyYbzac2mWN7U7g4shMu/nhG3dLOMNgj8x+Kth+z58ye8A== X-Received: by 2002:a63:698a:0:b0:40c:4714:2425 with SMTP id e132-20020a63698a000000b0040c47142425mr3942086pgc.548.1655466556486; Fri, 17 Jun 2022 04:49:16 -0700 (PDT) Received: from localhost ([66.154.105.4]) by smtp.gmail.com with ESMTPSA id ms24-20020a17090b235800b001e270cc443dsm5406830pjb.46.2022.06.17.04.49.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jun 2022 04:49:15 -0700 (PDT) From: Ihor Radchenko To: Haakon HR Cc: emacs-orgmode@gnu.org Subject: Re: Agenda view sorting based on custom property In-Reply-To: References: Date: Fri, 17 Jun 2022 19:50:24 +0800 Message-ID: <87h74jjypr.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::532; envelope-from=yantar92@gmail.com; helo=mail-pg1-x532.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1655466688; 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=/2B1am2Zb7Xf1Bc6GVRrY3ab3j6+q1bSfFTHg9xbOM4=; b=MIXlxmNVZHl9ZA/u5fCKoik4zSYkb8zxtTk7NpQFCdDin4V3mJgdGgkO9SegYrgTxyINi3 a9YvW3k9s1JSz0A2FmtX+xTpD3LjPFIo/BDktnI8KXx+TUJ+WIWeJOGyvAMnuClYzIELdo jRnDRwEdgKcgjswRvWGF1Xu2NZw1eYevtGCBvmAIHiNsBH1t3VvEnmarT1OC/quJ98x3EW PnRjsIveu7PwX30TVcRt+JCgvdLHP8sbJtiOwAPkRija642KDgGvJ3RSKGjYVltNF5tLFK qFz06QmJWesUurZhoiN4iBUL3WDoZAuoFwnoYxrCAXIz9Oy2p+OHLfkzs22loQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1655466688; a=rsa-sha256; cv=none; b=IrSZ2c5+jmhz6mrMUO5lBEDGvzYN4YV06pzSRCERk6oSD3OP8wzBLNy/jJLb2vOZAZVD99 ISut6Vra/ozWlOx0zxEjoXmWu9nNya4pNT4Nd/3lCggxncPYAHGIq6zTKEnLMjXQ2aL6o2 HmjOyO47/RYkaOTTiA2fkKxPrM6Rrr9nExpEq6aVoAdf68CoZgOJMRp+2giTn0W39Jn1Rl ktNcRFcgFz5/0A2OBnMcwnUsKEXQlcC5Q9wwFkgICA8ailrkmXiei+AI9eeTZMW0CDIax7 /sfWt/cJ5Ttzz9eo2/uqKyAIeQWsel/htFW6K0ByJQuIpJUFvHVkfck/pLTe7Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=PH+k+HXf; dmarc=pass (policy=none) header.from=gmail.com; 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" X-Migadu-Spam-Score: -3.49 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=PH+k+HXf; dmarc=pass (policy=none) header.from=gmail.com; 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" X-Migadu-Queue-Id: BB12B11351 X-Spam-Score: -3.49 X-Migadu-Scanner: scn1.migadu.com X-TUID: E/h2kyMtzrGy Haakon HR writes: > I have tried a few approaches but I'm a bit stuck. My first approach was > to use the variable `org-agenda-cmp-user-defined' and implement a > comparison function based on the already existing ones like > `org-cmp-alpha' or `org-cmp-effort'. However, I'm not able to extract > the custom property from the kind of entry that is passed into the > comparison function, which seem to rely on `text-properties'. Is it > possible to somehow make custom properties available as a text property, > similar to things like 'todo-state, 'tags and so on? Yes. What you are looking for is 'org-hd-marker property. It holds marker to the position of the corresponding headline. Once you know the marker, you can simply (org-entry-get marker "CUSTOM") It does not matter that current buffer is not the Org buffer. Marker contains buffer information. Best, Ihor