Index: longlines.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/longlines.el,v retrieving revision 1.20 diff -u -r1.20 longlines.el --- longlines.el 20 Nov 2005 05:17:27 -0000 1.20 +++ longlines.el 23 Nov 2005 16:08:37 -0000 @@ -245,19 +245,24 @@ (forward-char 1) 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)) - nil) + (let ((bolp (progn (end-of-line) (bolp)))) + (forward-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)) + (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)))