Hi Carsten, Thanks to the addition your wonderful org-footnote, I increasingly use org-mode for all my writing. And just as I do in LaTeX, I like to use comment lines to insert notes in my text. I have a couple of questions, however, about the behavior of comment lines in relation to fill-paragraph. I find that if I add a comment such as the following... --8<---------------cut here---------------start------------->8--- Here is some text. # Here is a comment Here is some text. --8<---------------cut here---------------end--------------->8--- When I invoke fill-paragraph on lines two or three, line three is folded into the comment line, as follows: --8<---------------cut here---------------start------------->8--- Here is some text. # Here is a comment Here is some text. --8<---------------cut here---------------end--------------->8--- But when I invoke fill paragraph on line one, the text stays as it is. In other words, the comment symbol blocks filling into the preceding line, but not the line that follows it. The same behavior affects other comment blocks. E.g., --8<---------------cut here---------------start------------->8--- #+begin_quote Here is a quote. #+end_quote --8<---------------cut here---------------end--------------->8--- becomes... --8<---------------cut here---------------start------------->8--- #+begin_quote Here is a quote. #+end_quote --8<---------------cut here---------------end--------------->8--- In short, would it be possible to prevent lines that follow comment lines from being folded into comment lines when fill-paragraph is invoked. The reason I ask is because I like to place comments in paragraphs while retaining the integrity of the paragraph for export. Thanks in advance for considering this. Matt
Did you try putting this in your org mode hook? (if (featurep 'filladapt) (filladapt-mode 1)) -- Myalgic encephalomyelitis denialism is causing death and severe suffering worse than MS. Greed is corrupting science into foul nonsense. Anybody can get the disease at any time permanently. Do science and justice matter to you? http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm
Samuel,
Samuel Wales <samologist@gmail.com> writes:
> Did you try putting this in your org mode hook?
>
> (if (featurep 'filladapt) (filladapt-mode 1))
Thanks. That was just what I was looking for.
- Matt
Samuel Wales <samologist@gmail.com> writes:
> Did you try putting this in your org mode hook?
>
> (if (featurep 'filladapt) (filladapt-mode 1))
Actually, on second thought, this causes problems for all the other
auto-fill-inhibit-regexp settings that are part of org-mode: e.g.,
headings, tables, etc. are filled if I turn on filladapt-mode.
- Matt
Try this. It modifies only a few lines from the original. (require 'filladapt) (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) )) This, which makes the regexps more strict, has worked for me for a long time, so I think it's fairly safe to include in filladapt or on worg. HTH -- Myalgic encephalomyelitis denialism is causing death and severe suffering worse than MS. Conflicts of interest are destroying science. Anybody can get the disease at any time permanently. Do science and justice matter to you? http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm
I don't know how to fix this, unfortunately.
- Carsten
On Apr 24, 2009, at 6:19 PM, Matthew Lundin wrote:
> Hi Carsten,
>
> Thanks to the addition your wonderful org-footnote, I increasingly use
> org-mode for all my writing. And just as I do in LaTeX, I like to use
> comment lines to insert notes in my text. I have a couple of
> questions,
> however, about the behavior of comment lines in relation to
> fill-paragraph.
>
> I find that if I add a comment such as the following...
>
> --8<---------------cut here---------------start------------->8---
> Here is some text.
> # Here is a comment
> Here is some text.
> --8<---------------cut here---------------end--------------->8---
>
> When I invoke fill-paragraph on lines two or three, line three is
> folded
> into the comment line, as follows:
>
> --8<---------------cut here---------------start------------->8---
> Here is some text.
> # Here is a comment Here is some text.
> --8<---------------cut here---------------end--------------->8---
>
> But when I invoke fill paragraph on line one, the text stays as it is.
> In other words, the comment symbol blocks filling into the preceding
> line, but not the line that follows it.
>
> The same behavior affects other comment blocks. E.g.,
>
> --8<---------------cut here---------------start------------->8---
> #+begin_quote
> Here is a quote.
> #+end_quote
> --8<---------------cut here---------------end--------------->8---
>
> becomes...
>
> --8<---------------cut here---------------start------------->8---
> #+begin_quote Here is a quote.
> #+end_quote
> --8<---------------cut here---------------end--------------->8---
>
> In short, would it be possible to prevent lines that follow comment
> lines from being folded into comment lines when fill-paragraph is
> invoked. The reason I ask is because I like to place comments in
> paragraphs while retaining the integrity of the paragraph for export.
>
> Thanks in advance for considering this.
> Matt
>
>
>
>
>
> _______________________________________________
> 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
I believe that filladapt plus my modification to filladapt-token-table works. -- Myalgic encephalomyelitis denialism is causing death and severe suffering worse than MS. Conflicts of interest are destroying science. Anybody can get the disease at any time permanently. Do science and justice matter to you? http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm