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

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

Re: Best way to get buffer changes in a program?


From: Thorsten Jolitz
Subject: Re: Best way to get buffer changes in a program?
Date: Tue, 18 Mar 2014 13:28:56 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Andreas Röhler <address@hidden> writes:

> Am 18.03.2014 01:02, schrieb Thorsten Jolitz:
>>
>> Hi List,
>>
>> there are many ways to track and visualize changes in Emacs (see
>> e.g. http://www.emacswiki.org/emacs/TrackChanges).
>>
>> However, I would like to get non-interactively a list of lines (or
>> positions) in the buffer that changed after the last command - how to I
>> do that? Is is somehow possible to determine in a program that calls
>> other functions that insert text which new lines have been inserted (when
>> a buffer increased in size after a command was executed)?
>>
>> Thanks in advance for any hints.
>>
>
> You could start from ediff-regions-... running at alist of functions -
> all that against a list of original buffers.

Thanks for bringing me on the right track, after quite a lot of research in
the ediff libraries I found this low-level non-interactive function that
gives me the line numbers I need:

,-------------------------------------------------------------------------
| ;; Run the diff program on FILE1 and FILE2 and put the output in
| ;; DIFF-BUFFER Return the size of DIFF-BUFFER The return code isn't used
| ;; in the program at present.
| 
| (defun ediff-make-diff2-buffer (diff-buffer file1 file2) ...)
`-------------------------------------------------------------------------

-- 
cheers,
Thorsten




reply via email to

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