]> git.eshelyaron.com Git - emacs.git/commitdiff
(longlines-wrap-line): Reorder wrapping to "insert
authorDavid Kastrup <dak@gnu.org>
Fri, 25 Nov 2005 11:06:30 +0000 (11:06 +0000)
committerDavid Kastrup <dak@gnu.org>
Fri, 25 Nov 2005 11:06:30 +0000 (11:06 +0000)
new character, then delete" in order to preserve markers.

lisp/ChangeLog
lisp/longlines.el

index d2049ed3254371195853bd51cda08668f72712f7..a295c279de0df445e6f76087ef1a5154e4500987 100644 (file)
@@ -1,3 +1,8 @@
+2005-11-25  David Kastrup  <dak@gnu.org>
+
+       * longlines.el (longlines-wrap-line): Reorder wrapping to "insert
+       new character, then delete" in order to preserve markers.
+
 2005-11-25  David Ponce  <david@dponce.com>
 
        * recentf.el (recentf-arrange-by-rule): Handle a special
index 93f3daa4ee89e7353934bf27eda905a9e07c6ab6..37dadcd43d10238abe617fcb9d2c6151929c5234 100644 (file)
@@ -246,17 +246,21 @@ not need to be wrapped, move point to the next line and return t."
              nil)
     (if (longlines-merge-lines-p)
         (progn (end-of-line)
-               (delete-char 1)
      ;; After certain commands (e.g. kill-line), there may be two
      ;; successive soft newlines in the buffer.  In this case, we
      ;; replace these two newlines by a single space.  Unfortunately,
      ;; this breaks the conservation of (spaces + newlines), so we
      ;; have to fiddle with longlines-wrap-point.
-               (if (or (bolp) (eolp))
-                   (if (> longlines-wrap-point (point))
-                       (setq longlines-wrap-point
-                             (1- longlines-wrap-point)))
-                 (insert-char ?  1))
+              (if (or (prog1 (bolp) (forward-char 1)) (eolp))
+                  (progn
+                    (delete-char -1)
+                    (if (> longlines-wrap-point (point))
+                        (setq longlines-wrap-point
+                              (1- longlines-wrap-point))))
+                (insert-before-markers-and-inherit ?\ )
+                (backward-char 1)
+                (delete-char -1)
+                (forward-char 1))
                nil)
       (forward-line 1)
       t)))