From: Boris Goldowsky Date: Thu, 23 Feb 1995 18:38:42 +0000 (+0000) Subject: (open-line): indent when inserting fil-prefix. X-Git-Tag: emacs-19.34~5045 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3db1e3b5d69fac6b0ac6da61237eb277049a7729;p=emacs.git (open-line): indent when inserting fil-prefix. (do-auto-fill): Use unjustify-current-line when necessary. (indent-new-comment-line): Indent before fill-prefix. --- diff --git a/lisp/simple.el b/lisp/simple.el index 194c9740cac..1a4a245af19 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -27,13 +27,15 @@ (defun open-line (arg) "Insert a newline and leave point before it. -If there is a fill prefix, insert the fill prefix on the new line +If there is a fill prefix and/or a left-margin, insert them on the new line if the line would have been empty. With arg N, insert N newlines." (interactive "*p") (let* ((do-fill-prefix (and fill-prefix (bolp))) + (do-left-margin (and (bolp) (> (current-left-margin) 0))) (loc (point))) (while (> arg 0) + (if do-left-margin (indent-to (current-left-margin))) (if do-fill-prefix (insert-and-inherit fill-prefix)) (newline 1) (setq arg (1- arg))) @@ -2185,13 +2187,8 @@ Setting this variable automatically makes it local to the current buffer.") (and auto-fill-inhibit-regexp (looking-at auto-fill-inhibit-regexp)))) nil ;; Auto-filling not required - ;; Remove justification-introduced whitespace before filling - (cond ((eq 'left justify) nil) - ((eq 'full justify) ; full justify: remove extra spaces - (canonically-space-region - (point) (save-excursion (end-of-line) (point)))) - ;; right or center justify: remove extra indentation. - (t (save-excursion (indent-according-to-mode)))) + (if (memq justify '(full center right)) + (save-excursion (unjustify-current-line))) (while (and (not give-up) (> (current-column) fc)) ;; Determine where to split the line. (let ((fill-point @@ -2359,9 +2356,10 @@ unless optional argument SOFT is non-nil." ;; Make sure we delete the newline inserted above. (end-of-line) (delete-char 1))) - (if fill-prefix - (insert-and-inherit fill-prefix) - (indent-according-to-mode))))) + (if (null fill-prefix) + (indent-according-to-mode) + (indent-to-left-margin) + (insert-and-inherit fill-prefix))))) (defun set-selective-display (arg) "Set `selective-display' to ARG; clear it if no arg.