emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Allen Li <darkfeline@felesatra.moe>
To: bernt@norang.ca
Cc: Org Mode List <emacs-orgmode@gnu.org>
Subject: Re: Bug: org-insert-structure-template leaves point at inconvenient place [9.1.14 (9.1.14-932-gf82a30-elpaplus @ .emacs.d/elpa/org-plus-contrib-20180923/)]
Date: Tue, 2 Oct 2018 19:16:54 +0000	[thread overview]
Message-ID: <CADbSrJy=QcY-6KHgiz9Vu+UvuN9hU2zZGgYgkoM9boHbZFFRBw@mail.gmail.com> (raw)
In-Reply-To: <877ej0xwox.fsf@norang.ca>

On Tue, Oct 2, 2018 at 2:14 PM Bernt Hansen <bernt@norang.ca> wrote:
>
> Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
>
> > Hello,
> >
> > Allen Li <darkfeline@felesatra.moe> writes:
> >
> >> org-insert-structure-template (C-c C-,) leaves point at an inconvenient
> >> place (X marks the spot):
> >>
> >> #+begin_example
> >> X#+end_example
> >>
> >> My expectation is that right after inserting the template, I can start
> >> typing or yank right into it:
> >>
> >> #+begin_example
> >> X
> >> #+end_example
> >
> > Use `C-o'.
> >
> > I think the current behaviour is better because you can yank text within
> > the newly created block without dealing with a blank line later on.
>
> I also prefer the current behaviour.
>
> I regularly use C-c C-, e C-c ' C-y C-c '
>
> to create and populate my example blocks.  This handles the newline
> correctly and does not break the syntax.  This also has the benefit of
> properly escaping text that interferes with org's syntax.

That's very interesting.  Perhaps this is too invasive, but maybe C-c
C-, should do C-c ' automatically?

Since the user almost certainly wants to populate the block
immediately, this saves the user a step,
and also handles characters to escape and a missing final newline correctly.

>
> When you have text in the kill buffer that looks like org headlines it
> pastes outside the example block -- which is proper behaviour when
> moving headlines around.
>
> try this:
>
> C-c C-, e C-y
> with the following your yank buffer
>
> --------
> *** one
> some text
> *** two
> more text
> --------
>
> You can't paste that inside
>
> #begin_example
> #end_example
>
> or
>
> #begin_example
>
> #end_example
>
> Regards,
> Bernt

  reply	other threads:[~2018-10-02 19:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-02  0:01 Bug: org-insert-structure-template leaves point at inconvenient place [9.1.14 (9.1.14-932-gf82a30-elpaplus @ .emacs.d/elpa/org-plus-contrib-20180923/)] Allen Li
2018-10-02  8:06 ` Nicolas Goaziou
2018-10-02  8:41   ` Allen Li
2018-10-02 14:14   ` Bernt Hansen
2018-10-02 19:16     ` Allen Li [this message]
2018-10-02 19:35       ` Nicolas Goaziou

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='CADbSrJy=QcY-6KHgiz9Vu+UvuN9hU2zZGgYgkoM9boHbZFFRBw@mail.gmail.com' \
    --to=darkfeline@felesatra.moe \
    --cc=bernt@norang.ca \
    --cc=emacs-orgmode@gnu.org \
    /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).