Function: make-backup-file-name--default-function

make-backup-file-name--default-function is a byte-compiled function defined in files.el.gz.

Signature

(make-backup-file-name--default-function FILE)

Documentation

Default function for make-backup-file-name.

Normally this just returns FILE's name with ~ appended. It searches for a match for FILE in backup-directory-alist. If the directory for the backup doesn't exist, it is created.

Source Code

;; Defined in /usr/src/emacs/lisp/files.el.gz
(defun make-backup-file-name--default-function (file)
  "Default function for `make-backup-file-name'.
Normally this just returns FILE's name with `~' appended.
It searches for a match for FILE in `backup-directory-alist'.
If the directory for the backup doesn't exist, it is created."
  (if (and (eq system-type 'ms-dos)
           (not (msdos-long-file-names)))
      (let ((fn (file-name-nondirectory file)))
        (concat (file-name-directory file)
                (or (and (string-match "\\`[^.]+\\'" fn)
                         (concat (match-string 0 fn) ".~"))
                    (and (string-match "\\`[^.]+\\.\\(..?\\)?" fn)
                         (concat (match-string 0 fn) "~")))))
    (concat (make-backup-file-name-1 file) "~")))