Lisp_Object
encode_current_directory (void)
{
- Lisp_Object dir;
-
- dir = BVAR (current_buffer, directory);
-
- dir = Funhandled_file_name_directory (dir);
+ Lisp_Object curdir = BVAR (current_buffer, directory);
+ Lisp_Object dir = Funhandled_file_name_directory (curdir);
/* If the file name handler says that dir is unreachable, use
a sensible default. */
dir = build_string ("~");
dir = expand_and_dir_to_file (dir);
-
- if (NILP (Ffile_accessible_directory_p (dir)))
- report_file_error ("Setting current directory",
- BVAR (current_buffer, directory));
-
- /* Remove "/:" from DIR and encode it. */
dir = ENCODE_FILE (remove_slash_colon (dir));
if (! file_accessible_directory_p (dir))
- report_file_error ("Setting current directory",
- BVAR (current_buffer, directory));
+ report_file_error ("Setting current directory", curdir);
return dir;
}