539 |
;; Make sure we take SOMETHING after the fill prefix if any. |
;; Make sure we take SOMETHING after the fill prefix if any. |
540 |
(fill-find-break-point linebeg))))) |
(fill-find-break-point linebeg))))) |
541 |
|
|
542 |
|
;; Like text-properties-at but don't include `composition' property. |
543 |
|
(defun fill-text-properties-at (pos) |
544 |
|
(let ((l (text-properties-at pos)) |
545 |
|
prop-list) |
546 |
|
(while l |
547 |
|
(unless (eq (car l) 'composition) |
548 |
|
(setq prop-list |
549 |
|
(cons (car l) (cons (cadr l) prop-list)))) |
550 |
|
(setq l (cddr l))) |
551 |
|
prop-list)) |
552 |
|
|
553 |
(defun fill-newline () |
(defun fill-newline () |
554 |
;; Replace whitespace here with one newline, then |
;; Replace whitespace here with one newline, then |
555 |
;; indent to left margin. |
;; indent to left margin. |
557 |
(insert ?\n) |
(insert ?\n) |
558 |
;; Give newline the properties of the space(s) it replaces |
;; Give newline the properties of the space(s) it replaces |
559 |
(set-text-properties (1- (point)) (point) |
(set-text-properties (1- (point)) (point) |
560 |
(text-properties-at (point))) |
(fill-text-properties-at (point))) |
561 |
(and (looking-at "\\( [ \t]*\\)\\(\\c|\\)?") |
(and (looking-at "\\( [ \t]*\\)\\(\\c|\\)?") |
562 |
(or (aref (char-category-set (or (char-before (1- (point))) ?\000)) ?|) |
(or (aref (char-category-set (or (char-before (1- (point))) ?\000)) ?|) |
563 |
(match-end 2)) |
(match-end 2)) |