From 2441692dc8589566a410a841c8b45e34cae21b82 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Wed, 31 Jan 2001 16:12:41 +0000 Subject: [PATCH] (set-fill-prefix): Cancel fill prefix if point is in front of the left-margin, if any. --- lisp/ChangeLog | 3 +++ lisp/textmodes/fill.el | 12 +++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ad9fa785ad4..8c8408b8fc8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2001-01-31 Gerd Moellmann + * textmodes/fill.el (set-fill-prefix): Cancel fill prefix if point + is in front of the left-margin, if any. + * simple.el (delete-key-deletes-forward-mode): Treat `kp-delete' like `delete'. diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index d9bf1e520d9..1ddf46e2361 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el @@ -74,11 +74,13 @@ See the documentation of `kinsoku' for more information.") Filling expects lines to start with the fill prefix and reinserts the fill prefix in each resulting line." (interactive) - (setq fill-prefix (buffer-substring - (save-excursion (move-to-left-margin) (point)) - (point))) - (if (equal fill-prefix "") - (setq fill-prefix nil)) + (let ((left-margin-pos (save-excursion (move-to-left-margin) (point)))) + (if (> (point) left-margin-pos) + (progn + (setq fill-prefix (buffer-substring left-margin-pos (point))) + (if (equal fill-prefix "") + (setq fill-prefix nil))) + (setq fill-prefix nil))) (if fill-prefix (message "fill-prefix: \"%s\"" fill-prefix) (message "fill-prefix cancelled"))) -- 2.39.2