From: Thorsten Jolitz <tjolitz@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Best way to get buffer changes in a program?
Date: Tue, 18 Mar 2014 13:28:56 +0100 [thread overview]
Message-ID: <874n2voflj.fsf@gmail.com> (raw)
In-Reply-To: 5327EA7B.1010004@easy-emacs.de
Andreas Röhler <andreas.roehler@easy-emacs.de> 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
next prev parent reply other threads:[~2014-03-18 12:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-18 0:02 Best way to get buffer changes in a program? Thorsten Jolitz
2014-03-18 6:40 ` Andreas Röhler
2014-03-18 12:28 ` Thorsten Jolitz [this message]
2014-03-18 16:44 ` Thorsten Jolitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874n2voflj.fsf@gmail.com \
--to=tjolitz@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.