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 18:12:48 +0200 Message-ID: <834m0jyxhb.fsf@gnu.org> References: <83mvebzh0k.fsf@gnu.org> <83bmurz0y9.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1485620006 18048 195.159.176.226 (28 Jan 2017 16:13:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 28 Jan 2017 16:13:26 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 28 17:13:22 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 1cXVck-0003Jk-0Q for ged-emacs-devel@m.gmane.org; Sat, 28 Jan 2017 17:13:10 +0100 Original-Received: from localhost ([::1]:52350 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cXVcp-0003QF-Bi for ged-emacs-devel@m.gmane.org; Sat, 28 Jan 2017 11:13:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40133) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cXVci-0003PO-DX for emacs-devel@gnu.org; Sat, 28 Jan 2017 11:13:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cXVcd-00078A-Aq for emacs-devel@gnu.org; Sat, 28 Jan 2017 11:13:08 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38170) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cXVcd-000786-82; Sat, 28 Jan 2017 11:13:03 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2072 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cXVcb-0003zM-3b; Sat, 28 Jan 2017 11:13:02 -0500 In-reply-to: (message from Dmitry Gutov on Sat, 28 Jan 2017 18:31:29 +0300) 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:211701 Archived-At: > Cc: emacs-devel@gnu.org > From: Dmitry Gutov > Date: Sat, 28 Jan 2017 18:31:29 +0300 > > On 28.01.2017 17:57, Eli Zaretskii wrote: > > > 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. > > It's just one more level of indirection. We routinely deal with dozens > of them. Each one is an additional annoyance, making maintenance harder. Given enough levels of indirection, it is practically impossible to understand what the code does just by looking at the source; you need to actually step through it in a debugger. And that makes maintenance a PITA, and in some cases might cause me to give up on a problem in despair. > This above rule should just be adhered consistently, and the > indirection won't be a surprise every time. There's no surprise here, only the annoying need to wade through indirection levels. > On the plus side, you might get a smaller function that calls the > -default one, because some code will be extracted. That's only a plus when you need to write that code, not when you need to understand or debug it. > Finally, the default value of save-some-buffers-default-predicate can be > #'ignore or #'identity (it's either this, or the previous paragraph, I'm > not familiar with the code enough to be sure). For predicates that need to return nil or t, the default value might be ridiculous, if it has to be wrapped in a function. > > 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. > > isearch.el and etags.el have more egregious problems, such as extensive > use of dynamic bindings. Yes, and using indirection doesn't help there.