Function: f-ext-p
f-ext-p is a byte-compiled function defined in f.el.
Signature
(f-ext-p PATH &optional EXT)
Documentation
Return t if extension of PATH is EXT, false otherwise.
If EXT is nil or omitted, return t if PATH has any extension, false otherwise.
The extension, in a file name, is the part that follows the last
'.', excluding version numbers and backup suffixes.
Other relevant functions are documented in the f group.
Shortdoc
;; f
(f-ext-p "path/to/file.el" "el")
=> t
(f-ext-p "path/to/file.el" "txt")
=> nil
(f-ext-p "path/to/file.el")
=> t
(f-ext-p "path/to/file")
=> nil
Aliases
Source Code
;; Defined in ~/.emacs.d/elpa/f-20241003.1131/f.el
(defun f-ext-p (path &optional ext)
"Return t if extension of PATH is EXT, false otherwise.
If EXT is nil or omitted, return t if PATH has any extension,
false otherwise.
The extension, in a file name, is the part that follows the last
'.', excluding version numbers and backup suffixes."
(if ext
(string= (f-ext path) ext)
(not (eq (f-ext path) nil))))