From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Artur Malabarba Newsgroups: gmane.emacs.devel Subject: Re: Why is this thing (isearch-search-fun) coded like this? Date: Mon, 7 Dec 2015 21:32:57 +0000 Message-ID: References: <20151207211212.GE1904@acm.fritz.box> Reply-To: bruce.connor.am@gmail.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1449523986 19955 80.91.229.3 (7 Dec 2015 21:33:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Dec 2015 21:33:06 +0000 (UTC) Cc: emacs-devel To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 07 22:33:06 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 1a63P5-0007gO-BY for ged-emacs-devel@m.gmane.org; Mon, 07 Dec 2015 22:33:03 +0100 Original-Received: from localhost ([::1]:56578 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a63P4-0000fu-J5 for ged-emacs-devel@m.gmane.org; Mon, 07 Dec 2015 16:33:02 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52359) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a63P1-0000fX-8P for emacs-devel@gnu.org; Mon, 07 Dec 2015 16:33:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a63P0-0002Zo-Df for emacs-devel@gnu.org; Mon, 07 Dec 2015 16:32:59 -0500 Original-Received: from mail-lb0-x22a.google.com ([2a00:1450:4010:c04::22a]:33359) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a63P0-0002Za-5U for emacs-devel@gnu.org; Mon, 07 Dec 2015 16:32:58 -0500 Original-Received: by lbbkw15 with SMTP id kw15so223847lbb.0 for ; Mon, 07 Dec 2015 13:32:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=PyLoZZlGflOWwZgBQ7aOZ30zAnk8tsIsj/mNr5+Xotk=; b=raXja9b/674ffgWFRTdk12/GM/V5DT6CCGXpPQJdf9dnNbkUBhb23MmaLaJyqo0Vn/ kpYQH7RpFighhN/TIC7yxzml+s47LaLLYy4rBNBzbbhxeHzFaGGNmcvC/1pVn4orVER2 ukueWYCmTeCOkE2LXsZNzh78+C2HSUQIcxjyA4bGRc8/48zi9TuPGvYzaB1Hby068zAh GUxBXkp24oxMu5jlWOA2eNnwXYp5yZmjryBIgzN2ffhVWRSaVkvJ8954T1RAeIPXZpW9 CIlr/Be8vDVbYiESR5WkGTtkBzerriP7N+SXXiLWQUpt+iopmXYZQmyQhQtMcVe1Z5AU 3kig== X-Received: by 10.112.170.7 with SMTP id ai7mr14973448lbc.102.1449523977430; Mon, 07 Dec 2015 13:32:57 -0800 (PST) Original-Received: by 10.112.202.99 with HTTP; Mon, 7 Dec 2015 13:32:57 -0800 (PST) In-Reply-To: <20151207211212.GE1904@acm.fritz.box> X-Google-Sender-Auth: 7woD6ka82qA4bdf2uKLNAlk5JK4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c04::22a 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:195974 Archived-At: 2015-12-07 21:12 GMT+00:00 Alan Mackenzie : > CONSTANT LAMBDA FORMS ARE NOT EASY TO INSTRUMENT FOR EDEBUG!!!! I know there's an extra layer of indirection, but I've always been able to edebug it just fine. > As an alternative, isearch-search-fun-default could simply return a > named function. Even better, such a named function could simply be, and > be returned directly from `isearch-search-fun' without all the > superfluous funcalling. > > Or am I missing something here? IIRC, isearch-search-fun-default didn't use to return a constant lambda. Instead, it used to return a different lambda depending on some parameters. We reached the current state as a result of some recent refactorings. I agree it would be good to remove this layer of indirection. > I'm tempted to rip out a lot of this stuff from Isearch to be able to > debug it. Will I regret it if I do? You won't regret it if you do it right: 1. Define a function for that lambda. 2. Set the default value of isearch-search-fun to be this function's name. 3. Make isearch-search-fun-default return the function's name, and mark it obsolete.