From: Alan Mackenzie <acm@muc.de>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: "João Távora" <joaotavora@gmail.com>, emacs-devel <emacs-devel@gnu.org>
Subject: Re: Text property searching
Date: Tue, 17 Apr 2018 19:10:24 +0000 [thread overview]
Message-ID: <20180417191024.GA4739@ACM> (raw)
In-Reply-To: <87604qx4tj.fsf@mouse.gnus.org>
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
explicitly.
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).
next prev parent reply other threads:[~2018-04-17 19:10 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-15 22:56 Text property searching Lars Ingebrigtsen
2018-04-16 0:00 ` T.V Raman
2018-04-16 4:40 ` Dmitry Gutov
2018-04-16 12:01 ` Lars Ingebrigtsen
2018-04-16 13:04 ` Dmitry Gutov
2018-04-16 15:11 ` Lars Ingebrigtsen
2018-04-16 18:06 ` Eli Zaretskii
2018-04-16 18:30 ` Lars Ingebrigtsen
2018-04-16 14:30 ` Drew Adams
2018-04-16 17:52 ` Eli Zaretskii
2018-04-16 18:31 ` Lars Ingebrigtsen
2018-04-16 15:16 ` João Távora
2018-04-16 16:09 ` Lars Ingebrigtsen
[not found] ` <CALDnm52qb5jfjC181pS+UTwfFES95m=EYtyXJzya7pdBMz8rxA@mail.gmail.com>
[not found] ` <87d0yz15a3.fsf@mouse.gnus.org>
2018-04-16 16:54 ` João Távora
2018-04-16 16:57 ` Lars Ingebrigtsen
2018-04-16 17:30 ` João Távora
2018-04-16 17:35 ` Lars Ingebrigtsen
2018-04-16 18:26 ` Lars Ingebrigtsen
2018-04-16 18:52 ` Eli Zaretskii
2018-04-16 19:01 ` Lars Ingebrigtsen
2018-04-16 19:48 ` Eli Zaretskii
2018-04-16 19:53 ` Lars Ingebrigtsen
2018-04-16 19:59 ` Eli Zaretskii
2018-04-16 21:56 ` Clément Pit-Claudel
2018-04-16 21:58 ` Lars Ingebrigtsen
2018-04-16 22:06 ` João Távora
2018-04-16 22:21 ` Clément Pit-Claudel
2018-04-16 19:02 ` Lars Ingebrigtsen
2018-04-16 19:50 ` Eli Zaretskii
2018-04-16 19:56 ` Lars Ingebrigtsen
2018-04-16 20:05 ` Drew Adams
2018-04-16 20:11 ` Lars Ingebrigtsen
2018-04-16 20:40 ` Lars Ingebrigtsen
2018-04-16 20:48 ` Stefan Monnier
2018-04-16 21:17 ` João Távora
2018-04-16 21:21 ` Lars Ingebrigtsen
[not found] ` <CALDnm51Hgs6b_Q=A0mZ=UMnOeOUX2fGE+dTf2JP4HOMF11-z8A@mail.gmail.com>
2018-04-16 21:32 ` Lars Ingebrigtsen
2018-04-17 19:10 ` Alan Mackenzie [this message]
2018-04-17 19:16 ` Lars Ingebrigtsen
2018-04-17 20:31 ` Alan Mackenzie
2018-04-17 20:42 ` Lars Ingebrigtsen
2018-04-16 19:40 ` Alan Mackenzie
2018-04-16 19:49 ` Lars Ingebrigtsen
2018-04-16 20:07 ` Alan Mackenzie
2018-04-16 20:31 ` Lars Ingebrigtsen
2018-04-16 21:18 ` Lars Ingebrigtsen
2018-04-16 21:28 ` João Távora
2018-04-16 22:09 ` Lars Ingebrigtsen
2018-04-17 13:01 ` Stefan Monnier
2018-04-17 13:04 ` Lars Ingebrigtsen
2018-04-16 16:59 ` Lars Ingebrigtsen
2018-04-16 18:03 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180417191024.GA4739@ACM \
--to=acm@muc.de \
--cc=emacs-devel@gnu.org \
--cc=joaotavora@gmail.com \
--cc=larsi@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).