From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: stardiviner <numbchild@gmail.com>
Cc: org-mode <emacs-orgmode@gnu.org>
Subject: Re: [BUG] there are weird offset when org-insert-structure-template
Date: Tue, 12 Jun 2018 09:05:10 +0200 [thread overview]
Message-ID: <87in6oxz6h.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87vaaooc9p.fsf@gmail.com> (stardiviner's message of "Tue, 12 Jun 2018 12:32:34 +0800")
Hello,
stardiviner <numbchild@gmail.com> writes:
> The original text:
>
> ,----
> | We define refs the same way we define atoms, but the two are used rather differently.
> | Let's take a quick look at how they work below.
> |
> | (def names (ref []))
> |
> | (dosync
> | (ref-set names ["John"])
> | (alter names #(if (not-empty %)
> | (conj % "Jane") %)))
> |
> | In this code, we define a ref called names, then open a transaction using the dosync statement. Inside the transaction we set names to a vector with the value "John". Next, we call alter to check if names is not empty and add "Jane" to the vector of the names if that's the case.
> |
> | Note that since this is happening inside a transaction, the check for emptiness depends on the existing state along with any state built up within the same transaction. If we tried to add or remove a name in a different transaction, it would have no visible effect on ours. In case of a collision, one of the transactions would end up being retried.
> `----
>
> Then I use region select code from (def to ))), then press [C-c C-, s].
>
> It has weird offset like this:
>
> ,----
> | #+begin_src
> | (def names (ref []))
> |
> | (dosync
> | (ref-set names ["John"])
> | (alter names #(if (not-empty %)
> | (conj % "Jane") %)))
> | #+end_src
> `----
>
> But when I region select by backward from ))) to (def, it works fine.
> no offset.
Fixed. Thank you.
Regards,
--
Nicolas Goaziou
prev parent reply other threads:[~2018-06-12 7:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-12 4:32 [BUG] there are weird offset when org-insert-structure-template stardiviner
2018-06-12 7:05 ` Nicolas Goaziou [this message]
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=87in6oxz6h.fsf@nicolasgoaziou.fr \
--to=mail@nicolasgoaziou.fr \
--cc=emacs-orgmode@gnu.org \
--cc=numbchild@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).