# HG changeset patch # User David Kastrup # Date 1132916790 0 # Node ID d3b833785ae6de158a0612172ec7491421333321 # Parent c4aae786a4e46e8f6acf10986ed175e69fb66ca6 (longlines-wrap-line): Reorder wrapping to "insert new character, then delete" in order to preserve markers. diff -r c4aae786a4e4 -r d3b833785ae6 lisp/ChangeLog --- a/lisp/ChangeLog Fri Nov 25 07:57:21 2005 +0000 +++ b/lisp/ChangeLog Fri Nov 25 11:06:30 2005 +0000 @@ -1,3 +1,8 @@ +2005-11-25 David Kastrup + + * longlines.el (longlines-wrap-line): Reorder wrapping to "insert + new character, then delete" in order to preserve markers. + 2005-11-25 David Ponce * recentf.el (recentf-arrange-by-rule): Handle a special diff -r c4aae786a4e4 -r d3b833785ae6 lisp/longlines.el --- a/lisp/longlines.el Fri Nov 25 07:57:21 2005 +0000 +++ b/lisp/longlines.el Fri Nov 25 11:06:30 2005 +0000 @@ -246,17 +246,21 @@ 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)))