unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Visuwesh <visuweshm@gmail.com>
Cc: 52242@debbugs.gnu.org
Subject: bug#52242: 29.0.50; Feature Request: Offer to run`diff-buffer-with-file' in `recover-this-file' prompt
Date: Sat, 09 Dec 2023 11:33:18 +0200	[thread overview]
Message-ID: <83h6kryb35.fsf@gnu.org> (raw)
In-Reply-To: <87wmtqvaqb.fsf@gmail.com> (message from Visuwesh on Thu, 07 Dec 2023 11:02:28 +0530)

> From: Visuwesh <visuweshm@gmail.com>
> Date: Thu, 07 Dec 2023 11:02:28 +0530
> 
> I didn't notice that recover-file was covered in the Emacs manual, I
> have now updated the manual and marked the NEWS entry accordingly in the
> attached patch.

Thanks, I have a few comments:

> diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi
> index 917e937d32d..c791a6f1c98 100644
> --- a/doc/emacs/files.texi
> +++ b/doc/emacs/files.texi
> @@ -1325,9 +1325,11 @@ Recover
>  @end example
>  
>    Before asking for confirmation, @kbd{M-x recover-file} displays a
> -directory listing describing the specified file and the auto-save file,
> -so you can compare their sizes and dates.  If the auto-save file
> -is older, @kbd{M-x recover-file} does not offer to read it.
> +directory listing describing the specified file and the auto-save
> +file, so you can compare their sizes and dates.  If you answer
> +@kbd{diff}, it shows the diff between @var{file} and its auto-save
> +file @file{#@var{file}#}.  If the auto-save file is older, @kbd{M-x
> +recover-file} does not offer to read it.

It is better to make the documentation of the 'diff' response separate
from the rest, since the original text doesn't describe the responses
at all, it only mentions the need for confirmation.

So I suggest to leave the text starting at "Before asking for
confirmation" alone, and add a new paragraph after that one, like
this:

  When @kbd{M-x recover-file} asks for confirmation, if you respond
  with @kbd{diff} or @kbd{=}, it shows the diffs between ...

> ++++
> +** 'recover-file' can show diff between auto save file and current file.
                              ^^^^
We use "diffs", plural.

> +When answering the prompt with "diff" or "=", it now shows the diff
                                                                  ^^^^
Same here.

> +between the auto save file and the current file.
> +                            (choices
> +                             '(("yes" ?y "recover auto save file")
> +                               ("no" ?n "don't recover auto save file")
> +                               ("diff" ?= "diff auto save file with current file")))
                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Maybe a better text would be

   show changes between auto save file and current file

> +                            ans)
> +                        (while (equal "diff" (setq ans (read-answer prompt choices)))
> +                          (diff file file-name))
> +                        (equal ans "yes"))

Thanks.





  reply	other threads:[~2023-12-09  9:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-02 12:28 bug#52242: 29.0.50; Feature Request: Offer to run`diff-buffer-with-file' in `recover-this-file' prompt Visuwesh via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-06  8:22 ` Visuwesh
2023-12-07  5:32   ` Visuwesh
2023-12-09  9:33     ` Eli Zaretskii [this message]
2023-12-10 13:27       ` Visuwesh
2023-12-11  4:14         ` Visuwesh
2023-12-16 12:36           ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83h6kryb35.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=52242@debbugs.gnu.org \
    --cc=visuweshm@gmail.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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