From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: org-expiry not compatible with the new drawer syntax Date: Fri, 30 Jan 2015 10:30:05 +0100 Message-ID: <877fw4r4yq.fsf@nicolasgoaziou.fr> References: <87lhkkg2bx.fsf@konixwork.incubateur.ens-lyon.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42964) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YH7su-0005DI-In for emacs-orgmode@gnu.org; Fri, 30 Jan 2015 04:29:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YH7sr-00009o-Cn for emacs-orgmode@gnu.org; Fri, 30 Jan 2015 04:29:04 -0500 Received: from relay3-d.mail.gandi.net ([2001:4b98:c:538::195]:37041) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YH7sr-00009a-6W for emacs-orgmode@gnu.org; Fri, 30 Jan 2015 04:29:01 -0500 In-Reply-To: <87lhkkg2bx.fsf@konixwork.incubateur.ens-lyon.fr> (Samuel Loury's message of "Fri, 30 Jan 2015 08:22:26 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Samuel Loury Cc: OrgMode ML Hello, Samuel Loury writes: > 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: > > ** test > <2015-01-30 Fri> > :PROPERTIES: > :CREATED: [2015-01-30 Fri 08:00] > :END: > > 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: Actually, AFAICT, the sole function calling `org-insert-heading' in "org-agenda.el" is `org-agenda-insert-diary-make-new-entry'. I fixed it so it properly puts point on the right spot in the entry. Does it fix your issue? > 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? If a function calls on `org-insert-heading' and puts point in some position for further processing, it should take into consideration meta-data (i.e., planning info and properties drawer). Regards, -- Nicolas Goaziou