[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 ()
"..."
(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))