]> code.delx.au - gnu-emacs/blobdiff - lisp/indent.el
Merge from emacs-23
[gnu-emacs] / lisp / indent.el
index 8adb5a9bd6a69f7dcc77a698b483477b4b928e3b..6d0100489d12f684d80b711c3673523d8111fb38 100644 (file)
@@ -4,6 +4,7 @@
 ;;   2008, 2009, 2010, 2011  Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
+;; Package: emacs
 
 ;; This file is part of GNU Emacs.
 
@@ -67,6 +68,7 @@ The buffer-local variable `indent-line-function' determines how to do this,
 but the functions `indent-relative' and `indent-relative-maybe' are
 special; we don't actually use them here."
   (interactive)
+  (syntax-propertize (line-end-position))
   (if (memq indent-line-function
            '(indent-relative indent-relative-maybe))
       ;; These functions are used for tabbing, but can't be used for
@@ -417,7 +419,7 @@ column to indent to; if it is nil, use one of the three methods above."
            (goto-char start)
            (while (< (point) end)
              (or (and (bolp) (eolp))
-                 (funcall indent-line-function))
+                 (indent-according-to-mode))
              (forward-line 1))
            (move-marker end nil))))
     (setq column (prefix-numeric-value column))
@@ -431,7 +433,11 @@ column to indent to; if it is nil, use one of the three methods above."
        (or (eolp)
            (indent-to column 0))
        (forward-line 1))
-      (move-marker end nil))))
+      (move-marker end nil)))
+  ;; In most cases, reindenting modifies the buffer, but it may also
+  ;; leave it unmodified, in which case we have to deactivate the mark
+  ;; by hand.
+  (deactivate-mark))
 
 (defun indent-relative-maybe ()
   "Indent a new line like previous nonblank line.