comparison lisp/textmodes/fill.el @ 90133:4da4a09e8b1b

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-31 Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 206-222) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 45-52) - Update from CVS - Update from CVS: texi Makefile.in CVS keyw cruft - Update from CVS: ChangeLog tweaks
author Miles Bader <miles@gnu.org>
date Thu, 31 Mar 2005 09:58:14 +0000
parents 8395880305fe 801f886872c5
children f042e7c0fe20
comparison
equal deleted inserted replaced
90132:4080fe8b4f0f 90133:4da4a09e8b1b
537 (if (not (and (eq (charset-after (1- (point))) 'ascii) 537 (if (not (and (eq (charset-after (1- (point))) 'ascii)
538 (eq (charset-after (point)) 'ascii))) 538 (eq (charset-after (point)) 'ascii)))
539 ;; Make sure we take SOMETHING after the fill prefix if any. 539 ;; Make sure we take SOMETHING after the fill prefix if any.
540 (fill-find-break-point linebeg))))) 540 (fill-find-break-point linebeg)))))
541 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
542 (defun fill-newline () 553 (defun fill-newline ()
543 ;; Replace whitespace here with one newline, then 554 ;; Replace whitespace here with one newline, then
544 ;; indent to left margin. 555 ;; indent to left margin.
545 (skip-chars-backward " \t") 556 (skip-chars-backward " \t")
546 (insert ?\n) 557 (insert ?\n)
547 ;; Give newline the properties of the space(s) it replaces 558 ;; Give newline the properties of the space(s) it replaces
548 (set-text-properties (1- (point)) (point) 559 (set-text-properties (1- (point)) (point)
549 (text-properties-at (point))) 560 (fill-text-properties-at (point)))
550 (and (looking-at "\\( [ \t]*\\)\\(\\c|\\)?") 561 (and (looking-at "\\( [ \t]*\\)\\(\\c|\\)?")
551 (or (aref (char-category-set (or (char-before (1- (point))) ?\000)) ?|) 562 (or (aref (char-category-set (or (char-before (1- (point))) ?\000)) ?|)
552 (match-end 2)) 563 (match-end 2))
553 ;; When refilling later on, this newline would normally not be replaced 564 ;; When refilling later on, this newline would normally not be replaced
554 ;; by a space, so we need to mark it specially to re-install the space 565 ;; by a space, so we need to mark it specially to re-install the space