From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: When suggesting a file recovery, emacs should maybe check for actual changes Date: Sun, 02 Oct 2022 18:49:57 +0300 Message-ID: <83lepy1aze.fsf@gnu.org> References: <87wn9i73ks.fsf@autistici.org> <83tu4m1gn1.fsf@gnu.org> <83pmfa1eq3.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38526"; mail-complaints-to="usenet@ciao.gmane.io" Cc: andrea.monaco@autistici.org, emacs-devel@gnu.org To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Oct 02 17:51:11 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1of1FG-0009t6-TT for ged-emacs-devel@m.gmane-mx.org; Sun, 02 Oct 2022 17:51:11 +0200 Original-Received: from localhost ([::1]:45292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1of1FF-0002KX-9D for ged-emacs-devel@m.gmane-mx.org; Sun, 02 Oct 2022 11:51:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50352) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1of1EK-0001Yx-AD for emacs-devel@gnu.org; Sun, 02 Oct 2022 11:50:12 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:50126) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1of1EH-0000IP-GD; Sun, 02 Oct 2022 11:50:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Aj3I2JnX6MmKXHEEuthhn1eWFtviH3JCIWhJqEQTNVg=; b=AOFEzBPL7Q1W CS6ga51bAQ5zb51WeM892JVKKgaEOIrslsphbpXVhAQmgps/hOFUaFgemxFrcL/XWXSVYysuf/kXW H8s+mA9k8tgmFn1vvtDIjNL4566e+CggDnQ+GSKFKsV/sAxPAvUDT4tIAvIK2sK9GdmYWGgslUtNa SSLoGVkXR3ffxfp5kiQOwWCvFzcIyn/V6Uxd04P/itLEP+vA4Ssy44OINF9rFE6gAGU/wFSsIqJrx 3YRhuT4XkIWzjIiFK8WV5xaCRTcgPvGaVVjJDQWIN0tqM0UGYv9RIyWcwTEBFY/ORP6Z1M//GGzhm WlJMrO4ZHMJU8y4Qp8Pmxw==; Original-Received: from [87.69.77.57] (port=2209 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1of1EG-00006U-Uy; Sun, 02 Oct 2022 11:50:09 -0400 In-Reply-To: (message from Stefan Kangas on Sun, 2 Oct 2022 08:07:33 -0700) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:296625 Archived-At: > From: Stefan Kangas > Date: Sun, 2 Oct 2022 08:07:33 -0700 > Cc: andrea.monaco@autistici.org, emacs-devel@gnu.org > > Eli Zaretskii writes: > > > I'm asking if this is an important enough situation to add code that > > could be buggy to a feature that basically must be 110% safe? > > You're right that it sounds a bit scary on the face of it. > > Maybe it's okay if we do it in Emacs 30, and add tests? Adding tests > would of course be good even if we don't make any changes. Adding tests is always welcome. But the thing with safety belts is that they are always important in edge cases that are hard to test. I think it could be okay to compare plain-ASCII files to their auto-save files (but even there we'd need to be aware of EOL differences, which will almost always happen on Windows, for example). I'd hesitate to do this with non-ASCII files. > My usual response, if I care enough about the file, is to manually make > a copy, restore the file from Emacs, and then check the diff. Now that > I think about it, this suggests another nice feature to have would be to > show the diff directly from the Emacs prompt. Again, if you intend to run the Diff utility, it will show differences due to encoding and EOL format.