unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* diff before recovering file
@ 2012-08-02 14:34 Ivan Kanis
  2012-08-02 15:45 ` Doug Lewan
  2012-08-03  9:28 ` Andreas Röhler
  0 siblings, 2 replies; 4+ messages in thread
From: Ivan Kanis @ 2012-08-02 14:34 UTC (permalink / raw)
  To: emacs help

Hi,

Has anyone written a function to see the difference between the file
viewed in the buffer and what would be recovered?
-- 
Ivan Kanis
http://ivan.kanis.fr

Personally I'm always ready to learn, although I do not always like
being taught.
    -- Winston Churchill



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

* RE: diff before recovering file
  2012-08-02 14:34 diff before recovering file Ivan Kanis
@ 2012-08-02 15:45 ` Doug Lewan
  2012-08-03 17:56   ` Ivan Kanis
  2012-08-03  9:28 ` Andreas Röhler
  1 sibling, 1 reply; 4+ messages in thread
From: Doug Lewan @ 2012-08-02 15:45 UTC (permalink / raw)
  To: Ivan Kanis, emacs help

You can always refuse the recovery initially offered and use diff (M-x diff) or ediff (M-x ediff). After that you can run M-x recover-this-file anytime.

I hope this helps.

,Doug


> -----Original Message-----
> From: help-gnu-emacs-bounces+dougl=shubertticketing.com@gnu.org
> [mailto:help-gnu-emacs-bounces+dougl=shubertticketing.com@gnu.org] On
> Behalf Of Ivan Kanis
> Sent: Thursday, 2012 August 02 10:35
> To: emacs help
> Subject: diff before recovering file
> 
> Hi,
> 
> Has anyone written a function to see the difference between the file
> viewed in the buffer and what would be recovered?
> --
> Ivan Kanis
> http://ivan.kanis.fr
> 
> Personally I'm always ready to learn, although I do not always like
> being taught.
>     -- Winston Churchill




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

* Re: diff before recovering file
  2012-08-02 14:34 diff before recovering file Ivan Kanis
  2012-08-02 15:45 ` Doug Lewan
@ 2012-08-03  9:28 ` Andreas Röhler
  1 sibling, 0 replies; 4+ messages in thread
From: Andreas Röhler @ 2012-08-03  9:28 UTC (permalink / raw)
  To: help-gnu-emacs

Am 02.08.2012 16:34, schrieb Ivan Kanis:
> Hi,
>
> Has anyone written a function to see the difference between the file
> viewed in the buffer and what would be recovered?
>

(defun diff-autosaved (&optional switches)
   "Diff this file with its auto-saved version or vice versa.
With prefix arg, prompt for diff switches."
   (interactive (list diff-switches))
   (let ((dir default-directory)
         (file (file-name-nondirectory (replace-regexp-in-string "#" "" (buffer-file-name))))
         bak ori)
     (if (string-match "^#" file)
	(setq bak file
	      ori (replace-regexp-in-string "#" "" file))
       (setq bak (concat "#" file "#")
             ori file))
     (setq bak (concat dir bak))
     (setq ori (concat dir ori))
     (diff bak ori switches)))

Cheers,

Andreas

--
http://launchpad.net/python-mode
http://launchpad.net/s-x-emacs-werkstatt/





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

* Re: diff before recovering file
  2012-08-02 15:45 ` Doug Lewan
@ 2012-08-03 17:56   ` Ivan Kanis
  0 siblings, 0 replies; 4+ messages in thread
From: Ivan Kanis @ 2012-08-03 17:56 UTC (permalink / raw)
  To: Doug Lewan; +Cc: emacs help

Ivan wrote:

>> Has anyone written a function to see the difference between the file
>> viewed in the buffer and what would be recovered?

Doug Lewan <dougl@shubertticketing.com> wrote:

> You can always refuse the recovery initially offered and use diff (M-x
> diff) or ediff (M-x ediff). After that you can run M-x
> recover-this-file anytime.

My emacs doesn't prompt for recovery. It could be a setting on my end. I
don't think M-x diff checks automatically with the backed up file. I'll
try next time I see the message.

Take care,
-- 
Ivan Kanis
http://ivan.kanis.fr

Rule your mind or it will rule you.
    -- Horace



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

end of thread, other threads:[~2012-08-03 17:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-02 14:34 diff before recovering file Ivan Kanis
2012-08-02 15:45 ` Doug Lewan
2012-08-03 17:56   ` Ivan Kanis
2012-08-03  9:28 ` Andreas Röhler

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).