From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Change in files.el Date: Sat, 28 Jan 2017 09:40:11 -0500 Message-ID: References: <83mvebzh0k.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1485614470 30001 195.159.176.226 (28 Jan 2017 14:41:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 28 Jan 2017 14:41:10 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 28 15:41:06 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXUBQ-0006K8-7Q for ged-emacs-devel@m.gmane.org; Sat, 28 Jan 2017 15:40:52 +0100 Original-Received: from localhost ([::1]:52089 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cXUBU-0003HY-1r for ged-emacs-devel@m.gmane.org; Sat, 28 Jan 2017 09:40:56 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56012) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cXUAs-0003HT-Tj for emacs-devel@gnu.org; Sat, 28 Jan 2017 09:40:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cXUAs-0006T7-4T for emacs-devel@gnu.org; Sat, 28 Jan 2017 09:40:18 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:58046) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cXUAo-0006SU-97; Sat, 28 Jan 2017 09:40:14 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0B6PAAu3EVY/0gvq8BdGwEBAQMBAQEJAQEBgzgBAQEBAR+EW4VUnCgBll4ZhgMEAgKCEUQQAQIBAQEBAQEBYihCEgGEFAZWIxALNBIUGA0kiQKtFItEAQEIAiWLGYoLHgWPfIpqkwmEfYMUhjqSDzYgeBMOhXMghjGCfAEBAQ X-IPAS-Result: A0B6PAAu3EVY/0gvq8BdGwEBAQMBAQEJAQEBgzgBAQEBAR+EW4VUnCgBll4ZhgMEAgKCEUQQAQIBAQEBAQEBYihCEgGEFAZWIxALNBIUGA0kiQKtFItEAQEIAiWLGYoLHgWPfIpqkwmEfYMUhjqSDzYgeBMOhXMghjGCfAEBAQ X-IronPort-AV: E=Sophos;i="5.33,749,1477972800"; d="scan'208";a="290637784" Original-Received: from 192-171-47-72.cpe.pppoe.ca (HELO pastel.home) ([192.171.47.72]) by smtp.teksavvy.com with ESMTP; 28 Jan 2017 09:40:12 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 6DA1264EAB; Sat, 28 Jan 2017 09:40:11 -0500 (EST) In-Reply-To: <83mvebzh0k.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 28 Jan 2017 11:10:51 +0200") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:211694 Archived-At: >> > +(defcustom save-some-buffers-default-predicate nil >> > + "Default predicate for `save-some-buffers'. >> > +This allows you to stop `save-some-buffers' from asking >> > +about certain files that you'd usually rather not save." >> Please make it so that the var *always* has a function value. > Why is that important? - So that you don't have to wrap each and every use inside an `if'. - Or so you don't have to fix the docstring to say what happens when the value is nil. - Or so you can use `add-function' on it. - More generally, so that you can slightly change its behavior without having to re-implement the default behavior by hand. - Also, so as to make sure that it is *possible* to reimplement the default behavior by hand (i.e. to make sure the predicate has access to all the info it needs to reproduce the default behavior). This is a rule we should try to follow for all *-function and *-predicate variables (as well as similar cases, such as process-filters and sentinels). Stefan