[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
help: howto call ediff from elisp, interactive and multiple args ...
From: |
Peter Daum |
Subject: |
help: howto call ediff from elisp, interactive and multiple args ... |
Date: |
Sat, 13 Nov 2010 18:14:54 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.1.12) Gecko/20100914 Thunderbird/3.0.8 |
Sorry, I couldn't find an appropriate subject line:
I have to compare many similar binary files and the best tool I could
find so far for this purpose is a combination of emacs, hexl-mode and
ediff. Because this involves far too much typing, I am trying to write a
little lisp function to set up everything. I already know several ways
how not to do this ;-)
(defun hexl-ediff (file1 file2)
"hexl-find 2 files and run ediff on them"
(interactive "fFile 1:" "fFile2:")
(hexl-find-file file1)
(let*
(
(buffer1 (last-buffer))
(bn1 (buffer-name buffer1))
(void (hexl-find-file file2))
(buffer2 (last-buffer))
(bn2 (buffer-name buffer2))
(void (message "b1: %s b2: %s" bn1 bn2))
)
(ediff-buffers bn1 bn2)
))
There are several problems with this:
1) I could not find a way how to interactively call this with 2 files.
I'll get prompted for the 1st file and then I run into an error about
the wrong #args without any chance to enter the 2nd file name
2) More severe: I could not come up with any reliable way how to get the
names of the buffers that the calls to hexl-find-file created (the
desperate attempt with "last-buffer" will return "*Completions*" ;-)
Any ideas?
Regards,
Peter
- help: howto call ediff from elisp, interactive and multiple args ...,
Peter Daum <=