* C-c ' prepends , to shell comment lines
@ 2008-10-04 14:17 Womick, Don
2008-10-05 9:05 ` Carsten Dominik
0 siblings, 1 reply; 4+ messages in thread
From: Womick, Don @ 2008-10-04 14:17 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1.1: Type: text/plain, Size: 1629 bytes --]
After running C-c ' (apostrophe) on a shell script between #+BEGIN_SRC
and #+END_SRC tags and returning to the org file using C-c ' 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 '
editing
#
ls
cat myfile # inline comment here, isn't affected
#+END_SRC
and do C-c ' to pull it into an edit buffer, then C-c ' again to go 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 '
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... 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'm 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... I've been using this amazing piece of software
almost as long as I've been using Emacs (a couple of years now).
Regards,
Don Womick
[-- Attachment #1.2: Type: text/html, Size: 9956 bytes --]
[-- Attachment #2: Type: text/plain, Size: 204 bytes --]
_______________________________________________
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: C-c ' prepends , to shell comment lines
2008-10-04 14:17 C-c ' prepends , to shell comment lines Womick, Don
@ 2008-10-05 9:05 ` Carsten Dominik
2008-10-05 10:42 ` Womick, Don
0 siblings, 1 reply; 4+ messages in thread
From: Carsten Dominik @ 2008-10-05 9:05 UTC (permalink / raw)
To: Womick, Don; +Cc: emacs-orgmode
[-- Attachment #1.1: Type: text/plain, Size: 2556 bytes --]
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 ‘ (apostrophe) on a shell script between #
> +BEGIN_SRC and #+END_SRC tags and returning to the org file using C-
> c ‘ 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 '
> editing
> #
> ls
> cat myfile # inline comment here, isn't affected
> #+END_SRC
>
> and do C-c ‘ to pull it into an edit buffer, then C-c ‘ again to go
> 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 '
> 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…
> 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’m 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… I’ve been using this amazing piece of software
> almost as long as I’ve 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
[-- Attachment #1.2: Type: text/html, Size: 17887 bytes --]
[-- Attachment #2: Type: text/plain, Size: 204 bytes --]
_______________________________________________
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: C-c ' prepends , to shell comment lines
2008-10-05 9:05 ` Carsten Dominik
@ 2008-10-05 10:42 ` Womick, Don
2008-10-05 11:17 ` Carsten Dominik
0 siblings, 1 reply; 4+ messages in thread
From: Womick, Don @ 2008-10-05 10:42 UTC (permalink / raw)
To: Carsten Dominik; +Cc: emacs-orgmode
[-- Attachment #1.1: Type: text/plain, Size: 3064 bytes --]
Carsten, thanks. That makes sense, once you know about it.
I don't think this behavior is documented. Can you add it the manual?
Might prevent a stupid question or two... :-)
Regards,
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 ' (apostrophe) on a shell script between #+BEGIN_SRC
and #+END_SRC tags and returning to the org file using C-c ' 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 '
editing
#
ls
cat myfile # inline comment here, isn't affected
#+END_SRC
and do C-c ' to pull it into an edit buffer, then C-c ' again to go 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 '
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... 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'm 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... I've been using this amazing piece of software
almost as long as I've 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
[-- Attachment #1.2: Type: text/html, Size: 22682 bytes --]
[-- Attachment #2: Type: text/plain, Size: 204 bytes --]
_______________________________________________
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: C-c ' prepends , to shell comment lines
2008-10-05 10:42 ` Womick, Don
@ 2008-10-05 11:17 ` Carsten Dominik
0 siblings, 0 replies; 4+ messages in thread
From: Carsten Dominik @ 2008-10-05 11:17 UTC (permalink / raw)
To: Womick, Don; +Cc: emacs-orgmode
[-- Attachment #1.1: Type: text/plain, Size: 3189 bytes --]
On Oct 5, 2008, at 12:42 PM, Womick, Don wrote:
> Carsten, thanks. That makes sense, once you know about it.
>
> I don’t think this behavior is documented. Can you add it the
> manual? Might prevent a stupid question or two… 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
> 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 ‘ (apostrophe) on a shell script between #
> +BEGIN_SRC and #+END_SRC tags and returning to the org file using C-
> c ‘ 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 '
> editing
> #
> ls
> cat myfile # inline comment here, isn't affected
> #+END_SRC
>
> and do C-c ‘ to pull it into an edit buffer, then C-c ‘ again to go
> 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 '
> 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…
> 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’m 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… I’ve been using this amazing piece of software
> almost as long as I’ve 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
>
[-- Attachment #1.2: Type: text/html, Size: 33569 bytes --]
[-- Attachment #2: Type: text/plain, Size: 204 bytes --]
_______________________________________________
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-10-05 11:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-04 14:17 C-c ' prepends , to shell comment lines Womick, Don
2008-10-05 9:05 ` Carsten Dominik
2008-10-05 10:42 ` Womick, Don
2008-10-05 11:17 ` Carsten Dominik
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).