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 QAU+JxX8EWP2WAAAbAwnHQ (envelope-from ) for ; Fri, 02 Sep 2022 14:50:29 +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 OCAXJxX8EWP1kAAAauVa8A (envelope-from ) for ; Fri, 02 Sep 2022 14:50:29 +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 4C0AC15DBE for ; Fri, 2 Sep 2022 14:50:29 +0200 (CEST) Received: from localhost ([::1]:43642 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oU67u-0000wT-1i for larch@yhetil.org; Fri, 02 Sep 2022 08:50:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35532) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oU64x-0000Ke-Fh for emacs-orgmode@gnu.org; Fri, 02 Sep 2022 08:47:23 -0400 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]:35377) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oU64s-0008HF-RQ for emacs-orgmode@gnu.org; Fri, 02 Sep 2022 08:47:23 -0400 Received: by mail-ed1-x52e.google.com with SMTP id y64so2574969ede.2 for ; Fri, 02 Sep 2022 05:47:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=fwIglQg6XE0RRG9JoQUoi6ZVqeVlvdvXeslwUaIMcbU=; b=eEIjdLRDi4bmw6Vb3SXl5Y4PSYCvT0K/oJSykyYLKlFdPxxgjPZ7j/Y+BOUHcevi7q zBQ1WZrw2w1U2bZqc0S4yDmz8xL3ySphjjju9sxQEGAAcLddumRsOW/kJxYIN2O2joV4 82voKhPawcpoeZuIZ6W1ek0PgxMQL0GHdPAhitrgv9MJnnSYMoFpx4ThX8JqYUgZxjh1 uA6VROKhJ4JceQXpC5oc42z2un59abTrj9XPxRzvZFjN4lttLp2RcQ0fwhVchlZ4XtNX VyMP5InMl/nEvHKAHyBtkr9bQ2TwL53CZuyDp2N9HeEK9K+iyXUK4UqpJ48kqIlJtiyD 74gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=fwIglQg6XE0RRG9JoQUoi6ZVqeVlvdvXeslwUaIMcbU=; b=U/EvMTbhAPN3xjcZ6Qk+60fjsAonTC99zY7q0td6HIB6psoqPXZrl44iAvmK55EVAh hFWD8lbNUSGlLNitARhCFI1ikxZESRcgo7H1JlhdxGnOXIVDHTV8Q9nArfXe19aHEzMQ kYtiyysOVXW5L5N9HIMB0EeeyVDhvZB0kD1+PQD7msMtjvhasfCbeblfXsvdhjsxlCkH yRBp9lZ1GVWvVtXS8ZO1hlK1mp2hfnqGxugQAq/5mASpZQKfpjqmAtTmcl9vdVusZMHg 50VZaSkxrlhQQwQ/lIxaINBVOoo2/0TlikM1UcDJoFMnxCFfB6VkYpHhhbSF5F1IrxZe dGOA== X-Gm-Message-State: ACgBeo1hJhaWFU/DFINmFezs6RyQEvadj8qsEkpm1yMJl6aREW2loye/ tQCyEatLYBzfXYdm9AlMDgKGl/dS7HejFc02geKghebBv4m2sA== X-Google-Smtp-Source: AA6agR61lmiZFvVrPZCRK/POHVdnauyapexN/EwbN9JhOEpNTThrSTO74q2jB1FuRBoiTa+0L9i4nqsDixzlhycLGQ4= X-Received: by 2002:a05:6402:50d1:b0:448:982a:12d0 with SMTP id h17-20020a05640250d100b00448982a12d0mr18328097edb.344.1662122833657; Fri, 02 Sep 2022 05:47:13 -0700 (PDT) MIME-Version: 1.0 References: <87fshgnxss.fsf@posteo.net> <87bks3qn1w.fsf@localhost> <87fshbo9s5.fsf@localhost> In-Reply-To: <87fshbo9s5.fsf@localhost> From: Cletip Cletip Date: Fri, 2 Sep 2022 14:47:02 +0200 Message-ID: Subject: Re: Have all the tags of a heading, with a tag hierarchy To: Ihor Radchenko Cc: Daniel Fleischer , =?UTF-8?Q?Juan_Manuel_Mac=C3=ADas?= , orgmode Content-Type: multipart/alternative; boundary="00000000000012c41905e7b12130" Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=clement020302@gmail.com; helo=mail-ed1-x52e.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, HTML_MESSAGE=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=1662123029; 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=fwIglQg6XE0RRG9JoQUoi6ZVqeVlvdvXeslwUaIMcbU=; b=fiLEwUzx+2jNwuS9LbGzRLTQAV2FjchoXHEaUV/2whYj7OflLsogFHvRS8omI0tR6Tt8zT uC/+3opgKX2KOXnFdUlCBFdC9CbTmK4C3/idVRN2SWcw9WpvOxnvPrI+UAT+adtb5dyFOh jlkNxL/tKYzUOvG7zIlIIUVjY8sboB884XgaWPc53i0xZvW+t24ntU8f+5xS8aq9VF0eYv tjkLaQtnI36lAJ5LZXukbxEjY0HCqg3Uor1lIU5lOqeyaaSIzgASkkh/yekYeJuRNgKcaL bfB3elQtsLC5hD+aN8V6ZH5YnJ9TAxn25u6vh0B5crtyOwJB6dH2FUzRrbyhyg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1662123029; a=rsa-sha256; cv=none; b=iZm4GD9lG1rMljeXS5GkoItUCFz8KhOoHJX858rsjDj6ZKUsWb0Uq1CgO5LEPjcPLHGnXV dfkTGcc5gUaQ0AKfvxvUv0lN0xsqeSrjSUqQEzcYvuUWfvc1guzUI/ocghRaJ294uhSlPj ymjnmzNXNP9kmx3alCVdwA3rEV+XgJlHeWWhWRzvGGSE/ZldmeD3kPZVmt1jLT+dlAQ03n AUf7vYR7Tcl2hUl7aZqLKOu+QLNb/V+VT63FXpwxBTHuFfscC1gc3HIVh5PToEkOX6S2xW kp9sNO7xIueEDCJJouSnThcq9yl2pjalRWN16/YCrSm0RCu6SjZvs2VIKaK6oA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=eEIjdLRD; 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: -2.27 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=eEIjdLRD; 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: 4C0AC15DBE X-Spam-Score: -2.27 X-Migadu-Scanner: scn1.migadu.com X-TUID: N5RY9moMKE+h --00000000000012c41905e7b12130 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 =C3=A0 09:03, Ihor Radchenko a = =C3=A9crit : > Cletip Cletip 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 > --00000000000012c41905e7b12130 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Ok thanks a lot for your answers, I made the function, if = ever it can interest someone one day


(defun org-get-tags-with-hi= erarchy-at-point()
=C2=A0 =C2=A0 =C2=A0 "Return the list of tag WIT= H the sub-tags if they exist at point"
=C2=A0 =C2=A0 =C2=A0 (intera= ctive)
=C2=A0 =C2=A0 =C2=A0 (let ((tags-heading (org-get-tags))
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (tags-result '()))
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 (dolist (tag tags-heading)
=C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 (dolist (tag-to-add (org-tags-expand tag t))
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 (push tag-to-add tags-result)
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 )
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 )
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 (delete-dups tags-result)
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 )
=C2=A0 =C2=A0 =C2=A0 )

Do not hesitate to change the &qu= ot;tags-heading" variable to select a different heading

Thanks = again for your answers !

Le=C2=A0jeu. 1 sept. 2022 =C3=A0=C2=A009:03, Ihor R= adchenko <yantar92@gmail.com&g= t; a =C3=A9crit=C2=A0:
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<= br> > 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
--00000000000012c41905e7b12130--