diff --git a/doc/auctex.texi b/doc/auctex.texi
index fbf37fb..6577609 100644
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -435,6 +435,15 @@ and put the point between them.  If the variable
 @code{blink-matching-paren} is non-nil the opening dollar will blink.
 @end defopt
 
+@defopt TeX-electric-dollar
+Control the insertion of dollar signs when there is an active region
+outside math mode.  If the value of this variable is @code{'single},
+typing @samp{$} will put a pair of single dollar around the active
+region and leave point after the closing dollar.  If the value is
+@code{'double}, typing @samp{$} will wrap a pair of double dollar around
+the active region.  In any other case, insert a dollar at point.
+@end defopt
+
 @subheading Braces
 
 To avoid unbalanced braces, it is useful to insert them pairwise.  You
diff --git a/tex.el b/tex.el
index 329ad12..1a76627 100644
--- a/tex.el
+++ b/tex.el
@@ -5169,6 +5169,17 @@ typing a single `$'."
   :group 'TeX-macro
   :type 'boolean)
 
+(defcustom TeX-electric-dollar nil
+  "When outside math mode, if its value is 'single and there is
+an active region, typing `$' will put a pair of single dollar
+around it and leave point after the closing dollar.  If its value
+is 'double, typing `$' will wrap a pair of double dollar around
+the active region.  In any other case, insert a dollar at point."
+  :group 'TeX-macro
+  :type '(choice (const :tag "Single dollar" 'single)
+		 (const :tag "Double dollar" 'double)
+		 (const :tag nil)))
+
 (defun TeX-insert-dollar (&optional arg)
   "Insert dollar sign.
 
@@ -5217,16 +5228,29 @@ sign.  With optional ARG, insert that many dollar signs."
       (insert "$")))
    (t
     ;; Just somewhere in the text.
-    (if TeX-math-close-single-dollar
-	(progn
-	  (insert "$$")
-	  (if blink-matching-paren
-	      (progn
-		(backward-char 2)
-		(sit-for blink-matching-delay)
-		(forward-char))
-	    (backward-char)))
-      (insert "$"))))
+    (if (and
+	 (or (eq TeX-electric-dollar 'single)
+	     (eq TeX-electric-dollar 'double))
+	 (TeX-active-mark))
+	(let ((symbol
+	       (cond
+		((eq TeX-electric-dollar 'single) "$")
+		((eq TeX-electric-dollar 'double) "$$"))))
+	  (if (> (point) (mark))
+	      (exchange-point-and-mark))
+	  (insert symbol)
+	  (exchange-point-and-mark)
+	  (insert symbol))
+      (if TeX-math-close-single-dollar
+	  (progn
+	    (insert "$$")
+	    (if blink-matching-paren
+		(progn
+		  (backward-char 2)
+		  (sit-for blink-matching-delay)
+		  (forward-char))
+	      (backward-char)))
+	(insert "$")))))
   (TeX-math-input-method-off))
 
 (defvar TeX-math-input-method-off-regexp
@@ -5701,7 +5725,6 @@ NAME may be a package, a command, or a document."
 
 ;; delsel.el, `delete-selection-mode'
 (put 'TeX-newline 'delete-selection t)
-(put 'TeX-insert-dollar 'delete-selection t)
 (put 'TeX-insert-quote 'delete-selection t)
 (put 'TeX-insert-backslash 'delete-selection t)
 
