GNU bug report logs - #25685
fill-paragraph vs. \n vs. Chinese / English boundaries

Previous Next

Package: emacs;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Sat, 11 Feb 2017 00:23:01 UTC

Severity: minor

Tags: notabug

Merged with 25099

Done: Katsumi Yamaoka <yamaoka <at> jpl.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Katsumi Yamaoka <yamaoka <at> jpl.org>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 25685 <at> debbugs.gnu.org
Subject: bug#25685: fill-paragraph vs. \n vs. Chinese / English boundaries
Date: Mon, 13 Feb 2017 09:22:46 +0900
[Message part 1 (text/plain, inline)]
On Sat, 11 Feb 2017 08:22:19 +0800, 積丹尼 Dan Jacobson wrote:
> We proceeded to dig up 些 some Canna edulis Ker 食用美人蕉
> when surprise surprise...

> and do  M-h  then  M-q
> It becomes

> We proceeded to dig up 些 some Canna edulis Ker 食用美人蕉when
> surprise surprise...

> I.e., the "食用美人蕉when" are now stuck together, making our text
> look very unprofessional.

Fixing such things one by one manually is my routine, too.  But
I first tried:

* lisp/textmodes/fill.el (fill-delete-newlines):
Don't delete leading and trailing space from CJK word.

I'm not sure if it is the right solution for every case, though.

[Message part 2 (text/x-patch, inline)]
--- fill.el~	2017-01-04 22:17:04.000000000 +0000
+++ fill.el	2017-02-12 23:57:42.946118200 +0000
@@ -494,8 +494,8 @@
 	    (replace-match (get-text-property (match-beginning 0) 'fill-space))
 	  (let ((prev (char-before (match-beginning 0)))
 		(next (following-char)))
-	    (if (and (or (aref (char-category-set next) ?|)
-			 (aref (char-category-set prev) ?|))
+	    (if (and (aref (char-category-set next) ?|)
+		     (aref (char-category-set prev) ?|)
 		     (or (aref fill-nospace-between-words-table next)
 			 (aref fill-nospace-between-words-table prev)))
 		(delete-char -1))))))

This bug report was last modified 8 years and 97 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.