From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: org structuresin a drawer? (or some other presentation soution) Date: Thu, 12 Sep 2013 22:16:16 +0200 Message-ID: References: <871u4uq7c4.fsf@gmail.com> <87sixaorpw.fsf@gmail.com> <87hadpq13p.fsf@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Content-Type: multipart/signed; boundary="Apple-Mail=_DC9FF8CC-ACEE-4558-816D-6CBBB0B1177A"; protocol="application/pgp-signature"; micalg=pgp-sha1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKDJT-0000oL-UX for emacs-orgmode@gnu.org; Thu, 12 Sep 2013 16:16:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VKDJL-0003Lr-HW for emacs-orgmode@gnu.org; Thu, 12 Sep 2013 16:16:27 -0400 Received: from mail-ea0-x22c.google.com ([2a00:1450:4013:c01::22c]:56301) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKDJL-0003Lj-AF for emacs-orgmode@gnu.org; Thu, 12 Sep 2013 16:16:19 -0400 Received: by mail-ea0-f172.google.com with SMTP id r16so148873ead.3 for ; Thu, 12 Sep 2013 13:16:18 -0700 (PDT) In-Reply-To: <87hadpq13p.fsf@gmail.com> 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: Org Mode --Apple-Mail=_DC9FF8CC-ACEE-4558-816D-6CBBB0B1177A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi Nicolas, this looks good to me, please apply it. Thanks - Carsten On 12.9.2013, at 21:41, Nicolas Goaziou wrote: > Hello, >=20 > Carsten Dominik writes: >=20 >> Well, it is to avoid that a new headline would be made inside a = drawer, >> because it would violate Org syntax. But of course, it would be OK = to >> insert an item. What would be a good solution? Maybe we better = catch >> this problem in org-insert-heading? Or maybe not at all? We also do >> not catch it in src block, for example. So I am fine with removing >> this condition in org-meta-return. >=20 > I suggest to be very permissive and allow a user to shoot himself in = the > foot. The following function implements the same behaviour as before, > without the drawer check, but with Elements. >=20 > (defun org-meta-return (&optional arg) > "Insert a new heading or wrap a region in a table. > Calls `org-insert-heading' or `org-table-wrap-region', depending > on context. See the individual commands for more information." > (interactive "P") > (org-check-before-invisible-edit 'insert) > (or (run-hook-with-args-until-success 'org-metareturn-hook) > (let* ((element (org-element-at-point)) > (type (org-element-type element))) > (when (eq type 'table-row) > (setq element (org-element-property :parent element))) > (if (and (eq type 'table) > (eq (org-element-property :type element) 'org) > (>=3D (point) (org-element-property :contents-begin = element)) > (< (point) (org-element-property :contents-end = element))) > (call-interactively 'org-table-wrap-region) > (call-interactively 'org-insert-heading))))) >=20 >=20 >=20 > Regards, >=20 > --=20 > Nicolas Goaziou --Apple-Mail=_DC9FF8CC-ACEE-4558-816D-6CBBB0B1177A Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJSMiEQAAoJEO+gg/nAZuwMgmgIALtFqMl6U44xcEEh4XL+lEcp lewNmh+dkDL0zOm6sdiMJqWL+DsvUFe0htbguLPLwSnfnG+UTeTh1MJgD0CxTQSe /qCS53DgcDFxLZ66BhS80qybkHJiUhIgSufAz4AF+jIrpW2ughQ05hC2TWVOZcjm 6GdKb7Kd8WtA8A1mNqB8aznAIe+fiu9JrmLdQuNpTGBC9ouZd+p39DD5E9r69FGI 9tR1dPofPNO4a+x4xDmjF5WlE5q65gnfTnw4d6pWWz1mEfTT62J7uAIDtUjinyqk r9nzOO8bloX0Fqu00Vw2sneNFTTrMgoEOC+kO+M/LEn3o25E/HqYxLtRtli3C8M= =nofu -----END PGP SIGNATURE----- --Apple-Mail=_DC9FF8CC-ACEE-4558-816D-6CBBB0B1177A--