all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Comments in Org-mode
@ 2009-07-15  0:09 Manuel Amador
  2009-07-15  0:44 ` Russell Adams
  0 siblings, 1 reply; 16+ messages in thread
From: Manuel Amador @ 2009-07-15  0:09 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

Hi everybody, 

I think I have found a bug (or a feature!). Sometimes when
writing documents I tend to comment out a line by adding a "#"
in the column 0. However, after doing this in a line at the
middle of the document, I get the following behavior:

------------------------------------------------------------
* Random stuff

  Some initial things. 
   
# Then I comment this line out

  But when I keep writing a sufficiently long line such that  
# the cursor moves to the next line, a "#" character creeps in!
# and will keep appearing for the remainder of the document. 
----------------------------------------------------------

The last two starting "#" characters are unintentional, they are
put there automatically by emacs. 

(I am using fill-mode, my org-mode is from the git repository,
and my version of emacs is 23.0.91.1 running in Ubuntu)

Manuel 

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Comments in Org-mode
  2009-07-15  0:09 Comments in Org-mode Manuel Amador
@ 2009-07-15  0:44 ` Russell Adams
  2009-07-15  1:14   ` Sebastian Rose
  0 siblings, 1 reply; 16+ messages in thread
From: Russell Adams @ 2009-07-15  0:44 UTC (permalink / raw)
  To: emacs-orgmode

I just tried that in 6.24b with auto-fill-mode, and no problems.

On Tue, Jul 14, 2009 at 05:09:30PM -0700, Manuel Amador wrote:
> Hi everybody, 
> 
> I think I have found a bug (or a feature!). Sometimes when
> writing documents I tend to comment out a line by adding a "#"
> in the column 0. However, after doing this in a line at the
> middle of the document, I get the following behavior:
> 
> ------------------------------------------------------------
> * Random stuff
> 
>   Some initial things. 
>    
> # Then I comment this line out
> 
>   But when I keep writing a sufficiently long line such that  
> # the cursor moves to the next line, a "#" character creeps in!
> # and will keep appearing for the remainder of the document. 
> ----------------------------------------------------------
> 
> The last two starting "#" characters are unintentional, they are
> put there automatically by emacs. 
> 
> (I am using fill-mode, my org-mode is from the git repository,
> and my version of emacs is 23.0.91.1 running in Ubuntu)
> 
> Manuel 
> 
> 
> _______________________________________________
> 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
> 


------------------------------------------------------------------
Russell Adams                            RLAdams@AdamsInfoServ.com

PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/

Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Comments in Org-mode
  2009-07-15  0:44 ` Russell Adams
@ 2009-07-15  1:14   ` Sebastian Rose
  2009-07-15  3:45     ` Manuel Amador
  0 siblings, 1 reply; 16+ messages in thread
From: Sebastian Rose @ 2009-07-15  1:14 UTC (permalink / raw)
  To: emacs-orgmode

Russell Adams <RLAdams@AdamsInfoServ.Com> writes:
> I just tried that in 6.24b with auto-fill-mode, and no problems.



Same here. Maybe it's the "old" emacs development-snappshot?
There where quite some bugs - it's not a release version.

I know I saw that problem...

I use the current emacs CVS version and it's fine.


emacs 23.1.50.1, org-mode 6.24a, Debian testing.


  Sebastian

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Comments in Org-mode
  2009-07-15  1:14   ` Sebastian Rose
@ 2009-07-15  3:45     ` Manuel Amador
  2009-07-15  4:52       ` Russell Adams
                         ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Manuel Amador @ 2009-07-15  3:45 UTC (permalink / raw)
  To: Sebastian Rose; +Cc: emacs-orgmode

Hi Sebastian and Russell,

You are correct. The problem appears after I comment a region in org-mode with:

M-x comment-region <enter> # <enter>

After that, every time auto-fill does its magic, I get a # at the
beginning of each new line.

Manuel


On Tue, Jul 14, 2009 at 6:14 PM, Sebastian Rose<sebastian_rose@gmx.de> wrote:
> Russell Adams <RLAdams@AdamsInfoServ.Com> writes:
>> I just tried that in 6.24b with auto-fill-mode, and no problems.
>
>
>
> Same here. Maybe it's the "old" emacs development-snappshot?
> There where quite some bugs - it's not a release version.
>
> I know I saw that problem...
>
> I use the current emacs CVS version and it's fine.
>
>
> emacs 23.1.50.1, org-mode 6.24a, Debian testing.
>
>
>  Sebastian
>
>
> _______________________________________________
> 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] 16+ messages in thread

* Re: Comments in Org-mode
  2009-07-15  3:45     ` Manuel Amador
@ 2009-07-15  4:52       ` Russell Adams
  2009-07-15  5:06         ` Samuel Wales
  2009-07-15 11:15       ` Sebastian Rose
  2009-08-03  4:29       ` Carsten Dominik
  2 siblings, 1 reply; 16+ messages in thread
From: Russell Adams @ 2009-07-15  4:52 UTC (permalink / raw)
  To: emacs-orgmode

Wow! I can duplicate that!

I did the same, and started typing after a region I had used
comment-region on, and it commented new lines after that during fill.



On Tue, Jul 14, 2009 at 08:45:32PM -0700, Manuel Amador wrote:
> Hi Sebastian and Russell,
> 
> You are correct. The problem appears after I comment a region in org-mode with:
> 
> M-x comment-region <enter> # <enter>
> 
> After that, every time auto-fill does its magic, I get a # at the
> beginning of each new line.
> 
> Manuel
> 
> 
> On Tue, Jul 14, 2009 at 6:14 PM, Sebastian Rose<sebastian_rose@gmx.de> wrote:
> > Russell Adams <RLAdams@AdamsInfoServ.Com> writes:
> >> I just tried that in 6.24b with auto-fill-mode, and no problems.
> >
> >
> >
> > Same here. Maybe it's the "old" emacs development-snappshot?
> > There where quite some bugs - it's not a release version.
> >
> > I know I saw that problem...
> >
> > I use the current emacs CVS version and it's fine.
> >
> >
> > emacs 23.1.50.1, org-mode 6.24a, Debian testing.
> >
> >
> > ?Sebastian
> >
> >
> > _______________________________________________
> > 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
> >
> 
> 
> _______________________________________________
> 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
> 


------------------------------------------------------------------
Russell Adams                            RLAdams@AdamsInfoServ.com

PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/

Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Comments in Org-mode
  2009-07-15  4:52       ` Russell Adams
@ 2009-07-15  5:06         ` Samuel Wales
  2009-07-15  5:23           ` Manuel Amador
  0 siblings, 1 reply; 16+ messages in thread
From: Samuel Wales @ 2009-07-15  5:06 UTC (permalink / raw)
  To: emacs-orgmode

As far as I know, I fixed it in the thread whose subject is
"Protecting comment lines from fill-paragraph".

On Tue, Jul 14, 2009 at 21:52, Russell Adams<RLAdams@adamsinfoserv.com> wrote:
> Wow! I can duplicate that!
>
> I did the same, and started typing after a region I had used
> comment-region on, and it commented new lines after that during fill.
>
>
>
> On Tue, Jul 14, 2009 at 08:45:32PM -0700, Manuel Amador wrote:
>> Hi Sebastian and Russell,
>>
>> You are correct. The problem appears after I comment a region in org-mode with:
>>
>> M-x comment-region <enter> # <enter>
>>
>> After that, every time auto-fill does its magic, I get a # at the
>> beginning of each new line.
>>
>> Manuel
>>
>>
>> On Tue, Jul 14, 2009 at 6:14 PM, Sebastian Rose<sebastian_rose@gmx.de> wrote:
>> > Russell Adams <RLAdams@AdamsInfoServ.Com> writes:
>> >> I just tried that in 6.24b with auto-fill-mode, and no problems.
>> >
>> >
>> >
>> > Same here. Maybe it's the "old" emacs development-snappshot?
>> > There where quite some bugs - it's not a release version.
>> >
>> > I know I saw that problem...
>> >
>> > I use the current emacs CVS version and it's fine.
>> >
>> >
>> > emacs 23.1.50.1, org-mode 6.24a, Debian testing.
>> >
>> >
>> > ?Sebastian
>> >
>> >
>> > _______________________________________________
>> > 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
>> >
>>
>>
>> _______________________________________________
>> 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
>>
>
>
> ------------------------------------------------------------------
> Russell Adams                            RLAdams@AdamsInfoServ.com
>
> PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/
>
> Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3
>
>
> _______________________________________________
> 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
>



-- 
Myalgic encephalomyelitis makes you die decades early (Jason
et al. 2006) and suffer severely.  Conflicts of interest are
destroying research.  Silence = death.  Again.
http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Comments in Org-mode
  2009-07-15  5:06         ` Samuel Wales
@ 2009-07-15  5:23           ` Manuel Amador
  2009-07-15  5:26             ` Samuel Wales
  2009-07-15 14:35             ` Matthew Lundin
  0 siblings, 2 replies; 16+ messages in thread
From: Manuel Amador @ 2009-07-15  5:23 UTC (permalink / raw)
  To: Samuel Wales; +Cc: emacs-orgmode

Samuel,

Thanks for replying. The thread that you mentioned however, seems to
be concerned with a different issue.

My issue shows up not just in a line right after a commented line, but
could happen anywhere later in the text. That is, after the
comment-region command is used, every time a new line is automatically
created, it starts with #.

Manuel

On Tue, Jul 14, 2009 at 10:06 PM, Samuel Wales<samologist@gmail.com> wrote:
> As far as I know, I fixed it in the thread whose subject is
> "Protecting comment lines from fill-paragraph".
>
> On Tue, Jul 14, 2009 at 21:52, Russell Adams<RLAdams@adamsinfoserv.com> wrote:
>> Wow! I can duplicate that!
>>
>> I did the same, and started typing after a region I had used
>> comment-region on, and it commented new lines after that during fill.
>>
>>
>>
>> On Tue, Jul 14, 2009 at 08:45:32PM -0700, Manuel Amador wrote:
>>> Hi Sebastian and Russell,
>>>
>>> You are correct. The problem appears after I comment a region in org-mode with:
>>>
>>> M-x comment-region <enter> # <enter>
>>>
>>> After that, every time auto-fill does its magic, I get a # at the
>>> beginning of each new line.
>>>
>>> Manuel
>>>
>>>
>>> On Tue, Jul 14, 2009 at 6:14 PM, Sebastian Rose<sebastian_rose@gmx.de> wrote:
>>> > Russell Adams <RLAdams@AdamsInfoServ.Com> writes:
>>> >> I just tried that in 6.24b with auto-fill-mode, and no problems.
>>> >
>>> >
>>> >
>>> > Same here. Maybe it's the "old" emacs development-snappshot?
>>> > There where quite some bugs - it's not a release version.
>>> >
>>> > I know I saw that problem...
>>> >
>>> > I use the current emacs CVS version and it's fine.
>>> >
>>> >
>>> > emacs 23.1.50.1, org-mode 6.24a, Debian testing.
>>> >
>>> >
>>> > ?Sebastian
>>> >
>>> >
>>> > _______________________________________________
>>> > 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
>>> >
>>>
>>>
>>> _______________________________________________
>>> 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
>>>
>>
>>
>> ------------------------------------------------------------------
>> Russell Adams                            RLAdams@AdamsInfoServ.com
>>
>> PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/
>>
>> Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3
>>
>>
>> _______________________________________________
>> 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
>>
>
>
>
> --
> Myalgic encephalomyelitis makes you die decades early (Jason
> et al. 2006) and suffer severely.  Conflicts of interest are
> destroying research.  Silence = death.  Again.
> http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm
>
>
> _______________________________________________
> 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] 16+ messages in thread

* Re: Comments in Org-mode
  2009-07-15  5:23           ` Manuel Amador
@ 2009-07-15  5:26             ` Samuel Wales
  2009-07-15 14:35             ` Matthew Lundin
  1 sibling, 0 replies; 16+ messages in thread
From: Samuel Wales @ 2009-07-15  5:26 UTC (permalink / raw)
  To: amador; +Cc: emacs-orgmode

I do not experience the problem you describe.

Did you try the solution anyway?  If it doesn't work, there are things to try.

On Tue, Jul 14, 2009 at 22:23, Manuel Amador<amador.manuel@gmail.com> wrote:
> Samuel,
>
> Thanks for replying. The thread that you mentioned however, seems to
> be concerned with a different issue.
>
> My issue shows up not just in a line right after a commented line, but
> could happen anywhere later in the text. That is, after the
> comment-region command is used, every time a new line is automatically
> created, it starts with #.
>
> Manuel
>
> On Tue, Jul 14, 2009 at 10:06 PM, Samuel Wales<samologist@gmail.com> wrote:
>> As far as I know, I fixed it in the thread whose subject is
>> "Protecting comment lines from fill-paragraph".
>>
>> On Tue, Jul 14, 2009 at 21:52, Russell Adams<RLAdams@adamsinfoserv.com> wrote:
>>> Wow! I can duplicate that!
>>>
>>> I did the same, and started typing after a region I had used
>>> comment-region on, and it commented new lines after that during fill.
>>>
>>>
>>>
>>> On Tue, Jul 14, 2009 at 08:45:32PM -0700, Manuel Amador wrote:
>>>> Hi Sebastian and Russell,
>>>>
>>>> You are correct. The problem appears after I comment a region in org-mode with:
>>>>
>>>> M-x comment-region <enter> # <enter>
>>>>
>>>> After that, every time auto-fill does its magic, I get a # at the
>>>> beginning of each new line.
>>>>
>>>> Manuel
>>>>
>>>>
>>>> On Tue, Jul 14, 2009 at 6:14 PM, Sebastian Rose<sebastian_rose@gmx.de> wrote:
>>>> > Russell Adams <RLAdams@AdamsInfoServ.Com> writes:
>>>> >> I just tried that in 6.24b with auto-fill-mode, and no problems.
>>>> >
>>>> >
>>>> >
>>>> > Same here. Maybe it's the "old" emacs development-snappshot?
>>>> > There where quite some bugs - it's not a release version.
>>>> >
>>>> > I know I saw that problem...
>>>> >
>>>> > I use the current emacs CVS version and it's fine.
>>>> >
>>>> >
>>>> > emacs 23.1.50.1, org-mode 6.24a, Debian testing.
>>>> >
>>>> >
>>>> > ?Sebastian
>>>> >
>>>> >
>>>> > _______________________________________________
>>>> > 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
>>>> >
>>>>
>>>>
>>>> _______________________________________________
>>>> 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
>>>>
>>>
>>>
>>> ------------------------------------------------------------------
>>> Russell Adams                            RLAdams@AdamsInfoServ.com
>>>
>>> PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/
>>>
>>> Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3
>>>
>>>
>>> _______________________________________________
>>> 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
>>>
>>
>>
>>
>> --
>> Myalgic encephalomyelitis makes you die decades early (Jason
>> et al. 2006) and suffer severely.  Conflicts of interest are
>> destroying research.  Silence = death.  Again.
>> http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm
>>
>>
>> _______________________________________________
>> 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
>>
>



-- 
Myalgic encephalomyelitis makes you die decades early (Jason
et al. 2006) and suffer severely.  Conflicts of interest are
destroying research.  Silence = death.  Again.
http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Comments in Org-mode
  2009-07-15  3:45     ` Manuel Amador
  2009-07-15  4:52       ` Russell Adams
@ 2009-07-15 11:15       ` Sebastian Rose
  2009-08-03  4:29       ` Carsten Dominik
  2 siblings, 0 replies; 16+ messages in thread
From: Sebastian Rose @ 2009-07-15 11:15 UTC (permalink / raw)
  To: amador; +Cc: emacs-orgmode

Manuel Amador <amador.manuel@gmail.com> writes:
> Hi Sebastian and Russell,
>
> You are correct. The problem appears after I comment a region in org-mode with:
>
> M-x comment-region <enter> # <enter>


Ahh - yes. If I comment something with

  M-x comment-region <enter> # <enter>

it happens here, too.


I never did that in Org-mode - I simply add an `#' and that's OK.

To comment a region I do

   C-x r t # RET

as `comment-region' doesn't seem to do the right thing anyway (add the
comment character in line 0) and it's faster to type (in c-mode we have
`C-c C-c' which I use a lot though).

Shouldn't Org-mode provide it's own `comment-region-function'? Or at
least re-define `comment-start' et al?




   Sebastian

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Comments in Org-mode
  2009-07-15  5:23           ` Manuel Amador
  2009-07-15  5:26             ` Samuel Wales
@ 2009-07-15 14:35             ` Matthew Lundin
  2009-07-15 16:03               ` Samuel Wales
  2009-07-15 17:15               ` Sebastian Rose
  1 sibling, 2 replies; 16+ messages in thread
From: Matthew Lundin @ 2009-07-15 14:35 UTC (permalink / raw)
  To: amador; +Cc: emacs-orgmode

Manuel Amador <amador.manuel@gmail.com> writes:

> I think I have found a bug (or a feature!). Sometimes when
> writing documents I tend to comment out a line by adding a "#"
> in the column 0. However, after doing this in a line at the
> middle of the document, I get the following behavior:
>
> ------------------------------------------------------------
> * Random stuff
>
>   Some initial things. 
>    
> # Then I comment this line out
>
>   But when I keep writing a sufficiently long line such that  
> # the cursor moves to the next line, a "#" character creeps in!
> # and will keep appearing for the remainder of the document. 
> ----------------------------------------------------------

I cannot duplicate the problem (but only partially). I experienced extra
comment lines inserted only when there was no space between the initial
comment line and the uncommented line, i.e.:

--8<---------------cut here---------------start------------->8---
# Then I comment this line out
  But when I keep writing a sufficiently long line such that  
# the cursor moves to the next line, a "#" character creeps in!
# and will keep appearing for the remainder of the document. 
--8<---------------cut here---------------end--------------->8---

I did not experience extra comment lines in lines further down the text.

I'm running the latest git org-mode and a recent development emacs --
GNU Emacs 23.1.50.1 (i686-pc-linux-gnu, GTK+ Version 2.16.2) of
2009-07-01 -- on archlinux.

> Samuel,
>
> Thanks for replying. The thread that you mentioned however, seems to
> be concerned with a different issue.
>
> My issue shows up not just in a line right after a commented line, but
> could happen anywhere later in the text. That is, after the
> comment-region command is used, every time a new line is automatically
> created, it starts with #.

http://article.gmane.org/gmane.emacs.orgmode/13312

I can confirm that Samuel's advice above offers an interim fix for the
problem I was experiencing (i.e., comment lines added on filled lines
when there was no empty line between the initial commented line and the
subsequent uncommented line --- now that's a mouthful!). I'm not sure
whether the fix addresses the problem of unwanted comment lines father
down in the text (which I could not replicate).

Best,
Matt

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Comments in Org-mode
  2009-07-15 14:35             ` Matthew Lundin
@ 2009-07-15 16:03               ` Samuel Wales
  2009-07-15 16:23                 ` Manuel Amador
  2009-07-15 17:15               ` Sebastian Rose
  1 sibling, 1 reply; 16+ messages in thread
From: Samuel Wales @ 2009-07-15 16:03 UTC (permalink / raw)
  To: Matthew Lundin; +Cc: amador, emacs-orgmode

If it does not fully solve the problem, make comment-start a local
variable, check fill-prefix, and make sure your load and mode hooks
don't affect filling, or if they do, that they are idempotent.

       (setq comment-empty-lines t)
       (set (make-local-variable 'comment-start) "#")

On Wed, Jul 15, 2009 at 07:35, Matthew Lundin<mdl@imapmail.org> wrote:
> http://article.gmane.org/gmane.emacs.orgmode/13312

-- 
Myalgic encephalomyelitis makes you die decades early (Jason
et al. 2006) and suffer severely.  Conflicts of interest are
destroying research.  Silence = death.  Again.
http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Comments in Org-mode
  2009-07-15 16:03               ` Samuel Wales
@ 2009-07-15 16:23                 ` Manuel Amador
  0 siblings, 0 replies; 16+ messages in thread
From: Manuel Amador @ 2009-07-15 16:23 UTC (permalink / raw)
  To: Samuel Wales; +Cc: amador, Matthew Lundin, emacs-orgmode

Samuel,

Your previous fix does seem to work for me. Thanks!

Manuel 

 On Wed, Jul 15, 2009 at 09:03:44AM -0700, Samuel Wales wrote:
> If it does not fully solve the problem, make comment-start a local
> variable, check fill-prefix, and make sure your load and mode hooks
> don't affect filling, or if they do, that they are idempotent.
> 
>        (setq comment-empty-lines t)
>        (set (make-local-variable 'comment-start) "#")
> 
> On Wed, Jul 15, 2009 at 07:35, Matthew Lundin<mdl@imapmail.org> wrote:
> > http://article.gmane.org/gmane.emacs.orgmode/13312
> 
> -- 
> Myalgic encephalomyelitis makes you die decades early (Jason
> et al. 2006) and suffer severely.  Conflicts of interest are
> destroying research.  Silence = death.  Again.
> http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Re: Comments in Org-mode
  2009-07-15 14:35             ` Matthew Lundin
  2009-07-15 16:03               ` Samuel Wales
@ 2009-07-15 17:15               ` Sebastian Rose
  2009-07-15 17:48                 ` Manuel Amador
  1 sibling, 1 reply; 16+ messages in thread
From: Sebastian Rose @ 2009-07-15 17:15 UTC (permalink / raw)
  To: Matthew Lundin; +Cc: amador, emacs-orgmode

Matthew Lundin <mdl@imapmail.org> writes:
> Manuel Amador <amador.manuel@gmail.com> writes:
>
>> I think I have found a bug (or a feature!). Sometimes when
>> writing documents I tend to comment out a line by adding a "#"
>> in the column 0. However, after doing this in a line at the
>> middle of the document, I get the following behavior:
>>
>> ------------------------------------------------------------
>> * Random stuff
>>
>>   Some initial things.
>>
>> # Then I comment this line out
>>
>>   But when I keep writing a sufficiently long line such that
>> # the cursor moves to the next line, a "#" character creeps in!
>> # and will keep appearing for the remainder of the document.
>> ----------------------------------------------------------
>
> I cannot duplicate the problem (but only partially). I experienced extra
> comment lines inserted only when there was no space between the initial
> comment line and the uncommented line, i.e.:
>
>
> # Then I comment this line out
>   But when I keep writing a sufficiently long line such that
> # the cursor moves to the next line, a "#" character creeps in!
> # and will keep appearing for the remainder of the document.
>
> I did not experience extra comment lines in lines further down the text.


I can reproduce it with `emacs -Q' here (transient-mark-mode is t in
current emacs 23). The trick is to use `comment-region'.

Here's the recipe:


sh$  emacs -Q

  C-x d ~/emacs/lisp/ext/org-mode/lisp RET
  % m \.elc$   RET
  L y
  L y
  L y
  L y
  L y

  ... until files are loaded successfully

  C-x C-f file.org
  M-x auto-fill-mode



To get the error, you must select a region:

   C-SPACE C-n C-n C-n
   M-x comment-region RET # RET

Note here: the indentation is wrong. You might want to correct this,
before going on (comment char not in first column). It doesn't change
the behavior.


Now type some `C-j' more text and see what happens.




The bad thing is, once it started, it never ends. No matter where text
is wrapped, you get the `#' at the start of line.







Also, _no_ comment char is inserted, if add a comment by hand without a
preceding new line. To try this, you'll have to restart emacs -Q

       weoru oeori tueportpoeiurptoeiurtopueoru toeuiroeuir topewrtoeoru
       toeu toe  ewprou oeur poeuiopuwe rteowp ru erwoi uteo t.
     # Asdfsdf - NOW ADD A LOT OF TEXT TO THIS COMMENT ...





  Sebastian

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Re: Comments in Org-mode
  2009-07-15 17:15               ` Sebastian Rose
@ 2009-07-15 17:48                 ` Manuel Amador
  0 siblings, 0 replies; 16+ messages in thread
From: Manuel Amador @ 2009-07-15 17:48 UTC (permalink / raw)
  To: Sebastian Rose; +Cc: emacs-orgmode

Sebastian, 

The proposed fix by Samuel did seem to correct this problem for
me. This is what I added to my .emacs file:

(require 'filladapt)  ;; fixes problems with autofill in orgmode
(if (featurep 'filladapt) (filladapt-mode 1))
(setq filladapt-token-table
  '(
    ;; this must be first
    ("^" beginning-of-line)
    ;; Included text in news or mail replies
    (">+" citation->)
    ;; Included text generated by SUPERCITE.  We can't hope to match all
    ;; the possible variations, your mileage may vary.
    ("\\(\\w\\|[0-9]\\)[^'`\"< \t\n]*>[ \t]*" supercite-citation)
    ;; Lisp comments
    (";+" lisp-comment)
    ;; UNIX shell comments
    ("#+" sh-comment)
    ;; Postscript comments
    ("%+" postscript-comment)
    ;; C++ comments
    ("///*" c++-comment)
    ;; Texinfo comments
    ("@c[ \t]" texinfo-comment)
    ("@comment[ \t]" texinfo-comment)
    ;; Bullet types.
    ;;
    ;; LaTex \item
    ;;
    ("\\\\item[ \t]" bullet)
    ;;
    ;; 1. xxxxx
    ;;    xxxxx
    ;;
    ("^[ 	]+[0-9]+\\.[ \t]" bullet)
    ;;
    ;; 2.1.3  xxxxx xx x xx x
    ;;        xxx
    ;;
    ("^[ 	]+[0-9]+\\(\\.[0-9]+\\)+[ \t]" bullet)
    ;;
    ;; a. xxxxxx xx
    ;;    xxx xxx
    ;;
    ("^[ 	]+[A-Za-z]\\.[ \t]" bullet)
    ;;
    ;; 1) xxxx x xx x xx   or   (1) xx xx x x xx xx
    ;;    xx xx xxxx                xxx xx x x xx x
    ;;
    ("^[ 	]+(?[0-9]+)[ \t]" bullet)
    ;;
    ;; a) xxxx x xx x xx   or   (a) xx xx x x xx xx
    ;;    xx xx xxxx                xxx xx x x xx x
    ;;
    ("^[ 	]+(?[A-Za-z])[ \t]" bullet)
    ;;
    ;; 2a. xx x xxx x x xxx
    ;;     xxx xx x xx x
    ;;
    ("^[ 	]+[0-9]+[A-Za-z]\\.[ \t]" bullet)
    ;;
    ;; 1a) xxxx x xx x xx   or   (1a) xx xx x x xx xx
    ;;     xx xx xxxx                 xxx xx x x xx x
    ;;
    ("^[ 	]+(?[0-9]+[A-Za-z])[ \t]" bullet)
    ;;
    ;; -  xx xxx xxxx   or   *  xx xx x xxx xxx
    ;;    xxx xx xx             x xxx x xx x x x
    ;;
    ("^[ 	]+[-~*+]+[ \t]" bullet)
    ;;
    ;; o  xx xxx xxxx xx x xx xxx x xxx xx x xxx
    ;;    xxx xx xx
    ;;
    ("^[ 	]+o[ \t]" bullet)
    ;; don't touch
    ("[ \t]+" space)
    ("$" end-of-line)
    ))

Manuel 

On Wed, Jul 15, 2009 at 07:15:42PM +0200, Sebastian Rose wrote:
> Matthew Lundin <mdl@imapmail.org> writes:
> > Manuel Amador <amador.manuel@gmail.com> writes:
> >
> >> I think I have found a bug (or a feature!). Sometimes when
> >> writing documents I tend to comment out a line by adding a "#"
> >> in the column 0. However, after doing this in a line at the
> >> middle of the document, I get the following behavior:
> >>
> >> ------------------------------------------------------------
> >> * Random stuff
> >>
> >>   Some initial things.
> >>
> >> # Then I comment this line out
> >>
> >>   But when I keep writing a sufficiently long line such that
> >> # the cursor moves to the next line, a "#" character creeps in!
> >> # and will keep appearing for the remainder of the document.
> >> ----------------------------------------------------------
> >
> > I cannot duplicate the problem (but only partially). I experienced extra
> > comment lines inserted only when there was no space between the initial
> > comment line and the uncommented line, i.e.:
> >
> >
> > # Then I comment this line out
> >   But when I keep writing a sufficiently long line such that
> > # the cursor moves to the next line, a "#" character creeps in!
> > # and will keep appearing for the remainder of the document.
> >
> > I did not experience extra comment lines in lines further down the text.
> 
> 
> I can reproduce it with `emacs -Q' here (transient-mark-mode is t in
> current emacs 23). The trick is to use `comment-region'.
> 
> Here's the recipe:
> 
> 
> sh$  emacs -Q
> 
>   C-x d ~/emacs/lisp/ext/org-mode/lisp RET
>   % m \.elc$   RET
>   L y
>   L y
>   L y
>   L y
>   L y
> 
>   ... until files are loaded successfully
> 
>   C-x C-f file.org
>   M-x auto-fill-mode
> 
> 
> 
> To get the error, you must select a region:
> 
>    C-SPACE C-n C-n C-n
>    M-x comment-region RET # RET
> 
> Note here: the indentation is wrong. You might want to correct this,
> before going on (comment char not in first column). It doesn't change
> the behavior.
> 
> 
> Now type some `C-j' more text and see what happens.
> 
> 
> 
> 
> The bad thing is, once it started, it never ends. No matter where text
> is wrapped, you get the `#' at the start of line.
> 
> 
> 
> 
> 
> 
> 
> Also, _no_ comment char is inserted, if add a comment by hand without a
> preceding new line. To try this, you'll have to restart emacs -Q
> 
>        weoru oeori tueportpoeiurptoeiurtopueoru toeuiroeuir topewrtoeoru
>        toeu toe  ewprou oeur poeuiopuwe rteowp ru erwoi uteo t.
>      # Asdfsdf - NOW ADD A LOT OF TEXT TO THIS COMMENT ...
> 
> 
> 
> 
> 
>   Sebastian

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Comments in Org-mode
  2009-07-15  3:45     ` Manuel Amador
  2009-07-15  4:52       ` Russell Adams
  2009-07-15 11:15       ` Sebastian Rose
@ 2009-08-03  4:29       ` Carsten Dominik
  2009-08-03 22:43         ` Samuel Wales
  2 siblings, 1 reply; 16+ messages in thread
From: Carsten Dominik @ 2009-08-03  4:29 UTC (permalink / raw)
  To: amador; +Cc: emacs-orgmode


On Jul 15, 2009, at 5:45 AM, Manuel Amador wrote:

> Hi Sebastian and Russell,
>
> You are correct. The problem appears after I comment a region in org- 
> mode with:
>
> M-x comment-region <enter> # <enter>
>
> After that, every time auto-fill does its magic, I get a # at the
> beginning of each new line.

Yes.  Running this command sets the variable comment-start, which
then breaks automatic filling.  I have never understood why, it would
be nice to fix this problem, but I don't know how.

Samuel's solution to use filladapt might work, but it replaces much
of Org's wrapping code with something else - which I don't really want.

- Carsten


>
> Manuel
>
>
> On Tue, Jul 14, 2009 at 6:14 PM, Sebastian  
> Rose<sebastian_rose@gmx.de> wrote:
>> Russell Adams <RLAdams@AdamsInfoServ.Com> writes:
>>> I just tried that in 6.24b with auto-fill-mode, and no problems.
>>
>>
>>
>> Same here. Maybe it's the "old" emacs development-snappshot?
>> There where quite some bugs - it's not a release version.
>>
>> I know I saw that problem...
>>
>> I use the current emacs CVS version and it's fine.
>>
>>
>> emacs 23.1.50.1, org-mode 6.24a, Debian testing.
>>
>>
>>  Sebastian
>>
>>
>> _______________________________________________
>> 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
>>
>
>
> _______________________________________________
> 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] 16+ messages in thread

* Re: Comments in Org-mode
  2009-08-03  4:29       ` Carsten Dominik
@ 2009-08-03 22:43         ` Samuel Wales
  0 siblings, 0 replies; 16+ messages in thread
From: Samuel Wales @ 2009-08-03 22:43 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: amador, emacs-orgmode

Hi Carsten,

On 2009-08-02, Carsten Dominik <carsten.dominik@gmail.com> wrote:
> Yes.  Running this command sets the variable comment-start, which
> then breaks automatic filling.  I have never understood why, it would
> be nice to fix this problem, but I don't know how.

It works for me.  However, I don't know if the fix was my changes to
filladapt or the fact that I set comment-start to be buffer-local.
See my posts earlier in this thread.

> Samuel's solution to use filladapt might work, but it replaces much
> of Org's wrapping code with something else - which I don't really want.

It does work for me, for what it's worth :).  But perhaps suitable for contrib.

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2009-08-03 22:43 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-15  0:09 Comments in Org-mode Manuel Amador
2009-07-15  0:44 ` Russell Adams
2009-07-15  1:14   ` Sebastian Rose
2009-07-15  3:45     ` Manuel Amador
2009-07-15  4:52       ` Russell Adams
2009-07-15  5:06         ` Samuel Wales
2009-07-15  5:23           ` Manuel Amador
2009-07-15  5:26             ` Samuel Wales
2009-07-15 14:35             ` Matthew Lundin
2009-07-15 16:03               ` Samuel Wales
2009-07-15 16:23                 ` Manuel Amador
2009-07-15 17:15               ` Sebastian Rose
2009-07-15 17:48                 ` Manuel Amador
2009-07-15 11:15       ` Sebastian Rose
2009-08-03  4:29       ` Carsten Dominik
2009-08-03 22:43         ` Samuel Wales

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.