unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* paragraph definition problems
@ 2003-09-13  6:00 Joerg
  2003-09-14  2:28 ` Jesper Harder
  2003-09-15 15:16 ` Stefan Monnier
  0 siblings, 2 replies; 5+ messages in thread
From: Joerg @ 2003-09-13  6:00 UTC (permalink / raw)


Hello,

I'm having problems with the definition of paragraphs in emacs 21.2.93.1. It
is important for me because I think explicit fill uses that definition when
filling.

In the description of the paragraph-start variable it says that the given
regexp should match lines that start OR separate paragraphs, and that it is
matched against the text at the left margin.

The standard for that option is "[ \t\n\f]" (at least in my version). If I
interpret that correctly it means "every line starting with a space, a tab,
a new line or a line feed" in the context of paragraph-start.

Let's say I've got the following text:

This is a paragraph.
 This should be a new paragraph because of the space at the beginning.

Now, if I press M-h to select the paragraph in the second line, the line
above is also selected, in spite of the space in the beginning of the second
one. Also M-q fills those "paragraphs" together.

Thus, I got the feeling that I can change the paragraph-start and
paragraph-separator variables randomly, and the behaviour doesn't change.

Any help would be appreciated. Thank you!

Regards,
 Jörg

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

* Re: paragraph definition problems
  2003-09-13  6:00 paragraph definition problems Joerg
@ 2003-09-14  2:28 ` Jesper Harder
  2003-09-14  5:11   ` Joerg
  2003-09-15 15:16 ` Stefan Monnier
  1 sibling, 1 reply; 5+ messages in thread
From: Jesper Harder @ 2003-09-14  2:28 UTC (permalink / raw)


Joerg <nospam@nospam.org> writes:

> Let's say I've got the following text:
>
> This is a paragraph.
>  This should be a new paragraph because of the space at the beginning.
>
> Now, if I press M-h to select the paragraph in the second line, the line
> above is also selected, in spite of the space in the beginning of the second
> one. Also M-q fills those "paragraphs" together.

I think `paragraph-indent-text-mode' does what you want:

,----[ C-h f paragraph-indent-text-mode RET ]
| paragraph-indent-text-mode is an interactive compiled Lisp function
| in `textmodes/text-mode'.  (paragraph-indent-text-mode)
| 
| Major mode for editing text, with leading spaces starting a paragraph.
| In this mode, you do not need blank lines between paragraphs
| when the first line of the following paragraph starts with whitespace.
| `paragraph-indent-minor-mode' provides a similar facility as a minor mode.
|
`----

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

* Re: paragraph definition problems
  2003-09-14  2:28 ` Jesper Harder
@ 2003-09-14  5:11   ` Joerg
  2003-09-15  3:39     ` Jesper Harder
  0 siblings, 1 reply; 5+ messages in thread
From: Joerg @ 2003-09-14  5:11 UTC (permalink / raw)


Jesper Harder wrote:

> Joerg <nospam@nospam.org> writes:
> 
>> Let's say I've got the following text:
>>
>> This is a paragraph.
>>  This should be a new paragraph because of the space at the beginning.
>>
>> Now, if I press M-h to select the paragraph in the second line, the line
>> above is also selected, in spite of the space in the beginning of the
>> second one. Also M-q fills those "paragraphs" together.
> 
> I think `paragraph-indent-text-mode' does what you want:
>
> [...]

Exactly! Thank you very much! I still don't understand why altering
paragraph-start and paragraph-separate doesn't work, but who cares? ;-)

One more thing: Do you also know a text-/minor-mode which is the opposite of
paragraph-indent-text-mode, i.e. every line NOT starting with an
indentation is considered as a new paragraph?

This would be useful for text like the following:

Topic1: This should be
        one paragraph.
Topic2: This should be
        one paragraph.

Regards,
 Jörg

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

* Re: paragraph definition problems
  2003-09-14  5:11   ` Joerg
@ 2003-09-15  3:39     ` Jesper Harder
  0 siblings, 0 replies; 5+ messages in thread
From: Jesper Harder @ 2003-09-15  3:39 UTC (permalink / raw)


Joerg <nospam@nospam.org> writes:

> Jesper Harder wrote:
>>
>> I think `paragraph-indent-text-mode' does what you want:
>
> Exactly! Thank you very much! I still don't understand why altering
> paragraph-start and paragraph-separate doesn't work, but who cares?

Well, if you wan't to know, you can just do `C-h v paragraph-start'
and `C-h v paragraph-separate' in paragraph-indent-text-mode and
text-mode respectively and compare the values.

Then you'll know which values give you the desired effect.

> One more thing: Do you also know a text-/minor-mode which is the
> opposite of paragraph-indent-text-mode, i.e. every line NOT starting
> with an indentation is considered as a new paragraph?
>
> This would be useful for text like the following:
>
> Topic1: This should be
>         one paragraph.
> Topic2: This should be
>         one paragraph.

`C-x .' (set-fill-prefix) is useful for this kind of situation.  If
you place point at "one" and press `C-x .', I think you'll get
something close to what you want.

Also read the chapter about filling in the Emacs manual -- there are
lots of options and commands related to this.

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

* Re: paragraph definition problems
  2003-09-13  6:00 paragraph definition problems Joerg
  2003-09-14  2:28 ` Jesper Harder
@ 2003-09-15 15:16 ` Stefan Monnier
  1 sibling, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2003-09-15 15:16 UTC (permalink / raw)


> The standard for that option is "[ \t\n\f]" (at least in my version). If I
> interpret that correctly it means "every line starting with a space, a tab,
> a new line or a line feed" in the context of paragraph-start.

This "default" value is basically only used in fundamental-mode.

> Let's say I've got the following text:

> This is a paragraph.
>  This should be a new paragraph because of the space at the beginning.

> Now, if I press M-h to select the paragraph in the second line, the line
> above is also selected, in spite of the space in the beginning of the second
> one. Also M-q fills those "paragraphs" together.

This is probably in a buffer using some other mode than fundamental-mode.
Do C-h v in the buffer that you care about to see the value it has in
this particular buffer.  The default (i.e. global) value is about as good
as never used (in Emacs-CVS this default value is changed to reflect the
more common setting corresponding to text-mode).


        Stefan

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

end of thread, other threads:[~2003-09-15 15:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-13  6:00 paragraph definition problems Joerg
2003-09-14  2:28 ` Jesper Harder
2003-09-14  5:11   ` Joerg
2003-09-15  3:39     ` Jesper Harder
2003-09-15 15:16 ` Stefan Monnier

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).