emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Cletip Cletip <clement020302@gmail.com>
To: Ihor Radchenko <yantar92@gmail.com>
Cc: "Daniel Fleischer" <danflscr@gmail.com>,
	"Juan Manuel Macías" <maciaschain@posteo.net>,
	orgmode <emacs-orgmode@gnu.org>
Subject: Re: Have all the tags of a heading, with a tag hierarchy
Date: Fri, 2 Sep 2022 14:47:02 +0200	[thread overview]
Message-ID: <CAPHku6PQJERHT7f32d9z1CJMKEf3BW4qZOkNzJOmy3TNUZNOZA@mail.gmail.com> (raw)
In-Reply-To: <87fshbo9s5.fsf@localhost>

[-- Attachment #1: Type: text/plain, Size: 1419 bytes --]

Ok thanks a lot for your answers, I made the function, if ever it can
interest someone one day


(defun org-get-tags-with-hierarchy-at-point()
      "Return the list of tag WITH the sub-tags if they exist at point"
      (interactive)
      (let ((tags-heading (org-get-tags))
            (tags-result '()))
        (dolist (tag tags-heading)
          (dolist (tag-to-add (org-tags-expand tag t))
            (push tag-to-add tags-result)
            )
          )
        (delete-dups tags-result)
        )
      )

Do not hesitate to change the "tags-heading" variable to select a different
heading

Thanks again for your answers !

Le jeu. 1 sept. 2022 à 09:03, Ihor Radchenko <yantar92@gmail.com> a écrit :

> Cletip Cletip <clement020302@gmail.com> writes:
>
> > Just one last clarification to be sure: there is no native function in
> > org-mode to have the list of tags with a hierarchy? I have to write my
> > function with the two functions
> > org-get-tags and org-tags-expand
> > to get the result I want : a list of tags that takes into account the
> > hierarchy defined by the "org-tag-alist" variable
>
> AFAIK, we have no such function.
>
> --
> Ihor Radchenko,
> 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
>

[-- Attachment #2: Type: text/html, Size: 2162 bytes --]

      reply	other threads:[~2022-09-02 12:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-28 15:37 Have all the tags of a heading, with a tag hierarchy Cletip Cletip
2022-08-28 16:21 ` Juan Manuel Macías
2022-08-28 16:34   ` Cletip Cletip
2022-08-28 19:15     ` Daniel Fleischer
2022-08-29 11:41       ` Cletip Cletip
2022-08-29 11:58         ` Ihor Radchenko
2022-08-31  9:01           ` Cletip Cletip
2022-08-31 11:25             ` Cletip Cletip
2022-08-31 11:31               ` Cletip Cletip
2022-09-01  7:04                 ` Ihor Radchenko
2022-09-02 12:47                   ` Cletip Cletip [this message]

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=CAPHku6PQJERHT7f32d9z1CJMKEf3BW4qZOkNzJOmy3TNUZNOZA@mail.gmail.com \
    --to=clement020302@gmail.com \
    --cc=danflscr@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=maciaschain@posteo.net \
    --cc=yantar92@gmail.com \
    /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).