bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: backup-enable-predicate docs & special treatment of /tmp inelegant


From: Kevin Rodgers
Subject: Re: backup-enable-predicate docs & special treatment of /tmp inelegant
Date: Thu, 25 Jan 2001 02:04:26 GMT

jidanni@kimo.FiXcomTHiS.tw (Dan Jacobson) wrote:
> info says:
>    The default value of the `backup-enable-predicate' variable
> prevents
> backup files being written for files in `/tmp'.
>
> help says:
> Predicate that looks at a file name and decides whether to make
> backups.
> Called with an absolute file name as argument, it returns t to enable
> backup.
>
> but both don't say to the basic user how to stop making /tmp a special
> case.  Indeed, it is not as simple as (setq backup-enable-predicate t)
> or whatever, so one wouldn't need to spend too much time in the lisp
> manual to figure it out, if more advice were given up front. [What Dan
> is trying to say here, but is embarrased to admit it, is he can't
> figure it out [but didn't try too hard]].

A predicate is a kind of a function.  The Emacs Lisp manual also says:

 - Variable: backup-enable-predicate
     This variable's value is a function to be called on certain
     occasions to decide whether a file should have backup files.  The
     function receives one argument, a file name to consider.  If the
     function returns `nil', backups are disabled for that file.
     Otherwise, the other variables in this section say whether and how
     to make backups.

     The default value is this:

          (lambda (name)
            (or (< (length name) 5)
                (not (string-equal "/tmp/"
                                   (substring name 0 5)))))

Does that help?  How about:

(setq backup-enable-predicate (lambda (file) t))

--
Kevin Rodgers <kevinr@ihs.com>          Lead Software Engineer
Information Handling Services           Electronic Systems Development
15 Inverness Way East, M/S A114         GO BUFFS!
Englewood CO 80112-5776 USA             1 303 397 2807[voice]


Sent via Deja.com
http://www.deja.com/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]