From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: Automating function with interactive args Date: Thu, 26 Apr 2012 10:21:46 -0700 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1335460929 26319 80.91.229.3 (26 Apr 2012 17:22:09 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 26 Apr 2012 17:22:09 +0000 (UTC) To: "'BDB'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Apr 26 19:22:07 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SNSON-0006Lw-Ia for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Apr 2012 19:22:07 +0200 Original-Received: from localhost ([::1]:40291 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SNSOM-0007r3-T3 for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Apr 2012 13:22:06 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:33112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SNSOE-0007q5-0D for help-gnu-emacs@gnu.org; Thu, 26 Apr 2012 13:22:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SNSO7-0003Ha-Kl for help-gnu-emacs@gnu.org; Thu, 26 Apr 2012 13:21:57 -0400 Original-Received: from rcsinet15.oracle.com ([148.87.113.117]:22614) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SNSO7-0003H6-ER for help-gnu-emacs@gnu.org; Thu, 26 Apr 2012 13:21:51 -0400 Original-Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q3QHLl5X016276 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 26 Apr 2012 17:21:48 GMT Original-Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q3QHLlQ9008853 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 26 Apr 2012 17:21:47 GMT Original-Received: from abhmt106.oracle.com (abhmt106.oracle.com [141.146.116.58]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q3QHLl3N013801; Thu, 26 Apr 2012 12:21:47 -0500 Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 26 Apr 2012 10:21:46 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: Ac0jzVjgZ25403byTFCUYtuBHhHNcQAAF80w X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 148.87.113.117 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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 Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:84648 Archived-At: > Quite often I use "M-x ediff-revision", which then prompts me for the > files to ediff, and I always just accept the defaults by > hitting return to the 3 prompts. I would like to make all of > this a single keystroke. A straight keyboard macro doesn't seem > to work with the prompts, and my other googling hasn't turned up > a solution. Ideas? Perhaps something like this (untested)? (defun my-ediff-revision () "..." (interactive) (find-file (expand-file-name (file-name-directory (ediff-get-default-file-name)) (if ediff-use-last-dir ediff-last-dir-A default-directory))) (when (and (buffer-modified-p) (y-or-n-p (format "Buffer %s is modified. Save buffer? " (buffer-name)))) (save-buffer (current-buffer))) (ediff-load-version-control) (funcall (intern (format "ediff-%S-internal" ediff-version-control-package)) "" "" nil))