emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-expiry not compatible with the new drawer syntax
@ 2015-01-30  7:22 Samuel Loury
  2015-01-30  9:30 ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: Samuel Loury @ 2015-01-30  7:22 UTC (permalink / raw)
  To: OrgMode ML

[-- Attachment #1: Type: text/plain, Size: 2112 bytes --]

Dear All,

I am running the version cd6fa4c15e8e35afa6beb9e89ad3723fb82df091 (git
sha) of org-mode.

I just realized that when creating a new entry in my org-diary
(`org-agenda-add-entry-to-org-agenda-diary-file'), the entry looks like:

--8<---------------cut here---------------start------------->8---
** test
  <2015-01-30 Fri>
   :PROPERTIES:
   :CREATED:  [2015-01-30 Fri 08:00]
   :END:
--8<---------------cut here---------------end--------------->8---

The property is added by an call to `org-expiry-insert-created' in the
`org-insert-heading-hook'. see in contrib/lisp/org-expiry.el:179

With more details:

In the process in inserting the diary entry,
`org-agenda-add-entry-to-org-agenda-diary-file'
calls (lisp/org-agenda.el:9460)
`org-agenda-insert-diary-as-top-level' (lisp/org-agenda.el:9479).

The later then calls `org-insert-heading' (calling the org-expiry hook
that creates the property drawer), and inserts the text of the heading
followed by a new line, resulting in the insertion of:
--8<---------------cut here---------------start------------->8---
** test

   :PROPERTIES:
   :CREATED:  [2015-01-30 Fri 08:00]
   :END:
--8<---------------cut here---------------end--------------->8---

Then `org-agenda-add-entry-to-org-agenda-diary-file' inserts the
timestamp, resulting in:
--8<---------------cut here---------------start------------->8---
** test
  <2015-01-30 Fri>
   :PROPERTIES:
   :CREATED:  [2015-01-30 Fri 08:00]
   :END:
--8<---------------cut here---------------end--------------->8---

This is not compatible with the new drawer syntax (see
http://article.gmane.org/gmane.emacs.orgmode/91752).

My opinion is that we should either consider that adding a property in
`org-insert-heading-hook' is a bad practice or change the functions that
create entries to make sure they move beyond a potentially created
properties drawer before adding extra information such as timestamps.

What is your opinion?

Best regards,
-- 
Konubinix
GPG Key    : 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-02-02 12:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-30  7:22 org-expiry not compatible with the new drawer syntax Samuel Loury
2015-01-30  9:30 ` Nicolas Goaziou
2015-01-30 10:28   ` Samuel Loury
2015-01-30 10:35     ` Samuel Loury
2015-01-30 18:46     ` Nicolas Goaziou
2015-02-02  7:31       ` Samuel Loury
2015-02-02 12:26         ` Nicolas Goaziou
2015-02-02 12:45           ` Samuel Loury

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).