comparison lisp/textmodes/fill.el @ 20234:a21b3ed1915e

(fill-region-as-paragraph): Fix bug of handling the case that English letters are followed by such characters as Japanese and Chinese.
author Kenichi Handa <handa@m17n.org>
date Sat, 08 Nov 1997 03:08:40 +0000
parents 0ccbd9bdcd8f
children 7808c4885103
comparison
equal deleted inserted replaced
20233:f1655c49bf01 20234:a21b3ed1915e
447 (and (not (bobp)) 447 (and (not (bobp))
448 sentence-end-double-space 448 sentence-end-double-space
449 (save-excursion (forward-char -1) 449 (save-excursion (forward-char -1)
450 (and (looking-at "\\. ") 450 (and (looking-at "\\. ")
451 (not (looking-at "\\. "))))))) 451 (not (looking-at "\\. ")))))))
452 ;; Find a breakable point while ignoring the
453 ;; following spaces.
452 (skip-chars-forward " \t") 454 (skip-chars-forward " \t")
453 ;; Skip one \c| character or one word. 455 (if (looking-at "\\c|")
454 (if (looking-at "$\\|\\c|\\|[^ \t\n]+") 456 (forward-char 1)
455 (goto-char (match-end 0))) 457 (let ((pos (save-excursion
458 (skip-chars-forward "^ \n\t")
459 (point))))
460 (if (re-search-forward "\\c|" pos t)
461 (forward-char -1)
462 (goto-char pos))))
456 (setq first nil))) 463 (setq first nil)))
457 ;; Normally, move back over the single space between the words. 464 ;; Normally, move back over the single space between the words.
458 (if (= (preceding-char) ?\ ) (forward-char -1)) 465 (if (= (preceding-char) ?\ ) (forward-char -1))
459 ;; Do KINSOKU processing. 466 ;; Do KINSOKU processing.
460 (if (and enable-multibyte-characters enable-kinsoku 467 (if (and enable-multibyte-characters enable-kinsoku
485 (and (not (bobp)) 492 (and (not (bobp))
486 sentence-end-double-space 493 sentence-end-double-space
487 (save-excursion (forward-char -1) 494 (save-excursion (forward-char -1)
488 (and (looking-at "\\. ") 495 (and (looking-at "\\. ")
489 (not (looking-at "\\. "))))))) 496 (not (looking-at "\\. ")))))))
497 ;; Find a breakable point while ignoring the
498 ;; following spaces.
490 (skip-chars-forward " \t") 499 (skip-chars-forward " \t")
491 ;; Skip one \c| character or one word. 500 (if (looking-at "\\c|")
492 (if (looking-at "$\\|\\c|\\|[^ \t\n]+") 501 (forward-char 1)
493 (goto-char (match-end 0))) 502 (let ((pos (save-excursion
503 (skip-chars-forward "^ \n\t")
504 (point))))
505 (if (re-search-forward "\\c|" pos t)
506 (forward-char -1)
507 (goto-char pos))))
494 (setq first nil)))) 508 (setq first nil))))
495 ;; Check again to see if we got to the end of the paragraph. 509 ;; Check again to see if we got to the end of the paragraph.
496 (if (save-excursion (skip-chars-forward " \t") (eobp)) 510 (if (save-excursion (skip-chars-forward " \t") (eobp))
497 (or nosqueeze (delete-horizontal-space)) 511 (or nosqueeze (delete-horizontal-space))
498 ;; Replace whitespace here with one newline, then indent to left 512 ;; Replace whitespace here with one newline, then indent to left