From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#46374: 28.0.50; Ask me to save buffers only if they are under callers dir Date: Tue, 18 May 2021 20:04:24 +0200 (CEST) Message-ID: <55fbbe0-1f9-7460-c92f-bd12fbc3da97@gmail.com> References: <878s7z4ihk.fsf@gmail.com> <87a6sdzeh6.fsf@mail.linkov.net> <87ft16g0u2.fsf@gmail.com> <87tupmisel.fsf@mail.linkov.net> <1952f2d9-51b6-a4ba-6c9e-98594222f017@gmail.com> <87r1kpemnr.fsf@mail.linkov.net> <87mtv6yloe.fsf@gmail.com> <871rcgr4qp.fsf@mail.linkov.net> <87zgz3gfqo.fsf@mail.linkov.net> <87blbhhghk.fsf@mail.linkov.net> <87pmzsgzh3.fsf@gmail.com> <87o8fc5jq0.fsf@mail.linkov.net> <87wnsz7jmy.fsf@gmail.com> <87tunvnxfo.fsf@linkov.net> <87h7jq1a0i.fsf@gmail.com> <83o8dxe9hw.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="0-1086110462-1621361064=:25652" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27418"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 46374@debbugs.gnu.org, Tino Calancha , uyennhi.qm@gmail.com, monnier@iro.umontreal.ca, juri@linkov.net To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 18 20:05:32 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 1lj460-0006xf-Hv for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 May 2021 20:05:32 +0200 Original-Received: from localhost ([::1]:43918 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lj45z-0006Xt-I6 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 May 2021 14:05:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43220) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lj45X-0006WH-Hl for bug-gnu-emacs@gnu.org; Tue, 18 May 2021 14:05:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45700) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lj45W-0007Hv-Jx for bug-gnu-emacs@gnu.org; Tue, 18 May 2021 14:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lj45W-0000vn-Fh for bug-gnu-emacs@gnu.org; Tue, 18 May 2021 14:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 May 2021 18:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46374 X-GNU-PR-Package: emacs Original-Received: via spool by 46374-submit@debbugs.gnu.org id=B46374.16213610733542 (code B ref 46374); Tue, 18 May 2021 18:05:02 +0000 Original-Received: (at 46374) by debbugs.gnu.org; 18 May 2021 18:04:33 +0000 Original-Received: from localhost ([127.0.0.1]:57246 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lj453-0000v4-5l for submit@debbugs.gnu.org; Tue, 18 May 2021 14:04:33 -0400 Original-Received: from mail-wr1-f47.google.com ([209.85.221.47]:44648) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lj451-0000un-AE for 46374@debbugs.gnu.org; Tue, 18 May 2021 14:04:31 -0400 Original-Received: by mail-wr1-f47.google.com with SMTP id i17so11200830wrq.11 for <46374@debbugs.gnu.org>; Tue, 18 May 2021 11:04:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:in-reply-to:message-id:references :mime-version; bh=zTkvHwB2UBXpEQbRzL1oqtV94tM/12ieZQve9rhyVBc=; b=drAh/yhEVJ3bjol/1fak/hrcEsYj9PadHwVANSx4iiC7GW94GGRasXdQZvA3YJu5jo Ml5OS91FtuVLrTxJcyDRcYq5sXuuq47AxczOwgO27Vk4g+KlhjMdKB1m5piGoed13JlJ VqFJE08X/nPXmI/daerJ7pftyVec5q6j9FzRt1b4mdrXHC1hXSndl2tt6NCrkJW+RPva rzVs6ikEioYCI2Lp5f0c1v0OtcxdHFvOTJgFLGXWGaDRrFBAHKIaudVknbg/BjxhPQ9U 7kPz6SxcevQYazQroLcUMkYajlZOQpDCYK1C+f2F6NadoXC3oD9DMuEcD5uS9YeGfi+3 1lGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:mime-version; bh=zTkvHwB2UBXpEQbRzL1oqtV94tM/12ieZQve9rhyVBc=; b=CvpBjLm8KgjnOBtdrOtKg9bv2CCbvcMscBcvd4ZznSotq85V4VAYSFGGCiI/5VTCtH 06wac4lDjupn5YY2zg76Ss5rycD2/q4VRwqwXotWwE6rEEHhwsil/3fQaAdh29i4BlII 30nRKpaQIby+FpQTCe48b8mwreSxhY6C2mEJgMPKVb76pNr6877Ieq6Rc89X/xI09QMO tkgWsYZRFBLZKEMI4k91O26aZPpR+9ThCuhOFbvREpT7j/svsD9xAxlZjDLisaYP6hKF ep8j1SaLclXW1JkSm7b1VAO2FCN2NRdmizjw86UG/O6Ma+/VXIFQXHyhyXXg0WlPMMbv tguw== X-Gm-Message-State: AOAM5338TYluRS/IC5s/gVUtnlQKrlM0N0JFK552UmS3SB6lBoyQvFOb wNpBEZieBznIcLVv14+cwsU= X-Google-Smtp-Source: ABdhPJwMe3UJkSIWXMB1YW3CMlmFkrBRkbpg9w0WqaHL3jgF7o5A4xegnmBd8dNnH/Usd7RUryv1vQ== X-Received: by 2002:a5d:448b:: with SMTP id j11mr8508191wrq.93.1621361065471; Tue, 18 May 2021 11:04:25 -0700 (PDT) Original-Received: from [10.200.2.6] ([31.7.242.222]) by smtp.gmail.com with ESMTPSA id o11sm8192875wrq.93.2021.05.18.11.04.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 May 2021 11:04:24 -0700 (PDT) X-Google-Original-From: Tino Calancha In-Reply-To: <83o8dxe9hw.fsf@gnu.org> 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:206826 Archived-At: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-1086110462-1621361064=:25652 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT On Thu, 29 Apr 2021, Eli Zaretskii wrote: >> From: Tino Calancha >> Date: Wed, 28 Apr 2021 21:31:25 +0200 >> Cc: 46374@debbugs.gnu.org, Stefan Monnier , >> Quách Mỹ Uyên Nhi >> >> >> Juri Linkov writes: >> >> +(defcustom save-some-buffers-default-predicate save-some-buffers-default-fun >> + "Generator function of the default predicate for `save-some-buffers'. >> + >> +It must be a function with no arguments that returns a predicate. >> +This predicate is called (with no parameters) from the buffer to be >> +saved. > > Reading this, I'm confused: a function that returns a predicate? If > this is literally so, why do we need this two-step approach? why not > have the value _be_ a predicate function? The point of this two-step approach is to get access to the caller environment: - We have a function, generate-foo, that builds a predicate foo. - By calling generate-foo inside same-some-buffers, we build a foo with access to the enviroment, i.e. foo is a closure. That makes the trick to restrict the prompt to saving buffers only inside the current project. --0-1086110462-1621361064=:25652--