From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Politz Newsgroups: gmane.emacs.help Subject: Re: defadvice question. Date: Thu, 17 Sep 2009 02:16:02 +0200 Message-ID: <87d45qmnnh.fsf@fh-trier.de> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1253146624 27253 80.91.229.12 (17 Sep 2009 00:17:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 17 Sep 2009 00:17:04 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 17 02:16:57 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Mo4gD-0003vv-5q for geh-help-gnu-emacs@m.gmane.org; Thu, 17 Sep 2009 02:16:57 +0200 Original-Received: from localhost ([127.0.0.1]:40971 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mo4gC-00054w-He for geh-help-gnu-emacs@m.gmane.org; Wed, 16 Sep 2009 20:16:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mo4fo-000543-B6 for help-gnu-emacs@gnu.org; Wed, 16 Sep 2009 20:16:32 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mo4fj-00051I-Db for help-gnu-emacs@gnu.org; Wed, 16 Sep 2009 20:16:31 -0400 Original-Received: from [199.232.76.173] (port=35207 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mo4fj-00051A-91 for help-gnu-emacs@gnu.org; Wed, 16 Sep 2009 20:16:27 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:35086) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mo4fi-0000BG-VT for help-gnu-emacs@gnu.org; Wed, 16 Sep 2009 20:16:27 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.50) id 1Mo4fg-0003mk-G6 for help-gnu-emacs@gnu.org; Thu, 17 Sep 2009 02:16:24 +0200 Original-Received: from dslb-088-068-221-112.pools.arcor-ip.net ([88.68.221.112]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 17 Sep 2009 02:16:24 +0200 Original-Received: from politza by dslb-088-068-221-112.pools.arcor-ip.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 17 Sep 2009 02:16:24 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 32 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: dslb-088-068-221-112.pools.arcor-ip.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:HpLbYdqvu3l5uhROsJPk9M7t7Ss= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:68221 Archived-At: Michal 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