changeset 35785:e8b7be229b24

(set-fill-prefix): Cancel fill prefix if point is in front of the left-margin, if any.
author Gerd Moellmann <gerd@gnu.org>
date Wed, 31 Jan 2001 16:12:07 +0000
parents 3fda213b2ac5
children 3b32efc97931
files lisp/textmodes/fill.el
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/fill.el	Wed Jan 31 15:20:17 2001 +0000
+++ b/lisp/textmodes/fill.el	Wed Jan 31 16:12:07 2001 +0000
@@ -74,11 +74,13 @@
 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")))