From: Carsten Dominik <carsten.dominik@gmail.com>
To: Nicolas Goaziou <n.goaziou@gmail.com>
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: org structuresin a drawer? (or some other presentation soution)
Date: Thu, 12 Sep 2013 22:16:16 +0200 [thread overview]
Message-ID: <D67B5B40-DB0B-4158-8E6C-198446495151@gmail.com> (raw)
In-Reply-To: <87hadpq13p.fsf@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1865 bytes --]
Hi Nicolas, this looks good to me, please apply it.
Thanks
- Carsten
On 12.9.2013, at 21:41, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
> Hello,
>
> Carsten Dominik <carsten.dominik@gmail.com> writes:
>
>> 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.
>
> 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.
>
> (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)
> (>= (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)))))
>
>
>
> Regards,
>
> --
> Nicolas Goaziou
[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
next prev parent reply other threads:[~2013-09-12 20:16 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-12 17:06 org structuresin a drawer? (or some other presentation soution) Matt Price
2013-09-12 17:16 ` Thorsten Jolitz
2013-09-12 17:38 ` Matt Price
2013-09-12 17:26 ` Nicolas Goaziou
2013-09-12 17:30 ` Matt Price
2013-09-12 17:49 ` Nicolas Goaziou
2013-09-12 19:13 ` Carsten Dominik
2013-09-12 19:18 ` Michael Brand
2013-09-12 19:24 ` Carsten Dominik
2013-09-12 20:17 ` Nicolas Goaziou
2013-09-12 19:41 ` Nicolas Goaziou
2013-09-12 20:13 ` Nicolas Goaziou
2013-09-12 20:16 ` Carsten Dominik [this message]
2013-09-12 20:35 ` Nicolas Goaziou
2013-09-12 20:41 ` Carsten Dominik
2013-09-12 20:42 ` Michael Brand
2013-09-13 0:43 ` Matt Price
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=D67B5B40-DB0B-4158-8E6C-198446495151@gmail.com \
--to=carsten.dominik@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=n.goaziou@gmail.com \
/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).