Merge changes made in Gnus trunk.
[bpt/emacs.git] / lisp / electric.el
index f777ac1..7682c56 100644 (file)
@@ -1,7 +1,6 @@
 ;;; electric.el --- window maker and Command loop for `electric' modes
 
-;; Copyright (C) 1985, 1986, 1995, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1985-1986, 1995, 2001-2011 Free Software Foundation, Inc.
 
 ;; Author: K. Shane Hartman
 ;; Maintainer: FSF
@@ -221,7 +220,8 @@ Returns nil when we can't find this char."
         (let ((before (copy-marker (1- pos) t)))
           (save-excursion
             (unless (memq indent-line-function
-                          '(indent-relative indent-relative-maybe))
+                          '(indent-relative indent-to-left-margin
+                            indent-relative-maybe))
               ;; Don't reindent the previous line if the indentation function
               ;; is not a real one.
               (goto-char before)
@@ -235,7 +235,8 @@ Returns nil when we can't find this char."
             ;; Remove the trailing whitespace after indentation because
             ;; indentation may (re)introduce the whitespace.
             (delete-horizontal-space t))))
-      (indent-according-to-mode))))
+      (unless (memq indent-line-function '(indent-to-left-margin))
+        (indent-according-to-mode)))))
 
 ;;;###autoload
 (define-minor-mode electric-indent-mode