From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 6PyvEAsS2V40DwAA0tVLHw (envelope-from ) for ; Thu, 04 Jun 2020 15:23:55 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id UBiQDAsS2V4NbAAAB5/wlQ (envelope-from ) for ; Thu, 04 Jun 2020 15:23:55 +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 73FAC940C03 for ; Thu, 4 Jun 2020 15:23:54 +0000 (UTC) Received: from localhost ([::1]:35874 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jgrii-0003A3-43 for larch@yhetil.org; Thu, 04 Jun 2020 11:23:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44306) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgrhx-00039g-EU for emacs-orgmode@gnu.org; Thu, 04 Jun 2020 11:23:05 -0400 Received: from mail-qv1-xf2f.google.com ([2607:f8b0:4864:20::f2f]:42430) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jgrhw-00033g-71 for emacs-orgmode@gnu.org; Thu, 04 Jun 2020 11:23:05 -0400 Received: by mail-qv1-xf2f.google.com with SMTP id p15so3083535qvr.9 for ; Thu, 04 Jun 2020 08:23:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gwTTtTUbt7CIANsDXUXUEkZSXbscELUo+xZle3O/Osk=; b=q1WsDsFBAyfXk+BJOfGR13N1ZI+5d1SAUug8szZuAlVBzmOWvqEk0WoeLA16qWFsOn wg2d6JGKxXkguY/Kc1R7PhbvhSS5RojS4ybi2rCt4evZXWofEmd6wkKiySyWHAtkSXqd V025/5T8XsJiQkyBqjxCvWhtUOPB7sFsLgtHSWoAPQRpRFz20xLvJbRvyOSBpf9REUym XrErmebO+5tOZhMT/KPtDNbPAFoGjwqBgyM2oHGgm+sRdkfpYUeJjd6bI7ymSfF/SCz+ 5q2kKPMq2M9yGZQsZazGdmHZzXiuqxxo4GBLOtCtBmBiuB7jwREfSYLoMUk89wXDxym7 7yYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gwTTtTUbt7CIANsDXUXUEkZSXbscELUo+xZle3O/Osk=; b=iSMhNx0PvQho9vX+/hm2TIf8u+4J90oZB/8dtn/4JevY4YaUycdfngCYeVmiMGl6pc lGbxX96/15OE9iuVc9Ef53QnlUt9fXSd880yqHO5zqmCgcXxjMieJ6QklJUhCy3oDnEg bXf3HDXQ/qYWeDGXFuP96GSt7b3jsojgrwO3PHpu1sgd11Wc+lw4KDVBiL8iCjKqazlr YDJCk4QWMvs6aEeXsXT5dOLFSfM9earLvfKTxbNWlFeSEqbUAGx/xMQnm3QKWJsqjKF3 1Q8rjcl/4jcWCOhJJj4rrEA/H+HyOwqpr3PY8Es+A8qzzXCfW5BQpQVlRCMg4o4gjWT2 4haQ== X-Gm-Message-State: AOAM532TldWb3I9V93Or40Ai88i85k/jTraEfszrsuV51bS71qOZI+v0 lmLCYDrZ8sFNNQD77x0BIk+oPCougQJjdtJC0CXjFw== X-Google-Smtp-Source: ABdhPJzdUCn7WNrcZm+4fg8YHkUg8fEyHCTURko294cf5DU5+KhzyKTi0dB0BaicE2vOCQcYUnwQUnbCzR+SLnuEGLI= X-Received: by 2002:a05:6214:6b2:: with SMTP id s18mr4877201qvz.135.1591284181929; Thu, 04 Jun 2020 08:23:01 -0700 (PDT) MIME-Version: 1.0 References: <87a71jwiyl.fsf@kyleam.com> In-Reply-To: <87a71jwiyl.fsf@kyleam.com> From: Budiman Snowman Date: Thu, 4 Jun 2020 22:22:48 +0700 Message-ID: Subject: Re: agenda-view: match tags: Sorting by number of tags matched? To: Kyle Meyer Content-Type: multipart/alternative; boundary="0000000000006692c905a743b8ed" Received-SPF: pass client-ip=2607:f8b0:4864:20::f2f; envelope-from=budimansnowman@gmail.com; helo=mail-qv1-xf2f.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=q1WsDsFB; dmarc=pass (policy=none) header.from=gmail.com; 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-Spam-Score: -0.61 X-TUID: E6docQMruLHo --0000000000006692c905a743b8ed Content-Type: text/plain; charset="UTF-8" On Thu, Jun 4, 2020 at 11:31 AM Kyle Meyer wrote: > Budiman Snowman writes: > > > Suppose I have this document: > > > > * topic1 :tag1:tag2:tag3: > > * topic2 :tag1:tag2:tag4: > > * topic3 :tag1:tag3:tag4: > > * topic4 :tag2:tag3:tag4: > > * topic5 :tag1:tag2: > > * topic6 :tag1:tag4: > > * topic7 :tag3:tag4: > > * topic8 :tag1: > > > > And I turn on org-agenda m, then search for tag1|tag3|tag4. Emacs will > then > > show the results (all entries match) in the above order. > > org-agenda-sorting-strategy is the main option that controls sorting in > the agenda. Going through the values there, I don't see anything > fitting your description. But there is a user-defined-{up,down} option > that lets you implement your own logic via org-agenda-cmp-user-defined. > Here's an example. It's probably brittle and inefficient in a number of > ways (and maybe completely wrong), but hopefully it gives you something > to start with. > Thanks! I'll play with it later. > * topic2 :tag1:tag2:tag4: > > * topic1 :tag1:tag2:tag3: > > * topic3 :tag1:tag3:tag4: > > * topic4 :tag2:tag3:tag4: > > * topic6 :tag1:tag4: > > * topic5 :tag1:tag2: > > * topic7 :tag3:tag4: > > * topic8 :tag1: > > Hmm, your example query is "tag1|tag3|tag4", so a few of those lines > seem off. For example, shouldn't topic 3 be at the top? Ah yes, I wrote incorrectly, I thought I wrote the query "tag1|tag2|tag4". You understood my goal perfectly. Regards, BS --0000000000006692c905a743b8ed Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: base64 PGRpdiBkaXI9Imx0ciI+PGRpdiBkaXI9Imx0ciI+T24gVGh1LCBKdW4gNCwgMjAyMCBhdCAxMToz MSBBTSBLeWxlIE1leWVyICZsdDs8YSBocmVmPSJtYWlsdG86a3lsZUBreWxlYW0uY29tIj5reWxl QGt5bGVhbS5jb208L2E+Jmd0OyB3cm90ZTo8YnI+PC9kaXY+PGRpdiBjbGFzcz0iZ21haWxfcXVv dGUiPjxibG9ja3F1b3RlIGNsYXNzPSJnbWFpbF9xdW90ZSIgc3R5bGU9Im1hcmdpbjowcH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