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: Artur Malabarba
Subject: Re: Please add comments to isearch.el
Date: Tue, 15 Dec 2015 10:26:49 +0000

2015-12-14 23:51 GMT+00:00 Juri Linkov <address@hidden>:
>>> Ohh, and I'd add also search-default-regexp-mode -> 
>>> search-default-regexp-function
>>> that currently causes confusion due to its similarity with 
>>> isearch-regexp-function.
>>
>> The thing is that this variable is not necessarily a function, it can be
>> nil or t too. I'd rather reserve the suffix "-function" for variables that
>> necessarily hold a function.
>
> A variable with the suffix "-function" is allowed to have a nil value,
> but not t, indeed.

Not all do. None of the font-lock-*-function variables allow a nil
value. And I'd rather push in that direction. One of the advantages of
-function variables is that you can use `add-function' on them, which
is a powerful and convenient interface. Allowing the -function
variable to have a nil value prevents the easy use of `add-function'.

> What about using a function instead of t, maybe ‘identity’?

I've mentioned here before that I'd like to obsolete `isearch-regexp'
and simply use `identity' for the regexp-function in that case.
However, the problem is that doing a regexp isearch is not exactly the
same as doing an isearch with `identity' as the regexp function.
Isearch has some special handlings for regexp input, that only kick in
if `isearch-regexp' is non-nil. If we generalize these handlings a bit
so they play nice with isearch-regexp-function, then we can obsolete
isearch-regexp.

If we go that route, then we might as well use `regexp-quote' instead
of the nil value too.



reply via email to

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