From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Please add comments to isearch.el Date: Fri, 11 Dec 2015 14:39:19 +0200 Message-ID: <83y4d16txk.fsf@gnu.org> References: <83fuzoojcn.fsf@gnu.org> <83poyd8kta.fsf@gnu.org> <20151211121617.GA3351@acm.fritz.box> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1449837622 12202 80.91.229.3 (11 Dec 2015 12:40:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Dec 2015 12:40:22 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 11 13:40:14 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1a7Mze-0007sV-2E for ged-emacs-devel@m.gmane.org; Fri, 11 Dec 2015 13:40:14 +0100 Original-Received: from localhost ([::1]:47225 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a7Mzd-0008G8-AI for ged-emacs-devel@m.gmane.org; Fri, 11 Dec 2015 07:40:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59346) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a7Myk-0007Fr-5D for emacs-devel@gnu.org; Fri, 11 Dec 2015 07:39:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a7Myg-0000pz-Sl for emacs-devel@gnu.org; Fri, 11 Dec 2015 07:39:18 -0500 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:32810) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a7Myg-0000pu-Lo for emacs-devel@gnu.org; Fri, 11 Dec 2015 07:39:14 -0500 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0NZ7000001LCMM00@a-mtaout23.012.net.il> for emacs-devel@gnu.org; Fri, 11 Dec 2015 14:39:13 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NZ7000R91TDJY40@a-mtaout23.012.net.il>; Fri, 11 Dec 2015 14:39:13 +0200 (IST) In-reply-to: <20151211121617.GA3351@acm.fritz.box> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.175 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:196102 Archived-At: > Date: Fri, 11 Dec 2015 12:16:17 +0000 > Cc: emacs-devel@gnu.org > From: Alan Mackenzie > > > > The isearch.el commands are implemented using complex multi-layered > > > system of functions and macros that make it very hard to figure out, > > > just by looking at the code, which options affect what commands and in > > > what ways. About the only way to find that out is by trying each > > > command, which is very inefficient. I think it will help make this > > > file much more maintainable if commentary were added there explaining > > > how all of this works. Thanks in advance. > > .... perhaps you could be a little more explicit about which "complex > multi-layered system of functions and macros" you were thinking about in > particular? Was it the one I was complaining of a few days ago, or were > you thinking of the state stack (that Drew explicitly mentioned), or > something else? For example, start with isearch-mode, and then try to figure out what each one of the following variables are in what use cases: regexp-function and search-default-regexp-mode (as a function). You will see that each one can be assigned to a variable that names a function that has a default value that can be a function that... Similarly with other isearch commands. This makes the source impenetrable to uninitiated, much harder than just stepping with Edebug through the code. IMO, if it is easier to understand code by stepping through it in a debugger than by reading it, that code must be refactored or documented the heck of.