[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Redifine make-backup-file-name has no effect
From: |
Gerd Moellmann |
Subject: |
Re: Redifine make-backup-file-name has no effect |
Date: |
29 Oct 2001 15:20:12 +0100 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.1.50 |
"Jan D." <Jan.Djarv@mbox200.swipnet.se> writes:
> In article <3BD964D4.C26E06E9@lu.erisoft.se>,
> Jan Djärv <Jan.Djarv@epl.ericsson.se> wrote:
>
> (about cutomizing make-backup-file-name-function does not call that
> function, or at least still uses file~ as backup file name)
>
> The error is in files.el, function find-backup-file-name. It uses
> the result from make-backup-file-name-1 directly, thus bypassing
> the cutomization hook.
>
> Here's a patch:
>
> Index: lisp/files.el
> --- lisp/files.el.orig Sun Oct 28 15:13:39 2001
> +++ lisp/files.el Sun Oct 28 15:11:38 2001
> @@ -2422,7 +2422,7 @@
> -1))
> (file-error (setq possibilities nil)))
> (if (not deserve-versions-p)
> - (list (concat basic-name "~"))
> + (list (make-backup-file-name fn))
> (cons (format "%s.~%d~" basic-name (1+ high-water-mark))
> (if (and (> number-to-delete 0)
> ;; Delete nothing if there is overflow
>
>
Thanks, Jan. Alas, I'm not sure what the right fix is here because
I'm not sure from the docs if a make-backup-file-name-function is
supposed to return a file name including versions or not. There are
indirect hints that it might have to return file names with versions,
like the code of file-newest-backup using file-name-sans-versions,
but not enough to be sure.
If it's supposed to do that, I think the fix would be
*** files.el 2001/10/29 14:13:31 1.532
--- files.el 2001/10/29 14:13:50
***************
*** 2411,2416 ****
--- 2411,2417 ----
(if handler
(funcall handler 'find-backup-file-name fn)
(if (or (eq version-control 'never)
+ (not (null make-backup-file-name-function))
;; We don't support numbered backups on plain MS-DOS
;; when long file names are unavailable.
(and (eq system-type 'ms-dos)
Richard, could you please comment?