diff options
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/files.el | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lisp/files.el b/lisp/files.el index 085682a05a7..bfc4abafa3e 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -1429,6 +1429,19 @@ we do not remove backup version numbers, only true file version numbers." | |||
| 1429 | (string-match "~\\'" name) | 1429 | (string-match "~\\'" name) |
| 1430 | (length name)))))))) | 1430 | (length name)))))))) |
| 1431 | 1431 | ||
| 1432 | (defun file-name-sans-extension (filename) | ||
| 1433 | "Return FILENAME sans final \"extension\". | ||
| 1434 | The extension, in a file name, is the part that follows the last `.'." | ||
| 1435 | (save-match-data | ||
| 1436 | (let ((file (file-name-sans-versions (file-name-nondirectory filename))) | ||
| 1437 | directory) | ||
| 1438 | (if (string-match "\\.[^.]*\\'" file) | ||
| 1439 | (if (setq directory (file-name-directory filename)) | ||
| 1440 | (expand-file-name (substring file 0 (match-beginning 0)) | ||
| 1441 | directory) | ||
| 1442 | (substring file 0 (match-beginning 0))) | ||
| 1443 | filename)))) | ||
| 1444 | |||
| 1432 | (defun make-backup-file-name (file) | 1445 | (defun make-backup-file-name (file) |
| 1433 | "Create the non-numeric backup file name for FILE. | 1446 | "Create the non-numeric backup file name for FILE. |
| 1434 | This is a separate function so you can redefine it for customization." | 1447 | This is a separate function so you can redefine it for customization." |