Commit 20b5d24c authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(file-name-sans-extension): New function.

parent 64a49ca7
......@@ -1429,6 +1429,19 @@ we do not remove backup version numbers, only true file version numbers."
(string-match "~\\'" name)
(length name))))))))
(defun file-name-sans-extension (filename)
"Return FILENAME sans final \"extension\".
The extension, in a file name, is the part that follows the last `.'."
(let ((file (file-name-sans-versions (file-name-nondirectory filename)))
(if (string-match "\\.[^.]*\\'" file)
(if (setq directory (file-name-directory filename))
(expand-file-name (substring file 0 (match-beginning 0))
(substring file 0 (match-beginning 0)))
(defun make-backup-file-name (file)
"Create the non-numeric backup file name for FILE.
This is a separate function so you can redefine it for customization."
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment