emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: org-todo-state-tags-triggers not working with regexp?


From: Ypo
Subject: Re: org-todo-state-tags-triggers not working with regexp?
Date: Thu, 29 Jun 2023 17:10:45 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.1

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]