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

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

Re: defadvice question.


From: Andreas Politz
Subject: Re: defadvice question.
Date: Thu, 17 Sep 2009 02:16:02 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Michal <rabbitko@tenbit.pl> writes:

> Hallo group members.
> when doing C-u M-x cvs-checkout 
> I wanted to always have in minibuffer history ring, my cvs root, just to
> use up arrow key to get it. So I did:
>
> (setenv "CVSROOT" "/my/cvs/root")
>
> (defadvice cvs-checkout
>   (before cvs-checkout-cvs-root-add-to-history-ring)
>   (add-to-list 'minibuffer-history (getenv "CVSROOT")))
>
> (ad-activate 'cvs-checkout)
>
>
> but it does not work. Have You an idea why?
>
> best regards,
> Michal

I suspect that it does work, just not the way you expect it :
`add-to-list' does not insert duplicate elements into a list. That
means, if CVSROOT is already at some position in the
`minibuffer-history', this advice does nothing.

On the other hand, is this even necessary ? Peeking at the
`cvs-get-cvsroot' suggests, that CVSROOT is the default value anyway
(when calling `cvs-checkout' w/o prefix), unless you are already in a
cvs directory or the `cvs-root' variable is set.

-ap





reply via email to

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