def METHOD_NAME(exe, args, var=None):
    """Try to execute an editor with execv, and warn if it fails.
    Returns: (bool) False if the editor failed, ideally does not
        return if ``execv`` succeeds, and ``True`` if the
        ``exec`` does return successfully.
    """
    # gvim runs in the background by default so we force it to run
    # in the foreground to ensure it gets attention.
    if "gvim" in exe and "-f" not in args:
        exe, *rest = args
        args = [exe, "-f"] + rest
    try:
        return exec_fn(exe, args) == 0
    except (OSError, spack.util.executable.ProcessError) as e:
        if spack.config.get("config:debug"):
            raise
        # Show variable we were trying to use, if it's from one
        if var:
            exe = "$%s (%s)" % (var, exe)
        tty.warn("Could not execute %s due to error:" % exe, str(e))
        return False