aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Kastrup2005-11-25 11:06:30 +0000
committerDavid Kastrup2005-11-25 11:06:30 +0000
commite5ad37ee8d4044d0feeecd97aca2b254b835c1d1 (patch)
treeb604529c90b4fb24004905244b669cacc1ff276e
parentd973cf9cdbe9d032383c4da89e582089ab3932e0 (diff)
downloademacs-e5ad37ee8d4044d0feeecd97aca2b254b835c1d1.tar.gz
emacs-e5ad37ee8d4044d0feeecd97aca2b254b835c1d1.zip
(longlines-wrap-line): Reorder wrapping to "insert
new character, then delete" in order to preserve markers.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/longlines.el16
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 @@
12005-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
12005-11-25 David Ponce <david@dponce.com> 62005-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)))