emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Oleh <ohwoeowho@gmail.com>
To: org mode <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] org-src: allow `org-babel-edit-prep:.*' to mark region
Date: Sat, 29 Nov 2014 15:34:50 +0100	[thread overview]
Message-ID: <CAA01p3q-8e6jvBnDaGS9Nf6vpG8fTc3fYJPk_T_kHjza=q4gRw@mail.gmail.com> (raw)
In-Reply-To: <871tomnldi.fsf@nicolasgoaziou.fr>

>>> I don't understand what your use-case is. Note that `org-edit-special'
>>> already preserves region.
>>
>> That's good, but not what I need. I want to go from an unmarked region
>> in an org file with markup
>> to a marked region without markup in the *Org Src* buffer.
>
> That still doesn't explain why you need it.

To automate things.
I'm writing a function reference for a package here:
  https://raw.githubusercontent.com/abo-abo/lispy/gh-pages/index.org.
Here's the link in case you don't want to compile the org-file:
  http://abo-abo.github.io/lispy/.

Some of the source blocks in this document feature a marked region
that I export marked to HTML.  Most source blocks are step-by-step
examples that assume a certain point and region state in order to
work.  And it's nice to automatically set the region state in order to
text out an example.

>
>> I've defined a custom `org-babel-edit-prep:elisp' that does this, but
>> it's not allowed to mark region in this function.
>
> Why?

Well, I can call `set-mark' in this function, but it won't work unless
the function
that calls it binds `deactivate-mark' to nil.

>
>> Just to sum it up: I want a custom `org-babel-edit-prep:elisp' to be
>> able to mark region, even if it wasn't marked before.
>
> Your markup is very personal. I still don't see the need to turn it into
> a general mechanism.

Well, I'm not trying to push my markup or anything, I just want my
custom `org-babel-edit-prep:elisp' to be able to mark the region.
Currently I'm not given that option.

> Isn't an advice enough?

I don't know how this would work. `org-babel-edit-prep:elisp' is
already the exit point
of `org-edit-src-code' and it's not allowed to mark the region.

regards,
Oleh

  reply	other threads:[~2014-11-29 14:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-29 12:43 [PATCH] org-src: allow `org-babel-edit-prep:.*' to mark region Oleh
2014-11-29 13:33 ` Nicolas Goaziou
2014-11-29 13:47   ` Oleh
2014-11-29 14:15     ` Nicolas Goaziou
2014-11-29 14:34       ` Oleh [this message]
2014-12-07 23:37         ` Nicolas Goaziou
2014-12-09 11:03           ` Oleh
2014-12-09 16:12             ` 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='CAA01p3q-8e6jvBnDaGS9Nf6vpG8fTc3fYJPk_T_kHjza=q4gRw@mail.gmail.com' \
    --to=ohwoeowho@gmail.com \
    --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).