From: Manuel Amador <amador.manuel@gmail.com>
To: Sebastian Rose <sebastian_rose@gmx.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: Re: Comments in Org-mode
Date: Wed, 15 Jul 2009 10:48:52 -0700 [thread overview]
Message-ID: <20090715174852.GE21551@laflaca.Stanford.EDU> (raw)
In-Reply-To: <87iqhtq341.fsf@kassiopeya.MSHEIMNETZ>
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
next prev parent reply other threads:[~2009-07-15 17:49 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2009-07-15 11:15 ` Sebastian Rose
2009-08-03 4:29 ` Carsten Dominik
2009-08-03 22:43 ` Samuel Wales
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090715174852.GE21551@laflaca.Stanford.EDU \
--to=amador.manuel@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=sebastian_rose@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).