GNU bug report logs -
#25685
fill-paragraph vs. \n vs. Chinese / English boundaries
Previous Next
Full log
View this message in rfc822 format
[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.