* Protecting comment lines from fill-paragraph
@ 2009-04-24 16:19 Matthew Lundin
2009-04-24 19:01 ` Samuel Wales
2009-05-08 7:26 ` Carsten Dominik
0 siblings, 2 replies; 7+ messages in thread
From: Matthew Lundin @ 2009-04-24 16:19 UTC (permalink / raw)
To: Org Mode Mailing List
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Protecting comment lines from fill-paragraph
2009-04-24 16:19 Protecting comment lines from fill-paragraph Matthew Lundin
@ 2009-04-24 19:01 ` Samuel Wales
2009-04-24 19:45 ` Matthew Lundin
2009-04-24 19:58 ` Matthew Lundin
2009-05-08 7:26 ` Carsten Dominik
1 sibling, 2 replies; 7+ messages in thread
From: Samuel Wales @ 2009-04-24 19:01 UTC (permalink / raw)
To: Matthew Lundin; +Cc: Org Mode Mailing List
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Protecting comment lines from fill-paragraph
2009-04-24 19:01 ` Samuel Wales
@ 2009-04-24 19:45 ` Matthew Lundin
2009-04-24 19:58 ` Matthew Lundin
1 sibling, 0 replies; 7+ messages in thread
From: Matthew Lundin @ 2009-04-24 19:45 UTC (permalink / raw)
To: Samuel Wales; +Cc: Org Mode Mailing List
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Protecting comment lines from fill-paragraph
2009-04-24 19:01 ` Samuel Wales
2009-04-24 19:45 ` Matthew Lundin
@ 2009-04-24 19:58 ` Matthew Lundin
2009-04-28 2:34 ` Samuel Wales
1 sibling, 1 reply; 7+ messages in thread
From: Matthew Lundin @ 2009-04-24 19:58 UTC (permalink / raw)
To: Samuel Wales; +Cc: Org Mode Mailing List
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Protecting comment lines from fill-paragraph
2009-04-24 19:58 ` Matthew Lundin
@ 2009-04-28 2:34 ` Samuel Wales
0 siblings, 0 replies; 7+ messages in thread
From: Samuel Wales @ 2009-04-28 2:34 UTC (permalink / raw)
To: Matthew Lundin; +Cc: Org Mode Mailing List
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Protecting comment lines from fill-paragraph
2009-04-24 16:19 Protecting comment lines from fill-paragraph Matthew Lundin
2009-04-24 19:01 ` Samuel Wales
@ 2009-05-08 7:26 ` Carsten Dominik
2009-05-08 8:52 ` Samuel Wales
1 sibling, 1 reply; 7+ messages in thread
From: Carsten Dominik @ 2009-05-08 7:26 UTC (permalink / raw)
To: Matthew Lundin; +Cc: Org Mode Mailing List
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Protecting comment lines from fill-paragraph
2009-05-08 7:26 ` Carsten Dominik
@ 2009-05-08 8:52 ` Samuel Wales
0 siblings, 0 replies; 7+ messages in thread
From: Samuel Wales @ 2009-05-08 8:52 UTC (permalink / raw)
To: Carsten Dominik; +Cc: Org Mode Mailing List
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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-05-08 8:53 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-24 16:19 Protecting comment lines from fill-paragraph Matthew Lundin
2009-04-24 19:01 ` Samuel Wales
2009-04-24 19:45 ` Matthew Lundin
2009-04-24 19:58 ` Matthew Lundin
2009-04-28 2:34 ` Samuel Wales
2009-05-08 7:26 ` Carsten Dominik
2009-05-08 8:52 ` Samuel Wales
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).