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.bugs Subject: bug#65854: Multi-file replacement diff Date: Sun, 24 Sep 2023 11:12:51 +0300 Message-ID: <831qeo3s70.fsf@gnu.org> References: <86sf7mgd54.fsf@mail.linkov.net> <86bke943tp.fsf@mail.linkov.net> <83jzswrios.fsf@gnu.org> <86o7i7oo9t.fsf@mail.linkov.net> <86sf7g548a.fsf@mail.linkov.net> <83pm2jkhsg.fsf@gnu.org> <86msxeu1q3.fsf@mail.linkov.net> <83zg1e7jq3.fsf@gnu.org> <86o7hunqyu.fsf@mail.linkov.net> <83jzsi5h1n.fsf@gnu.org> <86r0movlkt.fsf@mail.linkov.net> <83h6nk4t32.fsf@gnu.org> <86ttrkvx65.fsf@mail.linkov.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20184"; mail-complaints-to="usenet@ciao.gmane.io" Cc: me@eshelyaron.com, 65854@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 24 10:14:18 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1qkKFt-000523-H7 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Sep 2023 10:14:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkKFU-0003Nb-Rw; Sun, 24 Sep 2023 04:13:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qkKFS-0003N6-V9 for bug-gnu-emacs@gnu.org; Sun, 24 Sep 2023 04:13:50 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qkKFS-0006S0-N3 for bug-gnu-emacs@gnu.org; Sun, 24 Sep 2023 04:13:50 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qkKFe-00074U-2p for bug-gnu-emacs@gnu.org; Sun, 24 Sep 2023 04:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Sep 2023 08:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65854 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 65854-submit@debbugs.gnu.org id=B65854.169554322427146 (code B ref 65854); Sun, 24 Sep 2023 08:14:02 +0000 Original-Received: (at 65854) by debbugs.gnu.org; 24 Sep 2023 08:13:44 +0000 Original-Received: from localhost ([127.0.0.1]:40946 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkKFL-00073m-QC for submit@debbugs.gnu.org; Sun, 24 Sep 2023 04:13:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48136) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkKFI-00073U-7p for 65854@debbugs.gnu.org; Sun, 24 Sep 2023 04:13:42 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qkKF0-0006QY-8j; Sun, 24 Sep 2023 04:13:22 -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=yqciYbtnJn+eyU4mMXxFxESnH6aNY2kxHJa9vQxhcSU=; b=fDNiuSYjw0Tv llTb8UyIwJbGCZKmrIjeJumN3Vb0MdN/IVG9M9MxFAv5IaWNLZkJo8R1tNdMWabhU+RQTfNwBxJvr D8PjZ/zoWhBC/9JGJcDj/T0sEICP260kEzvJVHbRHDnBXze9Q6gp26L7/0HYRmJZoycaq4YYMvJMz QAIkv+4wEzFkEZU9BbXljgY7Tvw75OcHekzTerzDARszDCHsipvlIR7tcjW+8GTRlgdCeg8iXE/ie JkyuOZysNRVr6DfKbJVqSMztYR78YdnqjVtKKoPfXYhfdDAX+TSuCiZ8PfvTC+MJZq9/mJ/OP/njv 6iGKWdpA0gVU6GIYifC0mg==; In-Reply-To: <86ttrkvx65.fsf@mail.linkov.net> (message from Juri Linkov on Sun, 24 Sep 2023 10:37:54 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:271223 Archived-At: > From: Juri Linkov > Cc: me@eshelyaron.com, 65854@debbugs.gnu.org > Date: Sun, 24 Sep 2023 10:37:54 +0300 > > >> >> >> + However, when the file > >> >> >> +is not visited in a buffer, or the buffer is not modified, still read > >> >> >> +contents from the file." > >> >> > > >> >> > Seems to describe an implementation detail, and I don't think it > >> >> > should be there. E.g., what if the file visited by the buffer no > >> >> > longer exists? > >> >> > >> >> If the file visited by the buffer no longer exists, then > >> >> the standard error is signaled. > >> > > >> > Which means in that case it is better to use the buffer text, no? > >> > >> Since replacement diffs are not supported in non-file buffers, > >> better to signal an error for heads up. > > > > But it _is_ a file-visiting buffer. It's just that its file was > > deleted meanwhile. > > The generated diff could not be applied to the deleted file. > So generating a diff to the deleted file makes no sense anyway. I suggest not to second-guess what the user wants to do with the generated diffs. What if they just want to email it or something? The basic rule of the least surprise is pertinent here: we have the data, so why not generate the diffs when we can? But if you feel strongly about signaling an error in that case, I won't object.