From mboxrd@z Thu Jan 1 00:00:00 1970 From: stardiviner Subject: [BUG] there are weird offset when org-insert-structure-template Date: Tue, 12 Jun 2018 12:32:34 +0800 Message-ID: <87vaaooc9p.fsf@gmail.com> Reply-To: numbchild@gmail.com Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35246) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSaz2-0000Op-3s for emacs-orgmode@gnu.org; Tue, 12 Jun 2018 00:32:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSayy-0007X6-Vs for emacs-orgmode@gnu.org; Tue, 12 Jun 2018 00:32:40 -0400 Received: from [218.75.119.140] (port=51656 helo=dark.localdomain) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSayy-0007VB-Jp for emacs-orgmode@gnu.org; Tue, 12 Jun 2018 00:32:36 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: org-mode 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