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'.
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")))