unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How can I find changes before saving a file?
@ 2003-02-12 12:06 PL
  2003-02-12 12:45 ` Unknown
  2003-02-12 13:19 ` Kai Großjohann
  0 siblings, 2 replies; 7+ messages in thread
From: PL @ 2003-02-12 12:06 UTC (permalink / raw)


If I have edited a file and want to see what changes I have made, how
can I do that? I can of course use "Ctrl-x u" to undo the changes
one-by-one, but that's not really what I want to do. Then I would have
to re-do the un-doings to get the file back...

Another way is to copy the file on disk, save the file, and compare
with the copy. But that means I have to save the file. I want to be
able to find the edits *before* I save.

Any ideas, anyone?

Rgds
Peter

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How can I find changes before saving a file?
  2003-02-12 12:06 How can I find changes before saving a file? PL
@ 2003-02-12 12:45 ` Unknown
  2003-02-12 13:19 ` Kai Großjohann
  1 sibling, 0 replies; 7+ messages in thread
From: Unknown @ 2003-02-12 12:45 UTC (permalink / raw)


PL wrote:

> If I have edited a file and want to see what changes I have made, how
> can I do that? I can of course use "Ctrl-x u" to undo the changes
> one-by-one, but that's not really what I want to do. Then I would have
> to re-do the un-doings to get the file back...
> 
> Another way is to copy the file on disk, save the file, and compare
> with the copy. But that means I have to save the file. I want to be
> able to find the edits *before* I save.
> 
> Any ideas, anyone?

Look into highlight-changes-mode.  I don't see a reason why this can't be done 
using the undo information, though.  That sounds smarter and more efficient 
to me.

--
Le

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How can I find changes before saving a file?
  2003-02-12 12:06 How can I find changes before saving a file? PL
  2003-02-12 12:45 ` Unknown
@ 2003-02-12 13:19 ` Kai Großjohann
  2003-02-12 14:14   ` Roland Winkler
  1 sibling, 1 reply; 7+ messages in thread
From: Kai Großjohann @ 2003-02-12 13:19 UTC (permalink / raw)


deleteallspam@yahoo.com (PL) writes:

> If I have edited a file and want to see what changes I have made, how
> can I do that?

You could compare the file with its backup.  But that only works
after saving, of course.  (Why do you want to do it before saving?)

-- 
A turnip curses Elvis

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How can I find changes before saving a file?
  2003-02-12 13:19 ` Kai Großjohann
@ 2003-02-12 14:14   ` Roland Winkler
  2003-02-12 14:56     ` Ehud Karni
       [not found]     ` <mailman.1868.1045061850.21513.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 7+ messages in thread
From: Roland Winkler @ 2003-02-12 14:14 UTC (permalink / raw)


kai.grossjohann@uni-duisburg.de (Kai Großjohann) writes:

> > If I have edited a file and want to see what changes I have made, how
> > can I do that?
> 
> You could compare the file with its backup.  But that only works
> after saving, of course.

You could temporarily rename the modified buffer, load the file once
more into emacs and start an ediff session.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How can I find changes before saving a file?
  2003-02-12 14:14   ` Roland Winkler
@ 2003-02-12 14:56     ` Ehud Karni
       [not found]     ` <mailman.1868.1045061850.21513.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 7+ messages in thread
From: Ehud Karni @ 2003-02-12 14:56 UTC (permalink / raw)
  Cc: kai.grossjohann

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12 Feb 2003 15:14:12 +0100, Roland Winkler <Roland.Winkler@physik.uni-erlangen.de> wrote:
>
> kai.grossjohann@uni-duisburg.de (Kai Großjohann) writes:
>
> > > If I have edited a file and want to see what changes I have made, how
> > > can I do that?
> >
> > You could compare the file with its backup.  But that only works
> > after saving, of course.
>
> You could temporarily rename the modified buffer, load the file once
> more into emacs and start an ediff session.

I think renaming the buffer wouldn't do, Emacs still remembers the DISK
file name (even after renaming), visiting the file again will go back
to the same buffer.

You could do M-x shell-command cat <file-name> and compare the
current buffer with "*Shell Command Output*".

Ehud.


- --
 Ehud Karni           Tel: +972-3-7966-561  /"\
 Mivtach - Simon      Fax: +972-3-7966-667  \ /  ASCII Ribbon Campaign
 Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
 http://www.mvs.co.il  FAX:  1-815-5509341  / \
 mailto:ehud@unix.mvs.co.il                  Better  Safe  Than  Sorry
-----BEGIN PGP SIGNATURE-----
Comment: use http://www.keyserver.net/ to get my key (and others)

iD8DBQE+SmC5LFvTvpjqOY0RAoUUAJ9KBRIxMjFgm5RYVlM7qE46JeYe5wCfVWYs
WeLieDLYk1ufbCepAjVdbsA=
=bLMV
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How can I find changes before saving a file?
       [not found]     ` <mailman.1868.1045061850.21513.help-gnu-emacs@gnu.org>
@ 2003-02-12 15:35       ` John Paul Wallington
  2003-02-19 17:47       ` PL
  1 sibling, 0 replies; 7+ messages in thread
From: John Paul Wallington @ 2003-02-12 15:35 UTC (permalink / raw)


Ehud Karni wrote:

> > > > If I have edited a file and want to see what changes I have
> > > > made, how can I do that?
> > > 
> > > You could compare the file with its backup.  But that only works
> > > after saving, of course.
> > 
> > You could temporarily rename the modified buffer, load the file
> > once more into emacs and start an ediff session.
[...]  
>  You could do M-x shell-command cat <file-name> and compare the
>  current buffer with "*Shell Command Output*".

You could use the command `diff-buffer-with-file' from Emacs CVS HEAD.
There is `ibuffer-diff-with-file' in the Ibuffer package too.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How can I find changes before saving a file?
       [not found]     ` <mailman.1868.1045061850.21513.help-gnu-emacs@gnu.org>
  2003-02-12 15:35       ` John Paul Wallington
@ 2003-02-19 17:47       ` PL
  1 sibling, 0 replies; 7+ messages in thread
From: PL @ 2003-02-19 17:47 UTC (permalink / raw)


Thanks, that's pretty much what I was looking for! 

I seem to have too old emacs version (20.4.*) so M-x compare-windows
does not work (at least it doesn't for me). One should have 20.6 and
later according to other postings.

But "Tools->Compare->Two Buffers" does the job just fine!

Rgds
Peter

"Ehud Karni" <ehud@unix.mvs.co.il> wrote in message news:<mailman.1868.1045061850.21513.help-gnu-emacs@gnu.org>...
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> I think renaming the buffer wouldn't do, Emacs still remembers the DISK
> file name (even after renaming), visiting the file again will go back
> to the same buffer.
> 
> You could do M-x shell-command cat <file-name> and compare the
> current buffer with "*Shell Command Output*".
> 
> Ehud.
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-02-19 17:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-12 12:06 How can I find changes before saving a file? PL
2003-02-12 12:45 ` Unknown
2003-02-12 13:19 ` Kai Großjohann
2003-02-12 14:14   ` Roland Winkler
2003-02-12 14:56     ` Ehud Karni
     [not found]     ` <mailman.1868.1045061850.21513.help-gnu-emacs@gnu.org>
2003-02-12 15:35       ` John Paul Wallington
2003-02-19 17:47       ` PL

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).