Eli Zaretskii writes: >> Cc: sbaugh@janestreet.com, 62732@debbugs.gnu.org, sbaugh@catern.com >> Date: Wed, 12 Jul 2023 16:42:01 +0300 >> From: Eli Zaretskii >> >> > I can see 3 ways to provide this info: >> > >> > 1- use `file-directory-p`. >> > 2- add a boolean `directory` argument to `create-file-buffer`. >> > 3- use the presence of a trailing directory separator in the filename. >> > >> > Those 3 are very close to each other, in practice, so we're pretty much >> > in bikeshed territory. >> > >> > My preference is (3) first, (2) second, and (1) last. >> >> I prefer (1), because it avoids requesting the callers to remember to >> ensure that every directory ends in a slash. > > So how about compromising on a variant of (2): we add an optional > DIRECTORY-P argument, and if FILENAME doesn't end in a slash, but > DIRECTORY-P is non-nil, create-file-buffer will append a slash? Okay, so like this? BTW, would you be okay with moving uniquify-trailing-separator-p into dired, as I described in my other recent email? Then create-file-buffer wouldn't need to check it, which would simplify its docstring slightly; instead dired would just decide whether to pass a directory name or file name based on uniquify-trailing-separator-p. Since I'm changing this area anyway, now would be the time to make that change, as a nice cleanup which Stefan also likes.