Index: src/library/base/R/match.fun.R
===================================================================
--- src/library/base/R/match.fun.R	(revision 38204)
+++ src/library/base/R/match.fun.R	(working copy)
@@ -5,7 +5,7 @@
 {
     if ( is.function(FUN) )
         return(FUN)
-    if (!(is.character(FUN) && length(FUN) == 1 || is.symbol(FUN))) {
+    if (!( (CL1 <- is.character(FUN) && length(FUN) == 1) || is.symbol(FUN))) {
         ## Substitute in parent
         FUN <- eval.parent(substitute(substitute(FUN)))
         if (!is.symbol(FUN))
@@ -13,12 +13,43 @@
                           deparse(FUN)), domain = NA)
     }
     envir <- parent.frame(2)
-    if( descend )
+    if( CL1 ) {
+      if( descend ){
+        TMPFUN <- try(get(FUN, mode = "function", env=envir), silent=TRUE)
+        if( inherits(TMPFUN, "try-error") ){
+          warning(TMPFUN)
+          FUN <- eval.parent(substitute(substitute(FUN)))
+          if (!is.symbol(FUN)){
+            stop(gettextf("'%s' is not a function, character or symbol",
+                          deparse(FUN)), domain = NA)
+          }
+          TMPFUN <- get(as.character(FUN), mode = "function", env=envir)
+        }
+        FUN <- TMPFUN
+      }
+      else {
+        TMPFUN <- try(get(FUN, mode = "any", env=envir), silent=TRUE)
+        if( inherits(TMPFUN, "try-error") ){
+          warning(TMPFUN)
+          FUN <- eval.parent(substitute(substitute(FUN)))
+          if (!is.symbol(FUN)){
+            stop(gettextf("'%s' is not a function, character or symbol",
+                          deparse(FUN)), domain = NA)
+          }
+          TMPFUN <- get(as.character(FUN), mode = "any", env=envir)
+        }
+        FUN <- TMPFUN
+        if( !is.function(FUN) )
+          stop(gettextf("found non-function '%s'", FUN), domain = NA)
+      }
+    } else {
+      if( descend )
         FUN <- get(as.character(FUN), mode = "function", env=envir)
-    else {
+      else {
         FUN <- get(as.character(FUN), mode = "any", env=envir)
         if( !is.function(FUN) )
-           stop(gettextf("found non-function '%s'", FUN), domain = NA)
+          stop(gettextf("found non-function '%s'", FUN), domain = NA)
+      }
     }
     return(FUN)
 }
Index: src/library/base/man/match.fun.Rd
===================================================================
--- src/library/base/man/match.fun.Rd	(revision 38204)
+++ src/library/base/man/match.fun.Rd	(working copy)
@@ -26,9 +26,10 @@
   example, enclosed in backquotes) or a
   character vector of length one, it will be looked up using \code{get}
   in the environment of the parent of the caller.  If it is of any other
-  mode, it is attempted first to get the argument to the caller as a
-  symbol (using \code{substitute} twice), and if that fails, an error is
-  declared.
+  mode, or if it is a character vector of length one and the look up
+  using \code{get} failed, it is attempted first to get the argument to
+  the caller as a symbol (using \code{substitute} twice), and if that
+  fails, an error is declared. 
 
   If \code{descend = TRUE}, \code{match.fun} will look past non-function
   objects with the given name; otherwise if \code{FUN} points to a
