From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id eMq8GUhfn2eTvQAAqHPOHw:P1 (envelope-from ) for ; Sun, 02 Feb 2025 12:04:24 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id eMq8GUhfn2eTvQAAqHPOHw (envelope-from ) for ; Sun, 02 Feb 2025 13:04:24 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=cas.cat header.s=2023 header.b=JiZOuP7q; 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"; dmarc=pass (policy=quarantine) header.from=cas.cat ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1738497863; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=LEwiF+J54F+CTWb0X3mDZyj1f8ug9eKBsfdt79PkzlU=; b=V/t5gKIPMsrLOPuR3G7uwdRBqxx9tzr4RNKEpabbwgNMo6g7/KG9R7+AZgMUD8TkVlsr1A RC4cTv/og576mqgsMJcNd2XXOie572VIyJYZoK0yiqpqEjixsKMfHYEl2U4yPGdMD9dE4B ai9CJmH/t7Q9jFTFfHcSqSXi9GYhMzHgrqlDK6CUKpL3Gnw4sDPe48C86AXR0Rs5MNymXE mYN8jtc0e+MQDW1htlS2qEmATRqed/R6hSphvqmmgVW1kB1TbVOHR+UYCAYYXaPgJSOKD3 fjFYEXMuJlKmTZ7P1ZcuMA04TcxecJ9geMQdn7sG7mWG8ZHW2wMMhib2MZ3+bA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=cas.cat header.s=2023 header.b=JiZOuP7q; 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"; dmarc=pass (policy=quarantine) header.from=cas.cat ARC-Seal: i=1; s=key1; d=yhetil.org; t=1738497863; a=rsa-sha256; cv=none; b=YlWvtWi28g/8S8V137VvhNn78z/g4Cq0glaXbxk6IRC0uBSnIITaq4xqCPYPgFPJ2WG5FS b1Kd4I7ZbKdEEm8Lrm8PjRZ7xeUi6d7gBUMVaeBWdsDs8VOoo6BEiNhktSxRHNvFjzEgph Y9MeLJpsrz3Z7AnCN28vCjvrwSfa8tPvPmtRJdrR4gXYLrSkifRoWBQ6dkLQesznkvEVoj XLtxE1YyPWvN6/mY53FN+ykN9OOV2o3e+cs68QqWLS+QH5v9iJlWKyk4dELDLcEZG5P5qF lLVsibxdfYmScIpEk1XIIxJ3BUr5vA/CYhfRWaRNd9Y3o50U+gRF52E9eupUPQ== 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 432D967F52 for ; Sun, 02 Feb 2025 13:04:23 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1teYhG-0003kW-Ue; Sun, 02 Feb 2025 07:03:30 -0500 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 ) id 1teYhD-0003kJ-Qb for emacs-orgmode@gnu.org; Sun, 02 Feb 2025 07:03:28 -0500 Received: from cas.cat ([45.150.187.15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1teYhB-0001VA-Of for emacs-orgmode@gnu.org; Sun, 02 Feb 2025 07:03:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cas.cat; s=2023; t=1738497796; bh=Tg23Jn9Bzy/Z6CfTn8WR+ZlAQdIl/UCWlQnxZ7DuNoQ=; h=Date:Subject:To:References:From:In-Reply-To:From; b=JiZOuP7qBCpTweMBXU0oAqWB2hUIaEn0PZpHgsd3S1vuNbGrDQWJBAZNB1DACeT8s 2ohJrCx/oHPij80JwAlvmkXPlkxnEwgvwK+pqO0RGGsgaMRBrYnQOdsoeSymtRjayC tTkgHVkL6nvccYDxrMS0S5P6YsNKJ9UVfKLDtDagMy4JWM4s6ztWxIW5MvlnDL5R+I JbouomRPU+UWa1dyyvdj74fdzd2GuvFN8lILDiUoY45+rTf/zR54VITpxk8N5CEm0r GQbyi6KsUw4Q50SBdF70XpY1ud6rmV0cG8idAiqb240k/DhISOVVLc9jRF5zKqvp2x t5MCx/Xjf1FAQ== Content-Type: multipart/alternative; boundary="------------mU6XU1PMsfQEDDsBsjBP0Yy0" Message-ID: <04b5ac66-2184-40ee-9269-68db7fa9309e@cas.cat> Date: Sun, 2 Feb 2025 13:03:14 +0100 MIME-Version: 1.0 Subject: Re: insert a header and automatically a timestamp with date/time To: emacs-orgmode@gnu.org References: <87seoy3xqg.fsf@mat.ucm.es> <87wme94l3k.fsf@mat.ucm.es> <0ffad4d4-45de-46ad-a95d-66fb20d97c46@cas.cat> <878qqodceb.fsf@mat.ucm.es> Content-Language: en-US From: pinmacs In-Reply-To: <878qqodceb.fsf@mat.ucm.es> Received-SPF: pass client-ip=45.150.187.15; envelope-from=pinmacs@cas.cat; helo=cas.cat X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, HTML_MESSAGE=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -7.13 X-Spam-Score: -7.13 X-Migadu-Queue-Id: 432D967F52 X-TUID: mzW0Ysg3NZW+ This is a multi-part message in MIME format. --------------mU6XU1PMsfQEDDsBsjBP0Yy0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2025-02-02 08:38, Uwe Brauer via General discussions about Org-mode. wrote: > Vale, entendido (supongo que eres español, porque usas la palabra movil, > ¿correcto?) Yes :D   but let's keep the discussion in the mailinglist in English so other people can participate, or benefit from it > Thanks, but I cannot find the function > > my/set-property-with-inactive-timestamp > > In your code, 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 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 --------------mU6XU1PMsfQEDDsBsjBP0Yy0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 2025-02-02 08:38, Uwe Brauer via General discussions about Org-mode. wrote:
Vale, entendido (supongo que eres español, porque usas la palabra movil,
¿correcto?) 
Yes :D
  but let's keep the discussion in the mailinglist in English so other people can participate, or benefit from it
Thanks, but I cannot find the function

my/set-property-with-inactive-timestamp

In your code, 

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

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 --------------mU6XU1PMsfQEDDsBsjBP0Yy0--