From: Andreas Politz <politza@fh-trier.de>
To: help-gnu-emacs@gnu.org
Subject: Re: defadvice question.
Date: Thu, 17 Sep 2009 02:16:02 +0200 [thread overview]
Message-ID: <87d45qmnnh.fsf@fh-trier.de> (raw)
In-Reply-To: m2fxanro80.fsf@tenbit.pl
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
next prev parent reply other threads:[~2009-09-17 0:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-16 13:52 defadvice question Michal
2009-09-17 0:16 ` Andreas Politz [this message]
[not found] ` <mailman.6832.1253146594.2239.help-gnu-emacs@gnu.org>
2009-09-17 9:09 ` Michal
2009-09-22 3:01 ` Kevin Rodgers
[not found] ` <mailman.7167.1253588521.2239.help-gnu-emacs@gnu.org>
2009-09-22 16:05 ` Michal
2009-09-23 2:21 ` Kevin Rodgers
[not found] ` <mailman.7257.1253672525.2239.help-gnu-emacs@gnu.org>
2009-09-24 16:42 ` Michal
2009-09-25 2:48 ` Kevin Rodgers
[not found] ` <mailman.7485.1253846932.2239.help-gnu-emacs@gnu.org>
2009-09-28 16:24 ` Michal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d45qmnnh.fsf@fh-trier.de \
--to=politza@fh-trier.de \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.