bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#56844: [PATCH] Refactor repunctuate-sentences to accommodate corner


From: André A . Gomes
Subject: bug#56844: [PATCH] Refactor repunctuate-sentences to accommodate corner case.
Date: Tue, 02 Aug 2022 14:41:32 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)

Lars Ingebrigtsen <larsi@gnus.org> writes:

>> +        (regexp "\\([]\"')]?\\)\\([.?!]\\)\\([]\"')]?\\) 
>> +\\([\"')[:upper:]]\\)")
>
> I'm not quite sure I understand this patch.  Are you changing this to
> only consider punctuation that's followed by an upper-case character to
> be sentence-end punctuation?

Yes.  The patch section relative to testing is illustrative:

--8<---------------cut here---------------start------------->8---
 (ert-deftest paragraphs-tests-repunctuate-sentences ()
   (with-temp-buffer
-    (insert "Just. Some. Sentences.")
+    (insert "Just. Some. Sentences. Yet another, e.g. this one.")
     (goto-char (point-min))
     (repunctuate-sentences t)
-    (should (equal (buffer-string) "Just.  Some.  Sentences."))))
+    (should (equal (buffer-string)
+                   "Just.  Some.  Sentences.  Yet another, e.g. this one."))))
--8<---------------cut here---------------end--------------->8---

Thanks.
 

-- 
André A. Gomes
"You cannot even find the ruins..."





reply via email to

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