[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: copy-tree symbol definition
From: |
Kai Grossjohann |
Subject: |
Re: copy-tree symbol definition |
Date: |
Tue, 08 Jun 2004 07:30:27 +0200 |
User-agent: |
Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux) |
Michael Albinus <address@hidden> writes:
> Maybe somebody has a proposal? It must be a real copy, not sharing the
> objects of the list.
What you are doing currently is to copy the structure, then to modify
the copy. But what you could do is to cons up a new structure with
the modifications as necessary:
(let ((backup-directory-alist
(mapcar (lambda (x) ..make.a.new.element..) backup-directory-alist)))
..do.your.stuff..)
But I guess you did it the other way because you don't know whether
you should modify one variable or the other. Hm. But there must be
a way! Hm.
Ah: You could write a function trampify-backup-info which, given an
alist, returns a new alist with different directory names. Then you
just invoke that function twice:
(let ((backup-directory-alist
(when (boundp 'backup-directory-alist)
(trampify-backup-info ...)))
(bkup-backup-directory-info
(when (boundp 'bkup-backup-directory-info)
(trampify-backup-info ...))))
...)
I wonder if this works.
Kai