emacs-devel
[Top][All Lists]
Advanced

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

Re: Customizing the VC backend order


From: David Kastrup
Subject: Re: Customizing the VC backend order
Date: Sat, 11 Aug 2007 14:05:52 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

Please keep the list copied as long as there is nothing involved
concerning only myself.

dhruva <address@hidden> writes:

> On 8/11/07, David Kastrup <address@hidden> wrote:
>> dhruva <address@hidden> writes:
>> Oh no, it is not an optimization.  Lisp programs _are_ lists.  It
>> would be a bug if a quoted list inside of a Lisp program would be
>> magically replaced by something new every time the program was run.
>
> Since lists are mutable (from the PYTHON usage), I must be able to
> do an inplace deletion and insertion in a list.

Why would you want to do _inplace_ deletion or insertion on '(Hg)?
That does not make sense, unless you want the meaning of '(Hg) to
change.

> Going back to my vc-handled-backends list, if I can inplace delete
> "Hg" entry and prepend it with "Hg", I need not call a setq.

There is neither reason nor usefulness in not calling setq: setq does
not copy lists.

> Can this be done, inplace modifications?  Apologies for asking too
> much from you, if you point me to a low level document, I will put
> in efforts to learn.

(info "(elisp) Rearrangement")
aka
<URL:info:elisp#Rearrangement>

explains this quite carefully.

What you probably wanted was something like

(setq vc-handled-backends (cons 'Hg (delq 'Hg vc-handled-backends)))

This destructively changes the old vc-handled-backends (unless it does
not contain Hg at all, or only as the first element) and prepends Hg.
As long as nobody kept the original (not a copy) of the old
vc-handled-backends (which will get its Hg deleted without getting
anything prepended), this is perfectly fine.

What isn't, is destructively manipulating '(Hg).

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

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