> On 2025-02-02 08:38, Uwe Brauer via General discussions about Org-mode. 
> wrote:
> Yes :D
>    but let's keep the discussion in the mailinglist in English so other 
> people can participate, or benefit from it


Sure!

> In fact you don't need ~my/get-inactive-timestamp~ for your pursposes, 
> try with this one:

> #+begin_src emacs-lisp
> (defun my/org-add-timestamp-on-heading ()
>    (save-excursion
>      (org-back-to-heading)
>      (org-edit-headline (format-time-string "<%F>"))))

> (add-hook 'org-insert-heading-hook 'my/org-add-timestamp-on-heading 'append)
> ;; to remove it
> ;; (remove-hook 'org-insert-heading-hook 'my/org-add-timestamp-on-heading)
> #+end_src

I did this already 😉 thanks

Actually I used 
(defun my/org-add-timestamp-on-heading ()
  (save-excursion
    (org-back-to-heading)
    (org-edit-headline (format-time-string "<%Y-%m-%d %H:%M>")))
  (insert " "))

(add-hook 'org-insert-heading-hook 'my/org-add-timestamp-on-heading 'append)




> but here you have for curiosity, there you can see compact strftime 
> format to construct a inactive timestamp

> [1]

> #+begin_src emacs-lisp
> (defun my/get-inactive-timestamp ()
>    (format-time-string "[%F %a %R]"))

> (defun my/set-property-with-inactive-timestamp (property)
>    (interactive)
>    (org-set-property property (my/get-inactive-timestamp)))
> #+end_src

Thanks, I try that out.


A last question though.

Now if I want my headings look like 

* <2025-02-02 08:58> Second entry 

* <2025-02-02 08:53> First 

* <2025-02-02 08:56> third 



Is there any way to sort these heading with respect to the timestamps from 
oldes to newest?

-- 
I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel
I strongly condemn Putin's war of aggression against Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the EU and NATO membership of Ukraine. 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to