]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/indent.el (indent-according-to-mode): Flush to column 0 in text-mode
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 13 Jan 2014 05:03:31 +0000 (00:03 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 13 Jan 2014 05:03:31 +0000 (00:03 -0500)
after an empty line.

lisp/ChangeLog
lisp/indent.el

index 5f1f38a950ba32a6fc863702f61d88d7d2a8a7ce..241e4ed242bfb64ddbaaee1ad2631c23d0c7f011 100644 (file)
@@ -1,3 +1,8 @@
+2014-01-13  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * indent.el (indent-according-to-mode): Flush to column 0 in text-mode
+       after an empty line.
+
 2014-01-12  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * net/shr.el (shr-render-region): Autoload.
index 4cd669ccf37e5e8d934fd85230ea0c363bb1da4e..2af5a58f6c58499c688b9c7731dba508166d5811 100644 (file)
@@ -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))))