emacs-orgmode
[Top][All Lists]
Advanced

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

Re: org-set-properties for various (all) headings


From: Kaushal Modi
Subject: Re: org-set-properties for various (all) headings
Date: Tue, 19 Jul 2022 14:07:06 -0400

On Tue, Jul 19, 2022 at 12:58 PM Uwe Brauer <oub@mat.ucm.es> wrote:

> On Tue, Jul 19, 2022, 10:54 AM Uwe Brauer <oub@mat.ucm.es> wrote:

> Try replacing the `org-set-property` form to:

> (org-set-property "New" "[]")

This does not anything (besides garbage collecting)

Did you replace only the `org-set-property` form with my suggestion?

In any case, I got to a computer and I tested that to work alright.

=====
* Over
:PROPERTIES:
:ID:       ef19f286-8769-4fe7-8f95-8167691257a0
:COLUMNS:  %5TODO(Status) %5NR(Nr)
:foo:      Over
:END:
** TODO Test
:PROPERTIES:
:Sent:     [X]
:END:

** WAIT Test2
:PROPERTIES:
:Sent:     [X]
:END:

** TODO Test3
:PROPERTIES:
:Sent:     [ ]
:END:

#+begin_src emacs-lisp
(defun test/set-property-at-heading ()
  "Function to be called at the beginning of an Org heading."
  (interactive)
  (let ((el (org-element-at-point)))
    (org-set-property "New" "[ ]")))
(org-map-entries #'test/set-property-at-heading)
#+end_src
=====

Hit C-c C-c with the cursor in that code block, say "yes" or "y" if prompted, and then you should see that Org buffer change to:

=====
* Over
:PROPERTIES:
:ID:       ef19f286-8769-4fe7-8f95-8167691257a0
:COLUMNS:  %5TODO(Status) %5NR(Nr)
:foo:      Over
:New:      [ ]
:END:
** TODO Test
:PROPERTIES:
:Sent:     [X]
:New:      [ ]
:END:

** WAIT Test2
:PROPERTIES:
:Sent:     [X]
:New:      [ ]
:END:

** TODO Test3
:PROPERTIES:
:Sent:     [ ]
:New:      [ ]
:END:

#+begin_src emacs-lisp
(defun test/set-property-at-heading ()
  "Function to be called at the beginning of an Org heading."
  (interactive)
  (let ((el (org-element-at-point)))
    (org-set-property "New" "[ ]")))
(org-map-entries #'test/set-property-at-heading)
#+end_src

#+RESULTS:

=====

reply via email to

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