From: Uwe Brauer via "General discussions about Org-mode." <emacs-orgmode@gnu.org>
To: emacs-orgmode@gnu.org
Subject: Re: insert a header and automatically a timestamp with date/time
Date: Sat, 01 Feb 2025 18:43:11 +0100 [thread overview]
Message-ID: <87wme94l3k.fsf@mat.ucm.es> (raw)
In-Reply-To: f37eb816-3b89-4d3e-b2d8-bab16721928f@cas.cat
[-- Attachment #1: Type: text/plain, Size: 3670 bytes --]
>>> "GdaO" == General discussions about Org-mode <pinmacs> writes:
> On 2025-02-01 08:55, Uwe Brauer via General discussions about
> Org-mode. wrote:
>> Is there any way to insert a header and automatically a timestamp with
>> date/time?
>>
>> I can write me a small function doing this and bind it to some unused
>> key, but is there a more general/elegant way I just miss?
Hi pinmacs
(BTW do you speak Spanish , since there is some Spanish text in the
files that are attached)
Anyhow.
Let me see if I understand that correctly
- Your code does not insert
* <2025-02-01>
But instead
* Some heading
:PROPERTIES:
:CREATED: [2023-11-17 Fri 19:32]
:END:
that is also ok, but for the moment I prefer the timestamp in the
heading, because if I use outline-hide-body I obtain a nice overview
with the dates.
- Another problem is that I don't get your code to work for example
the one in the file auto-insert-created-timestamp-as-property.org
gives me
--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (void-function my/set-property-with-inactive-timestamp)
(my/set-property-with-inactive-timestamp "CREATED")
(save-excursion (org-back-to-heading) (my/set-property-with-inactive-timestamp "CREATED"))
my/org-heading-insert-heading-inactive-timestamp()
run-hooks(org-insert-heading-hook)
org-insert-heading(nil)
funcall-interactively(org-insert-heading nil)
call-interactively(org-insert-heading)
(or (run-hook-with-args-until-success 'org-metareturn-hook) (call-interactively (cond (arg #'org-insert-heading) ((org-at-table-p) #'org-table-wrap-region) ((org-in-item-p) #'org-insert-item) (t #'org-insert-heading))))
(closure (org-clock-history org-with-time org-defdecode org-def org-read-date-inactive org-ans2 org-ans1 org-columns-current-fmt-compiled org-clock-current-task org-clock-effort org-end-time-was-given org-time-was-given org-state org-agenda-headline-snapshot-before-repeat org-element-cache-version org-struct-menu org-last-state org-clock-start-time org-export-registered-backends org-indent-indentation-per-level org-inlinetask-min-level t) (&optional arg) "Insert a new heading or wrap a region in a table.\n..." (interactive "P") (or (run-hook-with-args-until-success 'org-metareturn-hook) (call-interactively (cond (arg #'org-insert-heading) ((org-at-table-p) #'org-table-wrap-region) ((org-in-item-p) #'org-insert-item) (t #'org-insert-heading)))))(nil)
apply((closure (org-clock-history org-with-time org-defdecode org-def org-read-date-inactive org-ans2 org-ans1 org-columns-current-fmt-compiled org-clock-current-task org-clock-effort org-end-time-was-given org-time-was-given org-state org-agenda-headline-snapshot-before-repeat org-element-cache-version org-struct-menu org-last-state org-clock-start-time org-export-registered-backends org-indent-indentation-per-level org-inlinetask-min-level t) (&optional arg) "Insert a new heading or wrap a region in a table.\n..." (interactive "P") (or (run-hook-with-args-until-success 'org-metareturn-hook) (call-interactively (cond (arg #'org-insert-heading) ((org-at-table-p) #'org-table-wrap-region) ((org-in-item-p) #'org-insert-item) (t #'org-insert-heading))))) nil)
org-meta-return(nil)
funcall-interactively(org-meta-return nil)
call-interactively(org-meta-return nil nil)
command-execute(org-meta-return)
--8<---------------cut here---------------end--------------->8---
The one in autoadd-scheduled-entry.org refers to files I don't have.
Anyhow I continue playing with your code.
Thanks for sharing it
Uwe
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5684 bytes --]
next prev parent reply other threads:[~2025-02-01 17:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-01 7:55 insert a header and automatically a timestamp with date/time Uwe Brauer via General discussions about Org-mode.
2025-02-01 11:11 ` pinmacs via General discussions about Org-mode.
2025-02-01 17:43 ` Uwe Brauer via General discussions about Org-mode. [this message]
2025-02-01 21:04 ` Pedro
2025-02-02 7:38 ` Uwe Brauer via General discussions about Org-mode.
2025-02-02 12:03 ` pinmacs
2025-02-02 20:02 ` Uwe Brauer via General discussions about Org-mode.
2025-02-02 20:47 ` pinmacs
2025-02-03 18:07 ` Uwe Brauer via General discussions about Org-mode.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wme94l3k.fsf@mat.ucm.es \
--to=emacs-orgmode@gnu.org \
--cc=oub@mat.ucm.es \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).