From: Stefan Monnier Date: Mon, 13 Jan 2014 05:03:31 +0000 (-0500) Subject: * lisp/indent.el (indent-according-to-mode): Flush to column 0 in text-mode X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~403 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6ae948d87e16588cd1c2a08d41331923e9786109;p=emacs.git * lisp/indent.el (indent-according-to-mode): Flush to column 0 in text-mode after an empty line. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5f1f38a950b..241e4ed242b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-01-13 Stefan Monnier + + * indent.el (indent-according-to-mode): Flush to column 0 in text-mode + after an empty line. + 2014-01-12 Stefan Monnier * net/shr.el (shr-render-region): Autoload. diff --git a/lisp/indent.el b/lisp/indent.el index 4cd669ccf37..2af5a58f6c5 100644 --- a/lisp/indent.el +++ b/lisp/indent.el @@ -76,9 +76,10 @@ that case, indent by aligning to the previous non-blank line." ;; indenting. Replace with something ad-hoc. (let ((column (save-excursion (beginning-of-line) - (skip-chars-backward "\n \t") - (beginning-of-line) - (current-indentation)))) + (if (bobp) 0 + (beginning-of-line 0) + (if (looking-at "[ \t]*$") 0 + (current-indentation)))))) (if (<= (current-column) (current-indentation)) (indent-line-to column) (save-excursion (indent-line-to column))))