Ivan Kanis | 5 Aug 2012 12:06

feature request: improve file recovery

Hi,

I get from time to time a prompt saying I should recover a file. When I
do it, I find it difficult to make a decision. It would be nice
to improve the recover-file function to pop up a window that shows
difference between the current file and its recovery.

Is there interest for this feature? I might have the time to write the
feature if it will be integrated in emacs.
--

-- 
Ivan Kanis
http://ivan.kanis.fr

I can stand brute force, but brute reason is quite unbearable.  There
is something unfair about its use. It is hitting below the intellect.
    -- Oscar Wilde

Stephen J. Turnbull | 5 Aug 2012 15:32
Picon
Favicon

feature request: improve file recovery

Ivan Kanis writes:

 > Is there interest for this feature? I might have the time to write the
 > feature if it will be integrated in emacs.

XEmacs has it.  Looks like it was written by Ben Wing and improved by
Mike Sperber.  Neither has a generic assignment on file but I believe
both are willing to sign limited assignments.

ben and mike at xemacs dot org.

Ivan Kanis | 6 Aug 2012 20:01
Face

Re: feature request: improve file recovery

"Stephen J. Turnbull" <stephen <at> xemacs.org> a écrit

> Ivan Kanis writes:
>
>
>  > Is there interest for this feature? I might have the time to write the
>  > feature if it will be integrated in emacs.
>
> XEmacs has it.  Looks like it was written by Ben Wing and improved by
> Mike Sperber.  Neither has a generic assignment on file but I believe
> both are willing to sign limited assignments.
>
> ben and mike at xemacs dot org.

Ben, Mike,

Would you sign a limited assignment for this feature?
--

-- 
Ivan Kanis
http://ivan.kanis.fr

Les maris des femmes qui nous plaisent sont toujours des imbéciles.
    -- Georges Feydeau

Michael Sperber | 7 Aug 2012 13:48
Picon

Re: feature request: improve file recovery


Ivan Kanis <ivan.kanis <at> googlemail.com> writes:

> "Stephen J. Turnbull" <stephen <at> xemacs.org> a écrit
>
>> Ivan Kanis writes:
>>
>>
>>  > Is there interest for this feature? I might have the time to write the
>>  > feature if it will be integrated in emacs.
>>
>> XEmacs has it.  Looks like it was written by Ben Wing and improved by
>> Mike Sperber.  Neither has a generic assignment on file but I believe
>> both are willing to sign limited assignments.

I signed copyright assignments for everything in XEmacs to the FSF a
long time ago.

--

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla

Bastien | 7 Aug 2012 19:09
Picon
Gravatar

Re: feature request: improve file recovery

Hi Michael,

Michael Sperber <sperber <at> deinprogramm.de> writes:

> I signed copyright assignments for everything in XEmacs to the FSF a
> long time ago.

Can we look at the XEmacs code for this online?

Or shall I download the whole beast and digg?

I'm willing to try adding this functionality.

--

-- 
 Bastien

Stephen J. Turnbull | 7 Aug 2012 20:36
Picon
Favicon

Re: feature request: improve file recovery

Bastien writes:

 > Can we look at the XEmacs code for this online?

http://bitbucket.org/xemacs/xemacs

and navigate to lisp/files.el.

The functions you're looking for are at lines 3673 `recover-file' and
3113 `diff-files-for-recover'.  The latter handles the possibility
that the autosave file and the current version have different coding
systems.

Glenn Morris | 7 Aug 2012 21:29
Picon

Re: feature request: improve file recovery

Bastien wrote:

> Can we look at the XEmacs code for this online?
>
> Or shall I download the whole beast and digg?
>
> I'm willing to try adding this functionality.

Before you start, don't overlook this:

   Looks like it was written by Ben Wing

who has no assignment of any kind on file AFAICS, so you should not use
this as a basis for an implementation. I don't imagine it would be
difficult to simply write the feature from scratch though.

Stephen J. Turnbull | 8 Aug 2012 07:08
Picon
Favicon

Re: feature request: improve file recovery

Glenn Morris writes:

 > Before you start, don't overlook this:
 > 
 >    Looks like it was written by Ben Wing
 > 
 > who has no assignment of any kind on file AFAICS, so you should not use
 > this as a basis for an implementation.

It's a slight risk of being unable to distribute the new code, yes.
However, the effort of copying this code is likely to be quite small
on the one hand.  On the other, Ben has expressed his willingness to
sign papers in the past on several occasions; he has no objection in
principle to doing so, and I will encourage him to do so here.  The
only real problem likely to come up is that he intermittently drops
off the 'net and may not be reading his mail.

It's not a hard feature to implement straightforwardly, I've done it
myself.  However, there are a number of nuances in the XEmacs code
that might be useful to see in advance.  And it's surely less effort
to wait a while for a reply from Ben then to try to guess what XEmacs
has already learned from experience with the feature.

Stefan Monnier | 6 Aug 2012 12:38
Picon

Re: feature request: improve file recovery

> I get from time to time a prompt saying I should recover a file. When I
> do it, I find it difficult to make a decision. It would be nice
> to improve the recover-file function to pop up a window that shows
> difference between the current file and its recovery.

Usually I do recover-this-file and then diff-buffer-with-file.

> Is there interest for this feature? I might have the time to write the
> feature if it will be integrated in emacs.

Yes it would be nice to get that diff before doing the recovery.

        Stefan


Gmane