[Top][All Lists]

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

RE: Automating function with interactive args

From: Drew Adams
Subject: RE: Automating function with interactive args
Date: Thu, 26 Apr 2012 10:21:46 -0700

> 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 ()
  (find-file (expand-file-name
              (file-name-directory (ediff-get-default-file-name))
              (if ediff-use-last-dir
  (when (and (buffer-modified-p)
             (y-or-n-p (format "Buffer %s is modified. Save buffer? "
    (save-buffer (current-buffer)))
  (funcall (intern (format "ediff-%S-internal"
           "" "" nil))

reply via email to

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