From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: C-c ' prepends , to shell comment lines Date: Sun, 5 Oct 2008 13:17:46 +0200 Message-ID: References: <6886503D1523ED41ACBD82F205B220EA03001455@ad01msxmb004.US.Cingular.Net> <386A2CC5-3A32-487A-87A5-A83B170C236A@uva.nl> <6886503D1523ED41ACBD82F205B220EA03001470@ad01msxmb004.US.Cingular.Net> Mime-Version: 1.0 (Apple Message framework v929.2) Content-Type: multipart/mixed; boundary="===============1814379948==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KmRcY-0003HN-Fz for emacs-orgmode@gnu.org; Sun, 05 Oct 2008 07:17:54 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KmRcX-0003G4-AR for emacs-orgmode@gnu.org; Sun, 05 Oct 2008 07:17:53 -0400 Received: from [199.232.76.173] (port=49887 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KmRcX-0003Fs-6U for emacs-orgmode@gnu.org; Sun, 05 Oct 2008 07:17:53 -0400 Received: from nf-out-0910.google.com ([64.233.182.189]:14874) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KmRcW-0008RN-Hv for emacs-orgmode@gnu.org; Sun, 05 Oct 2008 07:17:53 -0400 Received: by nf-out-0910.google.com with SMTP id c7so938285nfi.26 for ; Sun, 05 Oct 2008 04:17:51 -0700 (PDT) In-Reply-To: <6886503D1523ED41ACBD82F205B220EA03001470@ad01msxmb004.US.Cingular.Net> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Womick, Don" Cc: emacs-orgmode@gnu.org --===============1814379948== Content-Type: multipart/alternative; boundary=Apple-Mail-1-85131076 --Apple-Mail-1-85131076 Content-Type: text/plain; charset=WINDOWS-1252; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable On Oct 5, 2008, at 12:42 PM, Womick, Don wrote: > Carsten, thanks. That makes sense, once you know about it. > > I don=92t think this behavior is documented. Can you add it the =20 > manual? Might prevent a stupid question or two=85 J Sure, it is now a footnote to the documentation of C-c ' - Carsten > > Regards, > Don > From: Carsten Dominik [mailto:carsten.dominik@gmail.com] On Behalf =20 > Of Carsten Dominik > Sent: Sunday, October 05, 2008 5:05 AM > To: Womick, Don > Cc: emacs-orgmode@gnu.org > Subject: Re: [Orgmode] C-c ' prepends , to shell comment lines > > Hi Don, > > this is on purpose. Putting a comma in front of such lines makes =20 > sure Org does not consider them as special, for example when =20 > searching for in-buffer options like #+STARTUP. The same thing =20 > happens for lines startin with a star, which Org could mistake for =20 > an outline heading. > The parsers for startup options and for outline structure do not =20 > waste time on analyzing the structure of the document to distinguish =20= > lines inside and outside code blocks. > > The commas admittedly look not so good in the Emacs buffer, but they =20= > will be stripped for editing with C-c ', and also for export. > > Hope this explains it. > > - Carsten > > On Oct 4, 2008, at 4:17 PM, Womick, Don wrote: > > > After running C-c =91 (apostrophe) on a shell script between #=20 > +BEGIN_SRC and #+END_SRC tags and returning to the org file using C-=20= > c =91 again, comments in the script have a , (comma) prepended. > > If I have > > #+BEGIN_SRC shell-script > #! /bin/bash > # some comments here... they'll be preceded by commas after C-c ' =20 > editing > # > ls > cat myfile # inline comment here, isn't affected > #+END_SRC > > and do C-c =91 to pull it into an edit buffer, then C-c =91 again to = go =20 > back to the org file, the result is > > #+BEGIN_SRC shell-script > ,#! /bin/bash > ,# some comments here... they'll be preceded by commas after C-c ' =20 > editing > ,# > ls > cat myfile # inline comment here, isn't affected > #+END_SRC > > Note the commas in front of each # (comment character). > > This seems to happen to # characters regardless of the editing mode=85 = =20 > I tried a Java snippet with the same results: > > Before: > > #+BEGIN_SRC java > # hash comment > // java comment here > public class MyClass() { > private String myVariable; // inline comment here > } > #+END_SRC > > After: > > #+BEGIN_SRC java > ,# hash comment > // java comment here > public class MyClass() { > private String myVariable; // inline comment here > } > #+END_SRC > > I=92m running the following: > > Org-mode version 6.06b > GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600) of 2008-08-19 on =20 > LENNART-69DE564 (patched) > > Thanks for org-mode=85 I=92ve been using this amazing piece of = software =20 > almost as long as I=92ve been using Emacs (a couple of years now). > > Regards, > Don Womick > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > --Apple-Mail-1-85131076 Content-Type: text/html; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable
On Oct 5, 2008, = at 12:42 PM, Womick, Don wrote:

Carsten, = thanks. That makes sense, once you know about = it.
 
I don=92t = think this behavior is documented. Can you add it the manual? Might = prevent a stupid question or two=85 
 
Don
From: Carsten Dominik [mailto:carsten.dominik@gmail.com] On Behalf Of Carsten = Dominik
Sent: Sunday, October 05, 2008 = 5:05 AM
To: Womick, Don
Cc: emacs-orgmode@gnu.org
Subject: Re: [Orgmode] C-c ' = prepends , to shell comment = lines
Hi = Don,
this is on purpose.  Putting a comma in = front of such lines makes sure Org does not consider them as special, = for example when searching for in-buffer options like #+STARTUP. =  The same thing happens for lines startin with a star, which Org = could mistake for an outline = heading.
The parsers for startup options and for = outline structure do not waste time on analyzing the structure of the = document to distinguish lines inside and outside code = blocks.
The commas admittedly look not so good in = the Emacs buffer, but they will be stripped for editing with C-c ', and = also for export.
Hope this explains = it.
- = Carsten
On Oct 4, = 2008, at 4:17 PM, Womick, Don = wrote:
After running C-c =91 (apostrophe) on a shell script = between #+BEGIN_SRC and #+END_SRC tags and returning to the org file = using C-c =91 again, comments in the script have a , (comma) = prepended.
If I = have
#! = /bin/bash
# = some comments here... they'll be preceded by commas after C-c ' = editing
and do C-c = =91 to pull it into an edit buffer, then C-c =91 again to go back to the = org file, the result is
,#! = /bin/bash
,# = some comments here... they'll be preceded by commas after C-c ' = editing
Note the = commas in front of each # (comment = character).
This seems = to happen to # characters regardless of the editing mode=85 I tried a = Java snippet with the same results:
# = hash comment
// = java comment here
    private = String myVariable; // inline comment = here
,# = hash comment
// = java comment here
    private = String myVariable; // inline comment = here
I=92m = running the following:
Org-mode = version 6.06b
GNU Emacs = 23.0.60.1 (i386-mingw-nt5.1.2600) of 2008-08-19 on LENNART-69DE564 = (patched)
Thanks for = org-mode=85 I=92ve been using this amazing piece of software almost as = long as I=92ve been using Emacs (a couple of years = now).
Don = Womick
Emacs-orgmode@gnu.org