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.devel Subject: Tweaking save-some-buffers-action-alist Date: Thu, 17 Jun 2021 19:12:17 +0300 Message-ID: <87y2b879ni.fsf@osv.gnss.ru> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32689"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jun 17 18:23:46 2021 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 1ltuny-0008LW-DP for ged-emacs-devel@m.gmane-mx.org; Thu, 17 Jun 2021 18:23:46 +0200 Original-Received: from localhost ([::1]:41384 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltunx-00034F-Gd for ged-emacs-devel@m.gmane-mx.org; Thu, 17 Jun 2021 12:23:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48032) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltud0-0006GE-0u for emacs-devel@gnu.org; Thu, 17 Jun 2021 12:12:26 -0400 Original-Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]:40458) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ltucx-0003On-BD for emacs-devel@gnu.org; Thu, 17 Jun 2021 12:12:25 -0400 Original-Received: by mail-lf1-x135.google.com with SMTP id i13so11400005lfc.7 for ; Thu, 17 Jun 2021 09:12:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:user-agent:mime-version; bh=f6q1N1RuCaGjAi+/fG+HXnmlVUvHiJOAzJX+45cpiW8=; b=Lgve+gxpDjepNDPanr8hp37WmhEf8UVbUzei/+mZFhOqTc9D4CNg1phYZaoUdpoe9b hwTv8UbZReuTwBNcWhBIC9LaEfZ5KdgGC5Y/+bb+NEL/gryAdfyZN+6zDIk66GLUdV9o e7kQTXTMyWwZ/VDHSZUBNaz+LTKrOKmLvC8STKkb+rsDsRiAj0Cn9y8IvAATV0g6Ft1w xcSRYK1CGub6q9qcJ6mZTNeUINcqVm14pyREaxqA4q9eCZLB+FJ/cnm5lxxwgR2usYeX +NKIM55ctaCjnmOiSHNbJ0cVUzrdz2BOClbaNeR3gYW4dyarShcuVoj/bAJggAEQUI5Y Qqvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version; bh=f6q1N1RuCaGjAi+/fG+HXnmlVUvHiJOAzJX+45cpiW8=; b=WlNHlFwJ4tDo6A92/wyCyRBkoIJN0vM0pZwzeieA+/Om+pL/dsYrXJxGCzGpQfr0bN nDj+jiGKzT4K6FX8ZMt5BuvdyGq6rRcs6EVTZQmCT799+HvJF+rgJKh0+WtorZF8Qm96 WgFaDYQeleWnnqpYT2uuIuhn3s7Cqgxmw4tBOwUpxxbrx/2jL4OvBIy9lnQfgjCR1gXw EtYrb9H+IeWQ5FxWQUKkcPH+uW4AU2wTclFwS/0mISiXYSYTm2gs4x36CdFghl/u/0sZ o4vog8ZhiZc3NA+vLijs/qLvf4Yah78jGKCClwdo2VzaYFuQh2BtSvB+qQ6cbbTaYGNq InSQ== X-Gm-Message-State: AOAM531G0KhAzUvXGvmIjXc2qsB/Ev7Qvpk/v87L5l9I27KQBLCxmwG0 UQ5ktbG16wILikSPaYQztwZWZc+btKU= X-Google-Smtp-Source: ABdhPJzgud532IJiPcU8ltF/ULoc+eJTQt3ZqiEM4WkIO4BMDdiOxfldq/Q1Biuo+HxpkWcn5eQKYg== X-Received: by 2002:ac2:4281:: with SMTP id m1mr4475389lfh.164.1623946339605; Thu, 17 Jun 2021 09:12:19 -0700 (PDT) Original-Received: from osv.localdomain ([89.175.180.246]) by smtp.gmail.com with ESMTPSA id p26sm291570ljn.94.2021.06.17.09.12.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jun 2021 09:12:18 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::135; envelope-from=sorganov@gmail.com; helo=mail-lf1-x135.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: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:270890 Archived-At: Hello, In this discussion: https://lists.gnu.org/archive/html/help-gnu-emacs/2021-06/msg00165.html I was pointed by Eli to `some-some-buffers-action-alist` as possible way to get the feature I've asked for (revert buffer from `same-some-buffers` prompt). I believe that this capability is really missing when `enable-recursive-minibuffers` is nil, that is now the default. This doesn't seem to have direct support for user-level customization, so I came-up with the following tweak to my init.el that "works" for me, but I'm not sure I actually do it right, so please help me with this: #+BEGIN_SRC emacs-lisp (nconc save-some-buffers-action-alist '((?\C-\M-g (lambda (buf) (with-current-buffer buf (revert-buffer))) "revert this buffer"))) #+END_SRC I'm concerned as I use `nconc` that sounds unsafe, and then original definition has some ",(" and ",(purecopy" tricks that I dunno if I need to follow, and if so, how? And to finally justify posting to 'emacs-devel', does it make sense to add this capability to the default value of `save-some-buffers-action-alist`? To give you some more context for thoughts, not only I'm often get annoyed myself by the absence of the feature, but I recently got this question: "how do I discard changes to the buffer when I run `compile` and Emacs asks me if I want to save some?" from a relatively novice Emacs user I'm trying to help, and I really hate to answer: "no way." Thanks, -- Sergey Organov