]> git.eshelyaron.com Git - emacs.git/commitdiff
(set-fill-prefix): Cancel fill prefix if point
authorGerd Moellmann <gerd@gnu.org>
Wed, 31 Jan 2001 16:12:41 +0000 (16:12 +0000)
committerGerd Moellmann <gerd@gnu.org>
Wed, 31 Jan 2001 16:12:41 +0000 (16:12 +0000)
is in front of the left-margin, if any.

lisp/ChangeLog
lisp/textmodes/fill.el

index ad9fa785ad4cf5ef1862ab7074f9c0b27f7d1635..8c8408b8fc870b3e1b0c4aa890f2456bf52db2b6 100644 (file)
@@ -1,5 +1,8 @@
 2001-01-31  Gerd Moellmann  <gerd@gnu.org>
 
+       * 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'.
 
index d9bf1e520d957ed15cad2b2353bba9702e008b78..1ddf46e236180e306c0db338ff9d8357de7f5c22 100644 (file)
@@ -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")))