help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: help: howto call ediff from elisp, interactive and multiple args ...


From: Stefan Monnier
Subject: Re: help: howto call ediff from elisp, interactive and multiple args ...
Date: Wed, 08 Dec 2010 15:36:23 -0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> (defun hexl-ediff (file1 file2)
>   "hexl-find 2 files and run ediff on them"
>   (interactive "fFile 1: \nfFile2:")
>   (let ((buffer1 (progn
>                      (hexl-find-file file1)
>                      (buffer-name (current-buffer))))
>         (buffer2 (progn
>                      (hexl-find-file file2)
>                      (buffer-name (current-buffer)))))
>     (ediff-buffers buffer1 buffer2)))

Without having tried, my best guess would have been:

   (defun hexl-ediff (file1 file2)
     "hexl-find 2 files and run ediff on them"
     (interactive "fFile 1: \nfFile2: ")
     (let ((buffer1 (find-file-noselect file1 nil t))
           (buffer2 (find-file-noselect file2 nil t)))
       (with-current-buffer buffer1 (hexl-mode))
       (with-current-buffer buffer2 (hexl-mode))
       (ediff-buffers buffer1 buffer2)))


-- Stefan


reply via email to

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