emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: filling bug in text-mode


From: Juri Linkov
Subject: Re: filling bug in text-mode
Date: Mon, 10 Oct 2005 09:14:48 +0300
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

>     Should the sentence commands stop also after three question marks???
>     And sentences can also end with three exclamation marks!!!
>
> Yes, they can--and the sentence commands already do stop there.
> I just tried this test case:
>
>   foo???  bar!!!  lose.

That means there is nothing wrong with the current default value of
`sentence-end' (at least, in regard to the reported bug).

The patch below fixes the bug.  It assumes that more than one
successive periods should allow breaking even if they are followed
by just one space.

Index: lisp/textmodes/fill.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/textmodes/fill.el,v
retrieving revision 1.181
diff -c -r1.181 fill.el
*** lisp/textmodes/fill.el      9 Aug 2005 14:01:29 -0000       1.181
--- lisp/textmodes/fill.el      10 Oct 2005 06:11:59 -0000
***************
*** 349,355 ****
       ;; Another approach to the same problem.
       (save-excursion
         (skip-chars-backward ". ")
!        (and (looking-at "\\.")
            (not (looking-at (sentence-end)))))
       ;; Don't split a line if the rest would look like a new paragraph.
       (unless use-hard-newlines
--- 349,355 ----
       ;; Another approach to the same problem.
       (save-excursion
         (skip-chars-backward ". ")
!        (and (looking-at "\\.[^.]")
            (not (looking-at (sentence-end)))))
       ;; Don't split a line if the rest would look like a new paragraph.
       (unless use-hard-newlines

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]