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

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

Re: How make vc-diff and vc-revert-buffer NOT ask to save files but do i


From: Christian Seberino
Subject: Re: How make vc-diff and vc-revert-buffer NOT ask to save files but do it automatically?
Date: 2 Oct 2003 18:03:15 -0700

Kevin

Indeed the following wrapper for vc-revert-buffer spells out "yes"
when it asks
the last question: "Discard changes? yes or no".

I must still press RETURN to answer the question.

Can I please ask you how to add the RETURN to the "yes" that this
wrapper spells out? Then it will
be done!

   (defun cs-vc-revert-buffer() (interactive)
      (save-buffer)
      (let ((unread-command-events '(?y ?e ?s)))
         (vc-revert-buffer)) ; (call-interactively 'vc-revert-buffer)?
   )
 
Chris

P.S. The (save-buffer) is an easy  way to avoid the FIRST question
which asks if I want
to save.

Kevin Rodgers <ihs_4664@yahoo.com> wrote in message 
news:<3F7AEB83.4050500@yahoo.com>...
> [Please don't top-post.]
> 
> Christian Seberino wrote:
> 
> > Can I please ask you how to avoid 1 more question in
> > vc-revert-buffer???
> > 
> > vc-revert-buffer seems to do a vc-diff command and then asks
> > a SECOND question something like... "Are you *sure* you want
> > to discard these changes?"
> > 
> > How hardcode answer to this SECOND question to be yes???
> 
> 
> The same way: by pushing additional characters on to unread-command-events.
> 
> 
> > I read the emacs online doc on vc-revert-buffer like you suggested
> > but it had no clues.  Here it is:
> > 
> > vc-revert-buffer is an interactive autoloaded Lisp function in `vc'.
> > It is bound to <menu-bar> <tools> <vc> <vc-revert-buffer>.
> > (vc-revert-buffer)
>   ^^^^^^^^^^^^^^^^^^ 
> 
> That tells you that it does not take any arguments.


reply via email to

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