diff options
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/longlines.el | 16 |
2 files changed, 15 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d2049ed3254..a295c279de0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2005-11-25 David Kastrup <dak@gnu.org> | ||
| 2 | |||
| 3 | * longlines.el (longlines-wrap-line): Reorder wrapping to "insert | ||
| 4 | new character, then delete" in order to preserve markers. | ||
| 5 | |||
| 1 | 2005-11-25 David Ponce <david@dponce.com> | 6 | 2005-11-25 David Ponce <david@dponce.com> |
| 2 | 7 | ||
| 3 | * recentf.el (recentf-arrange-by-rule): Handle a special | 8 | * recentf.el (recentf-arrange-by-rule): Handle a special |
diff --git a/lisp/longlines.el b/lisp/longlines.el index 93f3daa4ee8..37dadcd43d1 100644 --- a/lisp/longlines.el +++ b/lisp/longlines.el | |||
| @@ -246,17 +246,21 @@ not need to be wrapped, move point to the next line and return t." | |||
| 246 | nil) | 246 | nil) |
| 247 | (if (longlines-merge-lines-p) | 247 | (if (longlines-merge-lines-p) |
| 248 | (progn (end-of-line) | 248 | (progn (end-of-line) |
| 249 | (delete-char 1) | ||
| 250 | ;; After certain commands (e.g. kill-line), there may be two | 249 | ;; After certain commands (e.g. kill-line), there may be two |
| 251 | ;; successive soft newlines in the buffer. In this case, we | 250 | ;; successive soft newlines in the buffer. In this case, we |
| 252 | ;; replace these two newlines by a single space. Unfortunately, | 251 | ;; replace these two newlines by a single space. Unfortunately, |
| 253 | ;; this breaks the conservation of (spaces + newlines), so we | 252 | ;; this breaks the conservation of (spaces + newlines), so we |
| 254 | ;; have to fiddle with longlines-wrap-point. | 253 | ;; have to fiddle with longlines-wrap-point. |
| 255 | (if (or (bolp) (eolp)) | 254 | (if (or (prog1 (bolp) (forward-char 1)) (eolp)) |
| 256 | (if (> longlines-wrap-point (point)) | 255 | (progn |
| 257 | (setq longlines-wrap-point | 256 | (delete-char -1) |
| 258 | (1- longlines-wrap-point))) | 257 | (if (> longlines-wrap-point (point)) |
| 259 | (insert-char ? 1)) | 258 | (setq longlines-wrap-point |
| 259 | (1- longlines-wrap-point)))) | ||
| 260 | (insert-before-markers-and-inherit ?\ ) | ||
| 261 | (backward-char 1) | ||
| 262 | (delete-char -1) | ||
| 263 | (forward-char 1)) | ||
| 260 | nil) | 264 | nil) |
| 261 | (forward-line 1) | 265 | (forward-line 1) |
| 262 | t))) | 266 | t))) |