emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] lisp/files.el: Add `file-name-set-extension`


From: Andreas Schwab
Subject: Re: [PATCH] lisp/files.el: Add `file-name-set-extension`
Date: Tue, 25 May 2021 19:48:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

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."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]