From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Change in files.el Date: Sat, 28 Jan 2017 16:57:50 +0200 Message-ID: <83bmurz0y9.fsf@gnu.org> References: <83mvebzh0k.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1485615497 30557 195.159.176.226 (28 Jan 2017 14:58:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 28 Jan 2017 14:58:17 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 28 15:58:13 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 1cXUS6-0006zJ-Bu for ged-emacs-devel@m.gmane.org; Sat, 28 Jan 2017 15:58:06 +0100 Original-Received: from localhost ([::1]:52140 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cXUSB-0002WM-Oi for ged-emacs-devel@m.gmane.org; Sat, 28 Jan 2017 09:58:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58010) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cXUS6-0002WF-C6 for emacs-devel@gnu.org; Sat, 28 Jan 2017 09:58:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cXUS3-0001we-AP for emacs-devel@gnu.org; Sat, 28 Jan 2017 09:58:06 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37610) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cXUS3-0001wa-7D; Sat, 28 Jan 2017 09:58:03 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2002 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cXUS2-0007iJ-08; Sat, 28 Jan 2017 09:58:02 -0500 In-reply-to: (message from Stefan Monnier on Sat, 28 Jan 2017 09:40:11 -0500) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:211695 Archived-At: > From: Stefan Monnier > Cc: emacs-devel@gnu.org > Date: Sat, 28 Jan 2017 09:40:11 -0500 > > >> 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). These sound minor to me (and the last two are also possible without the requirement, AFAIU). By contrast, insisting on a function value instead of the default nil forces me to go through at least one more level of indirection when I need to understand what happens in a function that references such variables, which sounds like a more serious trouble from my POV. I was up to my neck in this when I needed to document all the various optional behaviors implemented in isearch.el, and bumped into similar issues several times elsewhere. So IME following that rule is a net loss.