Commit 58fc9587 authored by Richard M. Stallman's avatar Richard M. Stallman

(Fexpand_file_name): Copy default-directory

before looking for a handler on the directory arg.
parent 0ce62eb2
......@@ -745,6 +745,12 @@ See also the function `substitute-in-file-name'.")
handler = Ffind_file_name_handler (name, Qexpand_file_name);
if (!NILP (handler))
return call3 (handler, Qexpand_file_name, name, defalt);
/* Use the buffer's default-directory if DEFALT is omitted. */
if (NILP (defalt))
defalt = current_buffer->directory;
CHECK_STRING (defalt, 1);
if (!NILP (defalt))
{
handler = Ffind_file_name_handler (defalt, Qexpand_file_name);
......@@ -752,11 +758,6 @@ See also the function `substitute-in-file-name'.")
return call3 (handler, Qexpand_file_name, name, defalt);
}
/* Use the buffer's default-directory if DEFALT is omitted. */
if (NILP (defalt))
defalt = current_buffer->directory;
CHECK_STRING (defalt, 1);
o = XSTRING (defalt)->data;
/* Make sure DEFALT is properly expanded.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment