emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Morgan Smith <Morgan.J.Smith@outlook.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] lisp/org.el: Add ability to sort tags by hierarchy
Date: Sat, 15 Jun 2024 14:25:40 +0000	[thread overview]
Message-ID: <874j9ugu57.fsf@localhost> (raw)
In-Reply-To: <CH3PR84MB3424C03A7D026DC66E15DB14C5C32@CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM>

Morgan Smith <Morgan.J.Smith@outlook.com> writes:

> * lisp/org.el (org-tags-sort-hierarchy): New function.
> (org-tags-sort-function): Add new function to type.
> * testing/lisp/test-org.el (test-org/tags-sort-hierarchy): New test
> ---
>
> This is one of those things that I thought would be easy but then ended up
> hard.
>
> I wrote this so that items in my agenda would sort nicely.  Items tagged in the
> same hierarchy would end up next to each other.

> +  "Sort tags TAG1 and TAG2 by the tag hierarchy.
> +Sorting is done alphabetically.  This function is intended to be a value
> +of `org-tags-sort-function'."

Thanks for the patch, but may you please elaborate what kind of sorting
order does your function imply? In particular, I am wondering about the
ordering of tags from different groups? Also, what happens when there
are no tag groups defined? (These questions should be answered in the
docstring and the etc/ORG-NEWS entry you need to add, announcing the new
feature)

Also, sorting may not be alphabetical, depending on the value of
`org-sort-function'.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


  reply	other threads:[~2024-06-15 14:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-15 12:35 [PATCH] lisp/org.el: Add ability to sort tags by hierarchy Morgan Smith
2024-06-15 14:25 ` Ihor Radchenko [this message]
2024-08-28 15:39   ` Ihor Radchenko
2024-08-28 16:10     ` Morgan Smith
2024-09-01 16:23       ` Ihor Radchenko

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=874j9ugu57.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=Morgan.J.Smith@outlook.com \
    --cc=emacs-orgmode@gnu.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).