From 7c315e1cff9019c8af55921fab6f571e68b09623 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Thu, 31 Mar 2005 04:45:27 +0000 Subject: [PATCH] (fill-text-properties-at): New function. (fill-newline): Use fill-text-properties-at instead of text-properties-at. --- lisp/ChangeLog | 6 ++++++ lisp/textmodes/fill.el | 13 ++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f123732ed9e..a0a670300dc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2005-03-31 Kenichi Handa + + * textmodes/fill.el (fill-text-properties-at): New function. + (fill-newline): Use fill-text-properties-at instead of + text-properties-at. + 2005-03-31 Karl Berry * textmodes/tex-mode.el (tex-compile): shell-quote-argument, diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index ccd7f21f502..c41145befc8 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el @@ -539,6 +539,17 @@ The break position will be always after LINEBEG and generally before point." ;; Make sure we take SOMETHING after the fill prefix if any. (fill-find-break-point linebeg))))) +;; Like text-properties-at but don't include `composition' property. +(defun fill-text-properties-at (pos) + (let ((l (text-properties-at pos)) + prop-list) + (while l + (unless (eq (car l) 'composition) + (setq prop-list + (cons (car l) (cons (cadr l) prop-list)))) + (setq l (cddr l))) + prop-list)) + (defun fill-newline () ;; Replace whitespace here with one newline, then ;; indent to left margin. @@ -546,7 +557,7 @@ The break position will be always after LINEBEG and generally before point." (insert ?\n) ;; Give newline the properties of the space(s) it replaces (set-text-properties (1- (point)) (point) - (text-properties-at (point))) + (fill-text-properties-at (point))) (and (looking-at "\\( [ \t]*\\)\\(\\c|\\)?") (or (aref (char-category-set (or (char-before (1- (point))) ?\000)) ?|) (match-end 2)) -- 2.39.2