From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: John J Foerch Newsgroups: gmane.emacs.help Subject: forward-paragraph, paragraph-start trouble Date: Sat, 05 Apr 2008 19:20:37 -0400 Message-ID: <873apznb22.fsf@earthlink.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1207437721 12047 80.91.229.12 (5 Apr 2008 23:22:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 5 Apr 2008 23:22:01 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Apr 06 01:22:32 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JiHiM-0000Mv-7U for geh-help-gnu-emacs@m.gmane.org; Sun, 06 Apr 2008 01:22:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JiHhj-0004ai-6H for geh-help-gnu-emacs@m.gmane.org; Sat, 05 Apr 2008 19:21:47 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JiHhI-0004W8-NE for help-gnu-emacs@gnu.org; Sat, 05 Apr 2008 19:21:20 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JiHhE-0004V8-4y for help-gnu-emacs@gnu.org; Sat, 05 Apr 2008 19:21:20 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JiHhD-0004V5-W1 for help-gnu-emacs@gnu.org; Sat, 05 Apr 2008 19:21:16 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JiHhD-0007JK-QX for help-gnu-emacs@gnu.org; Sat, 05 Apr 2008 19:21:16 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JiHh6-0002kf-Bh for help-gnu-emacs@gnu.org; Sat, 05 Apr 2008 23:21:08 +0000 Original-Received: from dialup-4.158.60.84.dial1.chicago1.level3.net ([4.158.60.84]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 05 Apr 2008 23:21:08 +0000 Original-Received: from jjfoerch by dialup-4.158.60.84.dial1.chicago1.level3.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 05 Apr 2008 23:21:08 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 42 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: dialup-4.158.60.84.dial1.chicago1.level3.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:ODvFgsUXsF+xxghzynp50L6n+3c= X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:53094 Archived-At: Hello, I am writing a major mode for a particular flavor of plain text file. I am having trouble coercing `forward-paragraph' to recognize the paragraph style. Here is some example text: ==begin example== This is the first paragraph. It is totally awesome. This is the second paragraph. forward-paragraph won't normally treat this one as a separate paragraph. But the real difficulty is when there is a paragraph like this. To find out whether a given line is a start-paragraph, you have to be able to look at the previous line to compare the amount of indentation. Crazy though it may seem, this sentence begins a new paragraph. This sentence, though formatted a bit strangely, should also be treated as a single paragraph. ==end example== `forward-paragraph' uses two regular expressions, `paragraph-start' and `paragraph-separate' to find paragraphs. I simply need to be able to say that a line with more identation than the previous line is a paragraph-start. However, since emacs regular expressions lack look-behind assertions, I am under the impression that what I want to do is impossible. Any advice? Thank you, John Foerch