From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Loury Subject: Re: org-expiry not compatible with the new drawer syntax Date: Mon, 02 Feb 2015 08:31:56 +0100 Message-ID: <87sieobwgj.fsf@konixwork.incubateur.ens-lyon.fr> References: <87lhkkg2bx.fsf@konixwork.incubateur.ens-lyon.fr> <877fw4r4yq.fsf@nicolasgoaziou.fr> <87wq44h8aq.fsf@konixwork.incubateur.ens-lyon.fr> <87fvasp0n7.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45663) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIBUQ-0000yZ-1J for emacs-orgmode@gnu.org; Mon, 02 Feb 2015 02:32:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YIBUL-0000BI-2B for emacs-orgmode@gnu.org; Mon, 02 Feb 2015 02:32:09 -0500 Received: from mail-wi0-x236.google.com ([2a00:1450:400c:c05::236]:53495) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIBUK-0000B6-Re for emacs-orgmode@gnu.org; Mon, 02 Feb 2015 02:32:05 -0500 Received: by mail-wi0-f182.google.com with SMTP id n3so13204406wiv.3 for ; Sun, 01 Feb 2015 23:32:03 -0800 (PST) In-Reply-To: <87fvasp0n7.fsf@nicolasgoaziou.fr> 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: Nicolas Goaziou Cc: OrgMode ML --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Hi, Nicolas Goaziou writes: > Samuel Loury writes: > >> I suggest to provide a helper that would move point after the meta-data >> part to avoid code duplication. Something like (no surprise :-)): >> (defun org-goto-after-metadata-part () >> (when (org-looking-at-p org-planning-line-re) (forward-line)) >> (when (looking-at org-property-drawer-re) >> (goto-char (match-end 0)) >> (forward-line))) > > Indeed. > >> I would have gladly provided a patch myself but I couldn't find neither >> a good name for the function nor a correct location to store it. Should >> it be in org.el? It is already 24850 lines long... > > I changed `org-end-of-meta-data-and-drawers' into > `org-end-of-meta-data'. > > Could you merge your other patch and the use of this function? Please find attached the merged patch, as asked for. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Make-use-of-org-insert-heading-instead-of-inserting-.patch Content-Transfer-Encoding: quoted-printable From=2002dd79b12d6f19551d1d9648a3a84e53c4cee984 Mon Sep 17 00:00:00 2001 From: Konubinix Date: Thu, 6 Nov 2014 11:02:23 +0100 Subject: [PATCH] Make use of `org-insert-heading' instead of inserting the * character * lisp/org-agenda.el (org-agenda-insert-diary-as-top-level): Make use of `org-insert-heading' instead of inserting the * character Therefore, the hooks associated to the insertion of a heading will be triggered. Since those hooks may cause the creation of some metadata. `org-end-of-meta-data' is used afterward. =2D-- lisp/org-agenda.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 5f7c9ac..164e2d5 100644 =2D-- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -9488,7 +9488,10 @@ a timestamp can be added there." (widen) (goto-char (point-max)) (or (bolp) (insert "\n")) =2D (insert "* " text "\n") + (org-insert-heading) + (insert text) + (org-end-of-meta-data) + (unless (bolp) (insert "\n")) (if org-adapt-indentation (org-indent-to-column 2))) =20 (defun org-agenda-insert-diary-make-new-entry (text) =2D-=20 2.1.4 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Thank you for you support. =2D-=20 Konubinix GPG Key : 7439106A Fingerprint: 5993 BE7A DA65 E2D9 06CE 5C36 75D2 3CED 7439 106A --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUzyftAAoJEHXSPO10ORBq/qgIAJqAK8PiBIndX2z1pODSqrn3 mP5bfApn2iHQ0YGGauC8oMcLHzymC5jUy+8t36QKKpKSUVCeWLw1122h9Wv5pIqM Nd+onS+OBVaMuL7ffDw0ia5CuoQD8YLEOD6rNRWwI1RQjYj7FPvgGHSx/Rq5j8kE 9aK5VhwOFevaX97Dm8bRCBH6FdCX6bd+3bh1qGbOomL5EkLQKCG9cQ3O4OxNVgAu S17k2W0xQhUDmk5w+IEGZPyIYMp2u4MqMSl/nTsjAAR56SJHz8WMBAPXGe1XE2ak TPl1RaM7M5WqYKKUO/ySCsvR4Ljgvazar00Hnbh7pPOfNfro0fp0wdCwRLQ1RWY= =svuN -----END PGP SIGNATURE----- --==-=-=--