From: stardiviner <numbchild@gmail.com>
To: org-mode <emacs-orgmode@gnu.org>
Subject: [BUG] there are weird offset when org-insert-structure-template
Date: Tue, 12 Jun 2018 12:32:34 +0800 [thread overview]
Message-ID: <87vaaooc9p.fsf@gmail.com> (raw)
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.
--
[ stardiviner ] don't need to convince with trends.
Blog: https://stardiviner.github.io/
IRC(freenode): stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
next reply other threads:[~2018-06-12 4:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-12 4:32 stardiviner [this message]
2018-06-12 7:05 ` [BUG] there are weird offset when org-insert-structure-template 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87vaaooc9p.fsf@gmail.com \
--to=numbchild@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.