aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorRichard M. Stallman2002-12-02 16:19:52 +0000
committerRichard M. Stallman2002-12-02 16:19:52 +0000
commitf601aaf8f8a8d8a1a6899e526a5b4814c4e70335 (patch)
tree169e71c9b57f4589b8dee2b72898c19f26338be4 /lisp/textmodes
parent15c064363c828cbf12172ad19905f1c29bd2cfb7 (diff)
downloademacs-f601aaf8f8a8d8a1a6899e526a5b4814c4e70335.tar.gz
emacs-f601aaf8f8a8d8a1a6899e526a5b4814c4e70335.zip
(fill-indent-to-left-margin): New function.
(fill-newline, fill-region-as-paragraph): Use that.
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/fill.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
index 727e8e1d137..f5712cc0bb1 100644
--- a/lisp/textmodes/fill.el
+++ b/lisp/textmodes/fill.el
@@ -540,13 +540,19 @@ The break position will be always after LINEBEG and generally before point."
540 '(invisible t))) 540 '(invisible t)))
541 (if (or fill-prefix 541 (if (or fill-prefix
542 (not fill-indent-according-to-mode)) 542 (not fill-indent-according-to-mode))
543 (indent-to-left-margin) 543 (fill-indent-to-left-margin)
544 (indent-according-to-mode)) 544 (indent-according-to-mode))
545 ;; Insert the fill prefix after indentation. 545 ;; Insert the fill prefix after indentation.
546 ;; Set prefixcol so whitespace in the prefix won't get lost. 546 ;; Set prefixcol so whitespace in the prefix won't get lost.
547 (and fill-prefix (not (equal fill-prefix "")) 547 (and fill-prefix (not (equal fill-prefix ""))
548 (insert-and-inherit fill-prefix))) 548 (insert-and-inherit fill-prefix)))
549 549
550(defun fill-indent-to-left-margin ()
551 "Indent current line to the column given by `current-left-margin'."
552 (let ((beg (point)))
553 (indent-line-to (current-left-margin))
554 (put-text-property beg (point) 'face 'default)))
555
550(defun fill-region-as-paragraph (from to &optional justify 556(defun fill-region-as-paragraph (from to &optional justify
551 nosqueeze squeeze-after) 557 nosqueeze squeeze-after)
552 "Fill the region as one paragraph. 558 "Fill the region as one paragraph.
@@ -631,7 +637,7 @@ space does not end a sentence, so don't break a line there."
631 (while (< (point) to) 637 (while (< (point) to)
632 (if (and (not (eolp)) 638 (if (and (not (eolp))
633 (< (current-indentation) (current-left-margin))) 639 (< (current-indentation) (current-left-margin)))
634 (indent-to-left-margin)) 640 (fill-indent-to-left-margin))
635 (forward-line 1))) 641 (forward-line 1)))
636 642
637 (if use-hard-newlines 643 (if use-hard-newlines
@@ -639,7 +645,7 @@ space does not end a sentence, so don't break a line there."
639 ;; Make sure first line is indented (at least) to left margin... 645 ;; Make sure first line is indented (at least) to left margin...
640 (if (or (memq justify '(right center)) 646 (if (or (memq justify '(right center))
641 (< (current-indentation) (current-left-margin))) 647 (< (current-indentation) (current-left-margin)))
642 (indent-to-left-margin)) 648 (fill-indent-to-left-margin))
643 ;; Delete the fill-prefix from every line. 649 ;; Delete the fill-prefix from every line.
644 (fill-delete-prefix from to fill-prefix) 650 (fill-delete-prefix from to fill-prefix)
645 (setq from (point)) 651 (setq from (point))