[Top][All Lists]

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

Re: Text property searching

From: Alan Mackenzie
Subject: Re: Text property searching
Date: Tue, 17 Apr 2018 19:10:24 +0000
User-agent: Mutt/1.9.4 (2018-02-28)

Hello, Lars.

On Mon, Apr 16, 2018 at 22:40:56 +0200, Lars Ingebrigtsen wrote:
> I've done some testing.

> (progn
>   (insert "foo bar zot")
>   (put-text-property 2 3 'face nil)
>   (put-text-property 5 6 'face 'bold)
>   (goto-char (point-min))
>   (goto-char (next-single-property-change (point) 'face)))

> This goes to 5, not to 2, so `next-single-property-change' doesn't seem
> to consider a nil value to be different from a missing value, either.

> So I think it might make sense to just leave that complication out of
> this function, because it's rather obscure (categories and stuff that
> sounds way too complicate :-)).

"Stuff like that" is part of Emacs.  Please take care that the new
functions handle category properties correctly (for whatever value of
"correctly" is appropriate).  If the functions are written in Lisp, this
will probably happen automatically (but needs to be checked).  If
they're written in C, category properties will need to be handled

If you fail to do this, people will curse you.  The functions, instead
of being correct, will merely be functions which sort-of work most of
the time.  And the correct advice given to hackers wishing to write
correct programs would be to avoid the new functions altogether and use
the currently existing text property searching functions instead.  The
amount of effort required to document the deficiencies of the new and
other functions in the Elisp manual would be non-trivial.

Please do this properly.

> -- 
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no

Alan Mackenzie (Nuremberg, Germany).

reply via email to

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