From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: seberino@spawar.navy.mil (Christian Seberino) Newsgroups: gmane.emacs.help 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 Organization: http://groups.google.com Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <3F70C451.6040603@yahoo.com> <3F748888.7060101@yahoo.com> <3F7AEB83.4050500@yahoo.com> NNTP-Posting-Host: deer.gmane.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1065143822 25809 80.91.224.253 (3 Oct 2003 01:17:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 3 Oct 2003 01:17:02 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Oct 03 03:17:00 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1A5EZ2-0005AM-00 for ; Fri, 03 Oct 2003 03:17:00 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1A5EY4-0007h8-6Z for geh-help-gnu-emacs@m.gmane.org; Thu, 02 Oct 2003 21:16:00 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews1.google.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 51 Original-NNTP-Posting-Host: 198.253.72.211 Original-X-Trace: posting.google.com 1065142995 3416 127.0.0.1 (3 Oct 2003 01:03:15 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 3 Oct 2003 01:03:15 +0000 (UTC) Original-Xref: shelby.stanford.edu gnu.emacs.help:117039 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:12968 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:12968 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 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 . > > (vc-revert-buffer) > ^^^^^^^^^^^^^^^^^^ > > That tells you that it does not take any arguments.