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: Re: Tweaking save-some-buffers-action-alist Date: Sat, 19 Jun 2021 15:31:44 +0300 Message-ID: <87wnqqm3wv.fsf@osv.gnss.ru> References: <87y2b879ni.fsf@osv.gnss.ru> <878s37j857.fsf@osv.gnss.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14234"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org, Daniel =?utf-8?Q?Mart=C3=ADn?= To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jun 19 14:34:21 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 1luaB3-0003WC-Co for ged-emacs-devel@m.gmane-mx.org; Sat, 19 Jun 2021 14:34:21 +0200 Original-Received: from localhost ([::1]:36426 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1luaB2-0008Ju-Ef for ged-emacs-devel@m.gmane-mx.org; Sat, 19 Jun 2021 08:34:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lua8c-0005t1-2U for emacs-devel@gnu.org; Sat, 19 Jun 2021 08:31:50 -0400 Original-Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]:36488) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lua8a-0007cW-3M for emacs-devel@gnu.org; Sat, 19 Jun 2021 08:31:49 -0400 Original-Received: by mail-lf1-x129.google.com with SMTP id d16so14077409lfn.3 for ; Sat, 19 Jun 2021 05:31:47 -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:content-transfer-encoding; bh=nI29iJC6NL7MZLwST5mNpUWeDUUCbjUbDAwXYi/2v3Q=; b=YusH2rIYq1MYMgXaXFIyKU2Q2xbf5TapPN4VVAQMpNu2q7vrlNK/rYQPQKWMdqb46u 7IWJBpDi9WPbxhm6vuQR8Ltsu0bS68sJaHtDE36ZZDxhnyDDqe2QKEQrEVAvhCLN2r9/ TmZxNxs/NZJWlCv8fp0LursxzOdHLq/XNsBMp/xjECtREEmXIoIktFR+woFtZnAzYtIV 9tOIBKe85Jl6I+Kn8+t8qLYSBmTE5Phb6fqUmGHTNoP69e8tC4zZGNJkgO7KC0cfU6nM cb2KX9AkgPz4ILfxNpxalCOKYJ7JFqZMW46OTgVDzD5n0YGdbFoozT4KzkO/kzbH+7wh JX2A== 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:content-transfer-encoding; bh=nI29iJC6NL7MZLwST5mNpUWeDUUCbjUbDAwXYi/2v3Q=; b=kJJdP3sSI+Y+KqEeCcv31I0HYLO70KKeoABD3bQG314HVnMvXAilu8E+ONvDt4WaWX HKkzhAZb+UVG+ZECkd+1AsysxsnGlu4VkDHxnaLNDLV0+IFIp30iZg+x59G9gYbFGaG8 6UxK8e93aDrf3WTzPTl15kYRkoVo1fRvxpKl+Lg/8+U8BzWsLCzQR3YMVhHuB8hPsrTT Z7baN65tlbW+6/73XU0ikF6SQrnIRBB5qR1Re2SP5Aj/0dLf9HuYNp7roxA5cudwct4U zimXjvJTX6AuiLZ4dIRjwFUFJKTNMYIAprVmEj6BVUnl5qPQwj1A/hD+Z9AXI1/OY/X+ Q5Yw== X-Gm-Message-State: AOAM530+f+NzzYD1Sjk9V4ig34bs/ztmCu/HItYmxxB+fg7ajcREiXMm PUAXcef+pr0wVOFcC2RYuZPyh9I0H0k= X-Google-Smtp-Source: ABdhPJwUzJNPJf4A9RirHKxNTWhWIhKVGmBP+CUg2fjg3i7wq+Vy17ZStlPFAK5GHpf/GkKcB1TJLA== X-Received: by 2002:ac2:4281:: with SMTP id m1mr6772240lfh.164.1624105906059; Sat, 19 Jun 2021 05:31:46 -0700 (PDT) Original-Received: from osv.localdomain ([89.175.180.246]) by smtp.gmail.com with ESMTPSA id g22sm1219191lfh.109.2021.06.19.05.31.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Jun 2021 05:31:45 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Fri, 18 Jun 2021 19:02:49 -0400") Received-SPF: pass client-ip=2a00:1450:4864:20::129; envelope-from=sorganov@gmail.com; helo=mail-lf1-x129.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:270946 Archived-At: Stefan Monnier writes: >> Is `nconc` safe here, or should I `copy-seq` the original and modify >> that instead? > > The general rule is: If you don't know, then it's not safe. > [ and indeed, it's not safe in this particular case. ] Nice, thanks for confirming! So I ended-up adding new item at the beginning of the list rather than at the end: #+BEGIN_SRC emacs-lisp (push '(?R (lambda (buf) (with-current-buffer buf (revert-buffer))) "revert this buffer") save-some-buffers-action-alist) #+END_SRC And then I had to change the KEY from C-M-g to just R, as on terminal it seems to be impossible to generate the former key-sequence from `map-y-or-n-p`, as "ESC C-g" doesn't work as expected (ESC is simply ignored), – yet another surprising limitation of the mode. Thanks, -- Sergey Organov