From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.bugs Subject: bug#49869: Revert buffer? Yes/No/Maybe Date: Wed, 04 Aug 2021 10:06:12 +0000 Message-ID: References: <87im0la99d.fsf@mail.linkov.net> <87h7g5lh05.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19028"; mail-complaints-to="usenet@ciao.gmane.io" Cc: juri@linkov.net, 49869@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 04 12:07:11 2021 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 1mBDnq-0004nt-VN for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 04 Aug 2021 12:07:11 +0200 Original-Received: from localhost ([::1]:48502 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBDnq-0003jn-0p for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 04 Aug 2021 06:07:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53220) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBDni-0003gL-Ug for bug-gnu-emacs@gnu.org; Wed, 04 Aug 2021 06:07:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59480) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mBDni-0003Kc-MO for bug-gnu-emacs@gnu.org; Wed, 04 Aug 2021 06:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mBDni-0003S0-B5 for bug-gnu-emacs@gnu.org; Wed, 04 Aug 2021 06:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Aug 2021 10:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49869 X-GNU-PR-Package: emacs X-Debbugs-Original-Cc: bug-gnu-emacs@gnu.org, 49869@debbugs.gnu.org, Juri Linkov Original-Received: via spool by submit@debbugs.gnu.org id=B.162807159913229 (code B ref -1); Wed, 04 Aug 2021 10:07:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 Aug 2021 10:06:39 +0000 Original-Received: from localhost ([127.0.0.1]:42793 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBDnH-0003RG-Ht for submit@debbugs.gnu.org; Wed, 04 Aug 2021 06:06:39 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:34530) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBDn1-0003Qk-2x for submit@debbugs.gnu.org; Wed, 04 Aug 2021 06:06:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBDn0-0002iS-SY for bug-gnu-emacs@gnu.org; Wed, 04 Aug 2021 06:06:18 -0400 Original-Received: from heytings.org ([95.142.160.155]:39056) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBDmz-0002fz-4g for bug-gnu-emacs@gnu.org; Wed, 04 Aug 2021 06:06:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20210101; t=1628071573; bh=I16QUiIMYl7t+J78kRSFTBPdfNICkLgdppcxshLstN8=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=Zfi/p5uFALrjGOUwgjItdyJm21Bp8GzKL7/ZEP3cERXnFvQQK6uboh63/3LZJI4Al vO8OJIHLn+86xWa4JuaL2XdtKy0I/8OF7Wk3SyI/Q2NfLB+LoQowdLISYJsrXswQSy HTUi/hMLoihpjFmd0Wr5QYYLYs8S4J/9c2+rnzMbII+cIlyxTud6dz6jCwm1BYKlX5 lpABJgPPGc3kTrEiYlGrsSusKuiw9vHOirS3YU7KzazFpmfqH5fEMEeGcy1k005rQa b21w6NJQvirIYo5Wuy3KmBgFsdxqROzYBxIonoSDMULQGa9e7beoGKCcYLanVPlcaD LidC+4ImhhDrA== In-Reply-To: <87h7g5lh05.fsf@gnus.org> Received-SPF: pass client-ip=95.142.160.155; envelope-from=gregory@heytings.org; helo=heytings.org 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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" Xref: news.gmane.io gmane.emacs.bugs:211154 Archived-At: >> There is a new short keybinding to revert the current buffer - just 3 >> keys: 'C-x x g'. But then it asks for a confirmation with 4 keys: 'y e >> s RET' that is even longer than the command keys. This defeats the >> purpose of having the short key sequence. Does 'C-x x g' really need a >> confirmation? >> >> I propose to revert the buffer immediately after typing 'C-x x g'. > > I think I agree... if the buffer hasn't been changed. So we could bind > it to a new command, like revert-buffer-command, that would call > revert-buffer with NOCONFIRM if the buffer hasn't been edited? > What about: (defun revert-buffer-short-confirm (&optional args) (interactive (list (not current-prefix-arg))) (cl-letf (((symbol-function 'yes-or-no-p) 'y-or-n-p)) (revert-buffer args))) (global-set-key (kbd "C-x x g") 'revert-buffer-short-confirm) ?