From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sergey Organov Newsgroups: gmane.emacs.help Subject: Re: How to revert buffer from "Save file?" prompt? Date: Tue, 08 Jun 2021 20:15:28 +0300 Message-ID: <87lf7kb7m7.fsf@osv.gnss.ru> References: <87pmwxu50x.fsf@osv.gnss.ru> <83tum9g35u.fsf@gnu.org> <87pmwwbd0p.fsf@osv.gnss.ru> <83sg1se53s.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12691"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 08 19:16:34 2021 Return-path: Envelope-to: geh-help-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 1lqfL7-00036G-DH for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 08 Jun 2021 19:16:33 +0200 Original-Received: from localhost ([::1]:45890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqfL6-0006JS-FV for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 08 Jun 2021 13:16:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43696) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqfKA-0006Gt-Uq for help-gnu-emacs@gnu.org; Tue, 08 Jun 2021 13:15:35 -0400 Original-Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]:42637) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lqfK9-0003lZ-50; Tue, 08 Jun 2021 13:15:34 -0400 Original-Received: by mail-lj1-x233.google.com with SMTP id r16so8831149ljk.9; Tue, 08 Jun 2021 10:15:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=XyCCrWT2uBUzboHSyfVI/K0VrKdL42CRDzaUSVp9X4Q=; b=b2lagfqIo/4l06zpCQs0Un6XI4pQeoQRZoBiTsWngNuFHUvmVcAe7bCXRSLCEUkgRQ hkrppDs765yvHuKrlTgsGh8qedSz9SI7FFW7+wQKhlVfqaXKO2P8MHYZghEeYL1kTmHo y0m2eS0K3efk/iJyGWTAMlb4BfViA8kZyUFsY4nWVF66INL3Qy0tf38rEetBFnTNc7Xm wI1urbZTtSJWXJCVDr1DxyAMTwzTRpj8CwvaZLSLIvyclQUX/CW2g17E44ZjxkYvTGbD lmj+7LxiI6mk0DAP8V9XR0wsA2sbtvTJb2V2fkvN86F1soQl1T3rc3O3f7+QWG+fc66D xcLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=XyCCrWT2uBUzboHSyfVI/K0VrKdL42CRDzaUSVp9X4Q=; b=F6h6yCyms0S28NJotDoWJYCw9pXtrZ9yj3dUUGn1DkZN0KSgZKO7VVI0bMQTG4XoCy FD6bYL9UsXR8Ji8Wc2SxKRCyTXn8p3eXdv5zzYmrRicxwt0WJu8TLSzDQbPEQS5Vg65b Xn6NX9VEI6tlPbddcVMpSK7L4O/fjXoacX6nub0ud6oCAs0fl5fi7R+MZEslamIWu1rP j3/vEWfrn1XzqAi8u0emlZkYvzk8vUuvtaQkrcRpbfguew3E1dDq/OgrQP3jOqk+SaUz DYH2At4egKqd2gsCON7O1FaC0Gb0qenm0FLFqfxevcy3W0qlo7kQnzZP9O7mgoyvcJsp Ds5g== X-Gm-Message-State: AOAM532xgAPu0RLziDoI1gzzwhMcMQyMAp1PPRtsus14KJuBOTcatwLC 7/4AY0YAQ5Of4IpAfHGf5MFUoyO2G0I= X-Google-Smtp-Source: ABdhPJweWwZcf2zuR8N6jldO45LNVdg6UvMpxtFlVEOFJCkpHosJFuAAlA4Kz7flucmOyMifU6NcRg== X-Received: by 2002:a05:651c:39c:: with SMTP id e28mr5630505ljp.183.1623172530342; Tue, 08 Jun 2021 10:15:30 -0700 (PDT) Original-Received: from osv.localdomain ([89.175.180.246]) by smtp.gmail.com with ESMTPSA id m16sm30284lfl.300.2021.06.08.10.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 10:15:29 -0700 (PDT) In-Reply-To: <83sg1se53s.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 08 Jun 2021 18:41:27 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::233; envelope-from=sorganov@gmail.com; helo=mail-lj1-x233.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:130633 Archived-At: Eli Zaretskii writes: >> From: Sergey Organov >> Cc: help-gnu-emacs@gnu.org >> Date: Tue, 08 Jun 2021 18:18:46 +0300 >> >> > Why do you need to revert? If you answer 'n' (= NO), the compilation >> > will use the version on disk, without saving your edits. You can >> > later revert the buffer, but that's a separate operation. >> >> Yes, and that's exactly the problem. It will ask me again and again >> every time I compile. Annoying as hell. > > Do you want to compile the file, or do you want to revert it? I want to compile, and that obviously involves some files. The buffer in question could be entirely unrelated to the compilation, or it could be related, it doesn't matter for the issue at hand. > These are two orthogonal things, so it sounds strange to me that you > seem to use "M-x compile" as the means to find all the changes buffers > and revert them. It's not the means to find such buffers, it's just that I often notice such buffers when compiling or switching desktops, or leaving emacs. But on exit there is at least final "exit anyway" option that discards changes. > >> > IOW, if all you want is to revert the buffer _without_ compiling, just >> > type C-g to abort "M-x compile" and then revert. >> >> No, I want to compile, and I don't need the changes in some buffer(s) >> anymore. > > Then how come you left those buffers modified? And what does that > have to do with compilation? I left those buffers modified, sorry, my mistake. Maybe I thought I'll need the modification, and now I see I don't anymore. Now otherwise unrelated compilation annoyingly asks me every time if I want to save these buffers. No, I don't! > >> Probably something like revert-some-buffers (similar to >> save-some-buffer) would help as well, but a feature to discard changes >> from the "save file" prompt would be definitely more helpful. > > Then this isn't about "M-x compile", right? It's about being able to > revert some of the modified buffers, either as a separate command, or > as part of "C-x s". Right? Right, "M-x compile" is just an example where the lack of feature gets most annoying. As for "C-x s", it could run the would-be function with the "revert" feature disabled, if it makes more sense. > >> As I've asked in another mail: is there a practical way to add >> keybindings to this prompt? I'd then opt for adding "C-M-g: revert the >> buffer" and be finally done with it. > > See save-some-buffers-action-alist. Will check, thanks! -- Sergey Organov