]> git.eshelyaron.com Git - emacs.git/commitdiff
* longlines.el (longlines-wrap-line, longlines-encode-region): Preserve text properties.
authorChong Yidong <cyd@gnu.org>
Fri, 30 Nov 2012 06:56:51 +0000 (14:56 +0800)
committerChong Yidong <cyd@gnu.org>
Fri, 30 Nov 2012 06:56:51 +0000 (14:56 +0800)
Fixes: debbugs:1425
lisp/ChangeLog
lisp/longlines.el

index 6c96213a71ff026ea3cd2d237f410b995729a2db..e0b140bc2761d13b5e0973e00ad4eb81db192e9c 100644 (file)
@@ -1,3 +1,8 @@
+2012-11-30  Chong Yidong  <cyd@gnu.org>
+
+       * longlines.el (longlines-wrap-line, longlines-encode-region):
+       Preserve text properties (Bug#1425).
+
 2012-11-30  OKAZAKI Tetsurou  <okazaki.tetsurou@gmail.com>  (tiny change)
 
        * vc/vc.el (vc-register): Allow registering a file which is
index 68722a8f92041b0b63390fb8dc7051734f0d54b7..d249eaa6583d6d4d254cf003ec0fe09f5a3a6bab 100644 (file)
@@ -278,7 +278,7 @@ end of the buffer."
 If wrapping is performed, point remains on the line.  If the line does
 not need to be wrapped, move point to the next line and return t."
   (if (longlines-set-breakpoint)
-      (progn (insert-before-markers ?\n)
+      (progn (insert-before-markers-and-inherit ?\n)
             (backward-char 1)
              (delete-char -1)
             (forward-char 1)
@@ -384,8 +384,12 @@ compatibility with `format-alist', and is ignored."
          (mod (buffer-modified-p)))
       (goto-char (min beg end))
       (while (search-forward "\n" reg-max t)
-        (unless (get-text-property (match-beginning 0) 'hard)
-          (replace-match " ")))
+       (let ((pos (match-beginning 0)))
+         (unless (get-text-property pos 'hard)
+           (goto-char (1+ pos))
+           (insert-and-inherit " ")
+           (delete-region pos (1+ pos))
+           (remove-text-properties pos (1+ pos) 'hard))))
       (set-buffer-modified-p mod)
       end)))