unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Kevin Rodgers <kevin.d.rodgers@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: defadvice question.
Date: Tue, 22 Sep 2009 20:21:36 -0600	[thread overview]
Message-ID: <h9c0nb$ht5$1@ger.gmane.org> (raw)
In-Reply-To: <m2ab0nt168.fsf@tenbit.pl>

Michal wrote:
> Hallo Kevin.
> Thank You very much for the answer.
> Unfortunately I have problems with both solutions.
> 
> Did You check if it works on YOur site, or this is rather Your suggestion?

I actually tested this suggestion.

> Kevin Rodgers <kevin.d.rodgers@gmail.com> writes:
> 
>> (defadvice cvs-checkout (before minibuffer-history)
>>   "Add CVSROOT environment variable to `minibuffer-history'."
>>   (interactive (let ((minibuffer-history
>> 		      (cons (getenv "CVSROOT") minibuffer-history)))
>> 		 ...)))
>>
>> The tricky part is the "...".  You could copy the entire interactive form from
>> cvs-checkout source in pcvs.el, but that defeats the whole purpose of using
>> advice.  You might be able to work around it like this:
> 
> I C-u M-x cvs-checkout
> 
> call-interactively: Symbol's value as variable is void: \.\.\.

... was not meant to be evaluated literally.  Also, I did not attempt to handle
a prefix argument -- to do that, just add this binding to the let form:

	(prefix-arg current-prefix-arg)

>> (defvar cvs-checkout-interactive-form
>>   (interactive-form 'cvs-checkout))
>>
>> (defadvice cvs-checkout (before minibuffer-history)
>>   "Add CVSROOT environment variable to `minibuffer-history'."
>>   (interactive (let ((minibuffer-history
>> 		      (cons (getenv "CVSROOT") minibuffer-history)))
>> 		 (call-interactively `(lambda (&rest cvs-checkout-args)
>> 					,cvs-checkout-interactive-form
>> 					cvs-checkout-args)))))
> 
> While this does not produce any error message, but my cvs root is not
> put to minibuffer history.

What does M-: (getenv "CVSROOT") display?

cvs-checkout reads several arguments interactively, with different functions
that use different history variables.  Which prompt are you interested in,
"CVS Root: ", "Module(s): ", or "CVS Checkout Directory: "?

-- 
Kevin Rodgers
Denver, Colorado, USA





  reply	other threads:[~2009-09-23  2:21 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
     [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 [this message]
     [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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='h9c0nb$ht5$1@ger.gmane.org' \
    --to=kevin.d.rodgers@gmail.com \
    --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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).