diff --git a/lib/codemirror.js b/lib/codemirror.js
index <HASH>..<HASH> 100644
--- a/lib/codemirror.js
+++ b/lib/codemirror.js
@@ -349,12 +349,11 @@ var CodeMirror = (function() {
     }
   };
 
-  function CodeMirror(place, options) {
-    if (!options) options = {};
-    var defaults = CodeMirror.defaults;
+  function CodeMirror(place, givenOptions) {
+    var options = {}, defaults = CodeMirror.defaults;
     for (var opt in defaults)
-      if (defaults.hasOwnProperty(opt) && !options.hasOwnProperty(opt))
-        options[opt] = defaults[opt];
+      if (defaults.hasOwnProperty(opt))
+        options[opt] = (givenOptions && givenOptions.hasOwnProperty(opt) ? givenOptions : defaults)[opt];
 
     var div = document.createElement("div");
     div.className = "CodeMirror";
do not mutate the given options object. copy to prevent confusion