diff --git a/doc/auctex.texi b/doc/auctex.texi
index f50b4bd..adaa8eb 100644
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -410,11 +410,6 @@ Show matching dollar sign if this dollar sign end the @TeX{} math mode.
 Ensure double dollar signs match up correctly by inserting extra dollar
 signs when needed if @code{TeX-math-close-double-dollar} is non-nil.
 
-If @var{TeX-math-close-single-dollar} is non-nil, when outside math mode
-the function insert the opening and closing dollar signs for @TeX{}
-inline formula and put the point between them just by typing a single
-@samp{$}.
-
 With optional @var{arg}, insert that many dollar signs.
 @end deffn
 
@@ -427,20 +422,43 @@ double dollar sign @samp{$$} @AUCTeX{} will automatically insert two
 dollar signs.
 @end defopt
 
-@defopt TeX-math-close-single-dollar
-Control the insertion of dollar signs for delimiting inline math.  If
-the variable is non-nil and you enter a dollar sign outside math mode
-@AUCTeX{} will automatically insert the opening and closing dollar signs
-and put the point between them.  If the variable
-@code{blink-matching-paren} is non-nil the opening dollar will blink.
+@TeX{} and @LaTeX{} users often look for a way to insert inline
+equations like @samp{$...$} or @samp{\(...\)} simply typing @kbd{$}.
+@AUCTeX{} helps them through the variable @code{TeX-electric-math}.
+
+@defopt TeX-electric-math
+If the variable is non-nil and you type @kbd{$} outside math mode,
+@AUCTeX{} will automatically insert the opening and closing symbols for
+an inline equation and put the point between them.  The opening symbol
+will blink when @code{blink-matching-paren} is non-nil.  If
+@code{TeX-electric-math} is nil, typing @kbd{$} simply inserts @samp{$}
+at point, this is the default.
+
+In addition, when the variable is non-nil and there is an active region
+outside math mode, typing @kbd{$} will put around the active region
+symbols for opening and closing inline equation and keep the region
+active, leaving point after the closing symbol.  By pressing repeatedly
+@kbd{$} while the region is active you can toggle between an inline
+equation, a display equation, and no equation.  To be precise,
+@samp{$...$} is replaced by @samp{$$...$$}, @samp{\(...\)} by
+@samp{\[...\]}.
+
+Besides @code{nil}, possible values for this variable are @code{(cons
+"$" "$")} for @TeX{} inline equations @samp{$...$}, and @code{(cons
+"\\(" "\\)")} for @LaTeX{} inline equations @samp{\(...\)}.
 @end defopt
 
-@defopt TeX-electric-dollar
-Control the insertion of dollar signs when there is an active region
-outside math mode.  If the variable is non-nil, typing @samp{$} will put
-a pair of single dollar around the active region and leave point after
-the closing dollar.
-@end defopt
+If you want to automatically insert @samp{$...$} in plain @TeX{} files,
+and @samp{\(...\)} in @LaTeX{} files, add the following to your init
+file
+@lisp
+(add-hook 'plain-TeX-mode-hook
+	  (lambda () (set (make-variable-buffer-local 'TeX-electric-math)
+			  (cons "$" "$"))))
+(add-hook 'LaTeX-mode-hook
+	  (lambda () (set (make-variable-buffer-local 'TeX-electric-math)
+			  (cons "\\(" "\\)"))))
+@end lisp
 
 @subheading Braces
 
diff --git a/tex.el b/tex.el
index af57c9b..c993768 100644
--- a/tex.el
+++ b/tex.el
@@ -5158,19 +5158,28 @@ See also `TeX-font-replace' and `TeX-font-replace-function'."
   :group 'TeX-macro
   :type 'boolean)
 
-(defcustom TeX-math-close-single-dollar nil
-  "If non-nil, when outside math mode insert opening and closing dollar
-signs for TeX inline equation and put the point between them, just by
-typing a single `$'."
+(defcustom TeX-electric-math nil
+  "If non-nil, when outside math mode `TeX-insert-dollar' will
+insert symbols for opening and closing inline equation and put
+the point between them.  If there is an active region,
+`TeX-insert-dollar' will put around it symbols for opening and
+closing inline equation and keep the region active, with point
+after closing symbol.  If you press `$' again, you can toggle
+between inline equation, display equation, and no equation.
+
+If nil, `TeX-insert-dollar' will simply insert \"$\" at point,
+this is the default.
+
+If non-nil, this variable is a cons cell whose CAR is the string
+to insert before point, the CDR is the string to insert after
+point.  You can choose between \"$...$\" and \"\\(...\\)\"."
   :group 'TeX-macro
-  :type 'boolean)
-
-(defcustom TeX-electric-dollar nil
-  "When outside math mode, if non-nil and there is an active
-region, typing `$' will put a pair of single dollar around it and
-leave point after the closing dollar."
-  :group 'TeX-macro
-  :type 'boolean)
+  :type '(choice (const :tag "$" nil)
+		 (const :tag "$...$" '("$" . "$"))
+		 (const :tag "\\(...\\)" '("\\(" . "\\)"))
+		 (cons :tag "Other"
+		       (string :tag "Insert before point")
+		       (string :tag "Insert after point"))))
 
 (defun TeX-insert-dollar (&optional arg)
   "Insert dollar sign.
@@ -5181,6 +5190,9 @@ the TeX math mode and `blink-matching-paren' is non-nil.  Ensure
 double dollar signs match up correctly by inserting extra dollar
 signs when needed.
 
+When outside math mode, the behavior is controlled by the variable
+`TeX-electric-math'.
+
 With raw \\[universal-argument] prefix, insert exactly one dollar
 sign.  With optional ARG, insert that many dollar signs."
   (interactive "P")
@@ -5221,23 +5233,48 @@ sign.  With optional ARG, insert that many dollar signs."
       (insert "$")))
    (t
     ;; Just somewhere in the text.
-    (if (and TeX-electric-dollar (TeX-active-mark))
-	(progn
-	  (if (> (point) (mark))
-	      (exchange-point-and-mark))
-	  (insert "$")
-	  (exchange-point-and-mark)
-	  (insert "$"))
-      (if TeX-math-close-single-dollar
+    (cond
+     ((and TeX-electric-math (TeX-active-mark))
+      (if (> (point) (mark))
+	  (exchange-point-and-mark))
+      (cond
+       ;; $...$ to $$...$$
+       ((and (eq last-command 'TeX-insert-dollar)
+	     (re-search-forward "\\=\\$\\([^$][^z-a]*[^$]\\)\\$" (mark) t))
+	(replace-match "$$\\1$$")
+	(push-mark (match-beginning 0) t))
+       ;; \(...\) to \[...\]
+       ((and (eq last-command 'TeX-insert-dollar)
+	     (re-search-forward "\\=\\\\(\\([^z-a]*\\)\\\\)" (mark) t))
+	(replace-match "\\\\[\\1\\\\]")
+	(push-mark (match-beginning 0) t))
+       ;; Strip \[...\] or $$...$$
+       ((and (eq last-command 'TeX-insert-dollar)
+	     (or (re-search-forward "\\=\\\\\\[\\([^z-a]*\\)\\\\\\]" (mark) t)
+		 (re-search-forward "\\=\\$\\$\\([^z-a]*\\)\\$\\$" (mark) t)))
+	(replace-match "\\1")
+	(push-mark (match-beginning 0) t))
+       (t
+	;; We use `save-excursion' because point must be situated before opening
+	;; symbol.
+	(save-excursion (insert (car TeX-electric-math)))
+	(exchange-point-and-mark)
+	(insert (cdr TeX-electric-math))))
+      ;; Keep the region active.
+      (if (featurep 'xemacs)
+	  (zmacs-activate-region)
+	(setq activate-mark t
+	      deactivate-mark nil)))
+     (TeX-electric-math
+      (insert (car TeX-electric-math))
+      (save-excursion (insert (cdr TeX-electric-math)))
+      (if blink-matching-paren
 	  (progn
-	    (insert "$$")
-	    (if blink-matching-paren
-		(progn
-		  (backward-char 2)
-		  (sit-for blink-matching-delay)
-		  (forward-char))
-	      (backward-char)))
-	(insert "$")))))
+	    (backward-char)
+	    (sit-for blink-matching-delay)
+	    (forward-char))))
+     ;; In any other case just insert a single $.
+     ((insert "$")))))
   (TeX-math-input-method-off))
 
 (defvar TeX-math-input-method-off-regexp
