coldnew / pangu-spacing

emacs minor-mode to add space between Chinese/Japanese/Korean and English characters.
144 stars 16 forks source link

How to let auto-fill mode count virtual spaces? #27

Open zzjjzzgggg opened 5 years ago

zzjjzzgggg commented 5 years ago

Suppose fill-column is 80. The following sentence has with 80, and is displayed in one line. a字a字a字a字a字a字a字a字a字a字a字a字a字a字a字a字a字a字a字a字a字a字a字a字a字a字a字a

When virtual spaces are added by pangu-spacing, the above sentence becomes a 字 a 字 a 字 a 字 a 字 a 字 a 字 a 字 a 字 a 字 a 字 a 字 a 字 a 字 a 字 a 字 a 字 a 字 a 字 a 字 a 字 a 字 a 字 a 字 a 字 a 字 a 字 a

However, auto-fill still thinks its width is 80, and hence doesn't fill it.

Is it possible to fill it properly?

coldnew commented 5 years ago

Not sure, maybe we need to add some hook to auto-fill since pangu-spacing only insert the white space on the overlay, not the buffer itself.

The quickly way is to make pangu-spacing insert the space to the buffer, you can turn this option on by following code:

 (setq pangu-spacing-real-insert-separtor t)

But enable this option is not recommended, since it will modify your contents.