emacs-devel
[Top][All Lists]
Advanced

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

Re: Please add comments to isearch.el


From: Eli Zaretskii
Subject: Re: Please add comments to isearch.el
Date: Fri, 11 Dec 2015 14:39:19 +0200

> Date: Fri, 11 Dec 2015 12:16:17 +0000
> Cc: address@hidden
> From: Alan Mackenzie <address@hidden>
> 
> > > 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.



reply via email to

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