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

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

Re: Compare two sequent lines in one file


From: filebat Mark
Subject: Re: Compare two sequent lines in one file
Date: Sat, 22 May 2010 23:13:12 +0800

I have tried to get it works by calling the function of ediff-regions-internal.
Post the code snippet here, if any one need it.

If you have better solution, please don't hesitate to email me.
Thanks for your attentions.

;; -------------------------- separator --------------------------
(defun compare-sequent-lines ()
  "Compare two sequent lines in the same buffer, by calling ediff-regions-internal"
  (interactive)
  (save-excursion
    (move-beginning-of-line 1)
    (setq beg-a (point))
    (move-end-of-line 1)
    (setq end-a (point))
    (next-line 1)
    (move-beginning-of-line 1)
    (setq beg-b (point))
    (move-end-of-line 1)
    (setq end-b (point))
    (ediff-regions-internal
       (get-buffer (buffer-name)) beg-a end-a
       (get-buffer (buffer-name)) beg-b end-b
       nil 'ediff-windows-wordwise 'word-mode nil)
    )
)

On Fri, May 21, 2010 at 9:42 PM, filebat Mark <filebat.mark@gmail.com> wrote:
Hi all

Can we compare two sequent lines in one file?  A sample file can be found at the bottom.

With my friend's suggestion, I have managed to do this by calling an internal function(ediff-regions-internal) of ediff.el.
However, leveraging internal interface is quite dangerous.
Besides, this is still some more effort to make it work with the way of ediff-regions-internal.
I may even have to change the code of ediff.el!

I am referring to my super heroes in the mail list. Can anyone give me a hint for a better way?

,-----------
| ========= Difference =========
|
| MDLS_List=dailybuild1-171-112-r1s1-002,dailybuild1-171-112-r1s1-001,dailybuild1-171-112-r2s1-002,dailybuild1-171-112-r2s1-001
| MDLS_List=dailybuild1-171-112-r1s1-001,dailybuild1-171-112-r1s1-003,dailybuild1-171-112-r2s1-002,dailybuild1-171-112-r2s1-001
|
| ========= Difference =========
|
| SS_DiskList=/dev/sdd1,/dev/sdd2,/dev/sde1,/dev/sde1
| SS_DiskList=/dev/sdc1,/dev/sdd1,/dev/sde1,/dev/sdf1
|
| ========= Difference =========
|
| SS_NumDisks=2
| SS_NumDisks=4
`-----------


--
Thanks & Regards

Denny Zhang



--
Thanks & Regards

Denny Zhang


reply via email to

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