emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why is this thing (isearch-search-fun) coded like this?


From: Artur Malabarba
Subject: Re: Why is this thing (isearch-search-fun) coded like this?
Date: Mon, 7 Dec 2015 21:32:57 +0000

2015-12-07 21:12 GMT+00:00 Alan Mackenzie <address@hidden>:
> 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]