make :any: role work with intersphinx!
diff --git a/doc/conf.py b/doc/conf.py
index 3ae9482..4a6f8f5 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -83,7 +83,7 @@
 
 # We're not using intersphinx right now, but if we did, this would be part of
 # the mapping:
-intersphinx_mapping = {'python': ('http://docs.python.org/dev', None)}
+intersphinx_mapping = {'python': ('http://docs.python.org/2/', None)}
 
 # Sphinx document translation with sphinx gettext feature uses these settings:
 locale_dirs = ['locale/']
diff --git a/doc/markup/inline.rst b/doc/markup/inline.rst
index 7d83e31..b5bb8d0 100644
--- a/doc/markup/inline.rst
+++ b/doc/markup/inline.rst
@@ -86,6 +86,10 @@
    Python module (usually ``:py:mod:`signal``` or ``:mod:`signal```) and a
    section (usually ``:ref:`about-signals```).
 
+   The :rst:role:`any` role also works together with the
+   :mod:`~sphinx.ext.intersphinx` extension: when no local cross-reference is
+   found, all object types of intersphinx inventories are also searched.
+
 
 Cross-referencing objects
 -------------------------
diff --git a/sphinx/ext/intersphinx.py b/sphinx/ext/intersphinx.py
index 43507a3..b429ab9 100644
--- a/sphinx/ext/intersphinx.py
+++ b/sphinx/ext/intersphinx.py
@@ -222,15 +222,21 @@
 
 def missing_reference(app, env, node, contnode):
     """Attempt to resolve a missing reference via intersphinx references."""
-    domain = node.get('refdomain')
-    if not domain:
-        # only objects in domains are in the inventory
-        return
     target = node['reftarget']
-    objtypes = env.domains[domain].objtypes_for_role(node['reftype'])
-    if not objtypes:
-        return
-    objtypes = ['%s:%s' % (domain, objtype) for objtype in objtypes]
+    if node['reftype'] == 'any':
+        # we search anything!
+        objtypes = ['%s:%s' % (domain.name, objtype)
+                    for domain in env.domains.values()
+                    for objtype in domain.object_types]
+    else:
+        domain = node.get('refdomain')
+        if not domain:
+            # only objects in domains are in the inventory
+            return
+        objtypes = env.domains[domain].objtypes_for_role(node['reftype'])
+        if not objtypes:
+            return
+        objtypes = ['%s:%s' % (domain, objtype) for objtype in objtypes]
     to_try = [(env.intersphinx_inventory, target)]
     in_set = None
     if ':' in target:
@@ -248,7 +254,7 @@
                 # get correct path in case of subdirectories
                 uri = path.join(relative_path(node['refdoc'], env.srcdir), uri)
             newnode = nodes.reference('', '', internal=False, refuri=uri,
-                          reftitle=_('(in %s v%s)') % (proj, version))
+                                      reftitle=_('(in %s v%s)') % (proj, version))
             if node.get('refexplicit'):
                 # use whatever title was given
                 newnode.append(contnode)