From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>
Received: from mp11.migadu.com ([2001:41d0:2:4a6f::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms9.migadu.com with LMTPS
	id qCOYGUKfnWSeNQAASxT56A
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Thu, 29 Jun 2023 17:12:02 +0200
Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp11.migadu.com with LMTPS
	id sOGGGUKfnWTzMAEA9RJhRA
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Thu, 29 Jun 2023 17:12:02 +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 1C83C2430
	for <larch@yhetil.org>; Thu, 29 Jun 2023 17:12:02 +0200 (CEST)
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <emacs-orgmode-bounces@gnu.org>)
	id 1qEtIV-0005Br-FN; Thu, 29 Jun 2023 11:11:03 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ypuntot@gmail.com>) id 1qEtIS-00053z-FR
 for emacs-orgmode@gnu.org; Thu, 29 Jun 2023 11:11:00 -0400
Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <ypuntot@gmail.com>) id 1qEtIK-0003AS-KR
 for emacs-orgmode@gnu.org; Thu, 29 Jun 2023 11:11:00 -0400
Received: by mail-lf1-x135.google.com with SMTP id
 2adb3069b0e04-4fb761efa7aso1235532e87.0
 for <emacs-orgmode@gnu.org>; Thu, 29 Jun 2023 08:10:49 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1688051447; x=1690643447;
 h=in-reply-to:from:references:cc:to:content-language:subject
 :user-agent:mime-version:date:message-id:from:to:cc:subject:date
 :message-id:reply-to;
 bh=E6+KCX17yMAKTJcRT+/ztFxBDJkmNvI/aP8gxDwreoo=;
 b=IXv3pHMEUfsbyXkbBexViGkX9+feBzlvowOVcnmKL0gFki+Dtwb7pTobjSS56oDdS1
 IsuKHF5dtG8PFqq+okguZLSjdY1Sy3yUTclsqeuW0o0cJnr/+2rM8fIU5+Vbejh6DbfR
 Knt++IigH5kbFEkMePQYPGSS2cXH+gwhTChh05cMn6azzUeH56NphEIYDUwyKJi5L0yN
 mkvZdcfxDCB1inptX7PkA7mOdtwHMDYszmj2lQvf0We1gw8JfTO7OpvT5MEAqUlnzA2B
 lA0DM4H/r7w1CHAKyfq9t/r4va3OQ762XPeMifJM6+fDKfZOZgk7yIbEAZKd2pMwvxTv
 kWKA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1688051447; x=1690643447;
 h=in-reply-to:from:references:cc:to:content-language:subject
 :user-agent:mime-version:date:message-id:x-gm-message-state:from:to
 :cc:subject:date:message-id:reply-to;
 bh=E6+KCX17yMAKTJcRT+/ztFxBDJkmNvI/aP8gxDwreoo=;
 b=jVBEsMvQYBbGC5omteA3MVdCqFSXw+ZbFj/VOohtmSCP/TVfEj7U6iqji/6GX6RJzw
 Y5r0rU8nmSo4VANfQ3CWUTzhgwRgw1BrqtRfMOl+lYzPvFs3tXf9uiadEv0JHACIlu6G
 Q7rzJlsgJKmiE8aUBBCIwKH7RfeciyigL5IyDPTT6ZC6vESfvbb+pcXIqpWoupATQu3X
 WULG9zH4ETl9obsNPhZNwFHOao0RiRRvQ87jyyFSXNpafMZ2uCRW9haSUyQi2uQ3tQ+1
 H9hn+heqzEVblvVr3wEuy7lWULZBisX0u1k8PRzZrNx2ByTjIdmP6k9VksobhdQlZVQA
 zMCQ==
X-Gm-Message-State: ABy/qLaP/nBGx/TIyntI0mcmbMWV50PS6+Zvih3Xa+7wczFF7EaKt4UJ
 x+ssFAeunJixQ/WlhEqJdo2cEfpaX0k=
X-Google-Smtp-Source: APBJJlFg5ApXSnaNyyhVYeCejYyAdp0185lSspVQi8JcI0uM164otSmJfIkdSlNsRq+WfKy/lMM24A==
X-Received: by 2002:a05:6512:2243:b0:4fb:8de9:ac13 with SMTP id
 i3-20020a056512224300b004fb8de9ac13mr187154lfu.23.1688051446629; 
 Thu, 29 Jun 2023 08:10:46 -0700 (PDT)
Received: from [192.168.1.111] (59.82-130-209.dynamic.clientes.euskaltel.es.
 [82.130.209.59]) by smtp.gmail.com with ESMTPSA id
 a10-20020adfeeca000000b00314103d6daesm3609371wrp.47.2023.06.29.08.10.46
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Jun 2023 08:10:46 -0700 (PDT)
Content-Type: multipart/alternative;
 boundary="------------ff80FDWTFXBkAhkryyZMAwk0"
Message-ID: <b1e16e94-7356-6592-f0ac-bd7b929c7982@gmail.com>
Date: Thu, 29 Jun 2023 17:10:45 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
 Thunderbird/91.13.1
Subject: Re: org-todo-state-tags-triggers not working with regexp?
Content-Language: en-GB
To: Ihor Radchenko <yantar92@posteo.net>
Cc: Org-mode <emacs-orgmode@gnu.org>
References: <3ce0b3d9-b423-60af-c7a3-904acdb64c46@gmail.com>
 <87y1kqns3l.fsf@localhost> <b996fb49-3876-1fff-e5c6-f9be62099431@gmail.com>
 <87o7l1az53.fsf@localhost>
From: Ypo <ypuntot@gmail.com>
In-Reply-To: <87o7l1az53.fsf@localhost>
Received-SPF: pass client-ip=2a00:1450:4864:20::135;
 envelope-from=ypuntot@gmail.com; helo=mail-lf1-x135.google.com
X-Spam_score_int: -21
X-Spam_score: -2.2
X-Spam_bar: --
X-Spam_report: (-2.2 / 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, NICE_REPLY_A=-0.093, 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." <emacs-orgmode.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-orgmode>,
 <mailto:emacs-orgmode-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/emacs-orgmode>
List-Post: <mailto:emacs-orgmode@gnu.org>
List-Help: <mailto:emacs-orgmode-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-orgmode>,
 <mailto:emacs-orgmode-request@gnu.org?subject=subscribe>
Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org
Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org
X-Migadu-Country: US
X-Migadu-Flow: FLOW_IN
ARC-Seal: i=1; s=key1; d=yhetil.org; t=1688051522; a=rsa-sha256; cv=none;
	b=Zjfw4NiRLT+vNbGplfr12MTuWYHZTJFnff7hYY+sjr5RtWWrUOnw22XvCJzm34YHj7VBnv
	xbCLzXOmd/XflbQXKX3smWybHmiPfrlR+JQklYgEWGFoxvFRb+ytAMLPNBeuolp4XaklKy
	kE37gL+F1DWES2gyy/KiFuWIu3V0wt2qCbsBN3cC4aiNRWWYLejLKDfD6NDDshRxer5CCR
	cIY16Vq7bdZbDu36GbQ+0eotb9xklsF3vX5bbiqOIyVSSJQ7jpmKxPMS6PB5qcgLG6c0Wq
	ldpS3+2rE/OVH9LvqyAc73RsKEgEMstExHwBefyH0AUiyeG/TLAkQbtJnDYzXQ==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=pass header.d=gmail.com header.s=20221208 header.b=IXv3pHME;
	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"
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org;
	s=key1; t=1688051522;
	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=E6+KCX17yMAKTJcRT+/ztFxBDJkmNvI/aP8gxDwreoo=;
	b=ifgUv1qv5hSuuLOQGsWABYg8hz17oY+N1GGzhSBw4yw9giXTXsdwTWlqsoUXQLw51Onrhw
	lY6mlzIiwAQT+QjSAzQi0aIz47ufqPvTOPZQduZgqN9jAx10Qocyw9GZI7hTY2caRr61pL
	KNajHA60tUf/tkYAUwbSx35yBaZHBd1RyW/n9y6F5Tk33FNe2gXBQEvyMqoAEnMeK0Vf5+
	vVi8DCQFUiY3tssA5R1jy8SnuczPURL06I6R66r1iBCZcTR3N3lL05HgV6P1NnDC47TdpK
	Ib3AxM1QRfbh2uPLnpavKVl9Z+NMklSivmnE1UykiSLbPC1aHuauis5yPOeh5g==
Authentication-Results: aspmx1.migadu.com;
	dkim=pass header.d=gmail.com header.s=20221208 header.b=IXv3pHME;
	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-Scanner: scn0.migadu.com
X-Migadu-Spam-Score: -5.42
X-Spam-Score: -5.42
X-Migadu-Queue-Id: 1C83C2430
X-TUID: c1ylUnRj7Tnh

This is a multi-part message in MIME format.
--------------ff80FDWTFXBkAhkryyZMAwk0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Solved, thanks! :-)

;;;_ borrar todas las etiquetas al cambiar el estado a HECHO
(defun borrar-etiquetas-tareas-hechas (plist)
   "Borra todas las etiquetas al cambiar una tarea a =HECHO=."
   (when (eq (plist-get plist :type) 'todo-state-change)
     (when (string= (plist-get plist :to) "HECHO")
       (org-set-tags-to nil))))

(add-hook 'org-trigger-hook 'borrar-etiquetas-tareas-hechas)

El 27/06/2023 a las 14:05, Ihor Radchenko escribió:
> Ypo<ypuntot@gmail.com>  writes:
>
>> I have tried gptel inside emacs (I'm sorry, but I need to tell it) and I
>> got this code:
>>
>> #+begin_src emacs-lisp
>> (defun my-org-trigger-function (state)
>>     "Remove all tags when state changes to 'DONE'"
>>     (when (string= state "DONE")
>> ...
>> (add-hook 'org-trigger-hook 'my-org-trigger-function)
>> #+end_src
>>
>> Surprisingly 8-) it doesn't work. Any help?
> org-trigger-hook is a variable defined in org.el.
>
> Documentation
> Hook for functions that are triggered by a state change.
>
> Each function gets as its single argument a property list with at
> least the following elements:
>
>   (:type type-of-change :position pos-at-entry-start
>    :from old-state :to new-state)
>
> Depending on the type, more properties may be present.
>
--------------ff80FDWTFXBkAhkryyZMAwk0
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<html data-lt-installed="true">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body style="padding-bottom: 1px;">
    <p><font face="Arial">Solved, thanks! :-)</font></p>
    <p><font face="Arial">;;;_ borrar todas las etiquetas al cambiar el
        estado a HECHO<br>
        (defun borrar-etiquetas-tareas-hechas (plist)<br>
          "Borra todas las etiquetas al cambiar una tarea a =HECHO=."<br>
          (when (eq (plist-get plist :type) 'todo-state-change)<br>
            (when (string= (plist-get plist :to) "HECHO")<br>
              (org-set-tags-to nil))))<br>
        <br>
        (add-hook 'org-trigger-hook 'borrar-etiquetas-tareas-hechas)<br>
      </font><br>
    </p>
    <div class="moz-cite-prefix">El 27/06/2023 a las 14:05, Ihor
      Radchenko escribió:<br>
    </div>
    <blockquote type="cite" cite="mid:87o7l1az53.fsf@localhost">
      <pre class="moz-quote-pre" wrap="">Ypo <a class="moz-txt-link-rfc2396E" href="mailto:ypuntot@gmail.com">&lt;ypuntot@gmail.com&gt;</a> writes:

</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">I have tried gptel inside emacs (I'm sorry, but I need to tell it) and I 
got this code:

#+begin_src emacs-lisp
(defun my-org-trigger-function (state)
   "Remove all tags when state changes to 'DONE'"
   (when (string= state "DONE")
...
(add-hook 'org-trigger-hook 'my-org-trigger-function)
#+end_src

Surprisingly 8-) it doesn't work. Any help?
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
org-trigger-hook is a variable defined in org.el.

Documentation
Hook for functions that are triggered by a state change.

Each function gets as its single argument a property list with at
least the following elements:

 (:type type-of-change :position pos-at-entry-start
  :from old-state :to new-state)

Depending on the type, more properties may be present.

</pre>
    </blockquote>
  </body>
  <lt-container></lt-container>
</html>

--------------ff80FDWTFXBkAhkryyZMAwk0--