From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Bug: c++ code block automatically adds comma [8.2.10 (release_8.2.10 @ c:/Users/Louis/home/bin/emacs-24.5/share/emacs/24.5/lisp/org/)] Date: Sun, 22 Oct 2017 19:30:55 +0200 Message-ID: <87efpvrsxc.fsf@nicolasgoaziou.fr> References: <3a8aae30ca551ef356f7c0843c392611@quae.nl> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55113) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6K5U-0007p1-EI for emacs-orgmode@gnu.org; Sun, 22 Oct 2017 13:31:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e6K5T-00035s-Ec for emacs-orgmode@gnu.org; Sun, 22 Oct 2017 13:31:00 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:57476) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e6K5T-00035E-7q for emacs-orgmode@gnu.org; Sun, 22 Oct 2017 13:30:59 -0400 In-Reply-To: <3a8aae30ca551ef356f7c0843c392611@quae.nl> (Louis Strous's message of "Fri, 20 Oct 2017 13:12:21 +0200") 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: Louis Strous Cc: emacs-orgmode@gnu.org Hello, Louis Strous writes: > When I edit a c++ code block using C-c ' and then finish the edit using > C-c ' again, then org-mode sometimes adds a comma to the code. > > Start of reproduction scenario: > > 1. Start emacs using "emacs -Q" > > 2. Execute "org-mode" to change the *scratch* buffer's major mode to > org-mode. > > 3. Add the following text to the buffer: > > #+BEGIN_SRC c++ > #+END_SRC > > > 4. Put the cursor at the beginning of the #+BEGIN_SRC line and press > "C-c > '" to start editing the code block. The "*Org Src *scratch*[ c++ ]*" > buffer is displayed. > > 5. Enter the following c++ code in the "*Org Src *scratch*[ c++ ]*" > buffer: > > if (foo) > *foo = 3; > > 6. Note the absence of a comma in front of the "*". Now press "C-c '" > again to end editing the code block. The code block in the *scratch* > buffer changes to > > #+BEGIN_SRC c++ > if (foo) > ,*foo = 3; > #+END_SRC > > Note the appearance of a comma in front of the "*". > > 7. Press "C-c '" to edit the code block again. The code displayed in > the "*Org Src *scratch*[ c++ ]*" buffer does not contain the comma: > > if (foo) > *foo = 3; > > 8. Press "C-c '" to finish the editing. The code in the *scratch* > buffer still contains the comma. > > End of reproduction scenario. See (info "(org) Literal examples"), fourth footnote Regards, -- Nicolas Goaziou