Hi Andreas, `nil` seemed more appropriate than returning either an empty string or throwing an error. The intent is to signal a failure in general, as it looks like other related functions in that file do. On Tue, 25 May 2021, at 10:48, Andreas Schwab wrote: > On Mai 25 2021, Colin Woodbury wrote: > > > diff --git a/lisp/files.el b/lisp/files.el > > index 62e1702fdf..f8aefa7930 100644 > > --- a/lisp/files.el > > +++ b/lisp/files.el > > @@ -4889,6 +4889,20 @@ extension, the value is \"\"." > > (if period > > ""))))) > > > > +(defun file-name-set-extension (filename extension) > > + "Change the extension of a FILENAME to EXTENSION. > > +Sanitizes the input to consolidate leading/trailing dots. > > + > > +Returns `nil' if either of the FILENAME or EXTENSION are `nil' > > +before sanitizing, or empty afterwards." > > + (when (and filename extension) > > What is the use-case for nil? > > Andreas. > > -- > Andreas Schwab, schwab@linux-m68k.org > GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 > "And now for something completely different." >