From: David Kastrup <dak@gnu.org>
To: rms@gnu.org
Cc: Alan Mackenzie <acm@muc.de>, emacs-devel@gnu.org
Subject: Re: How about text-property-functions using `equal' rather than `eq'?
Date: Tue, 05 Feb 2008 09:48:38 +0100 [thread overview]
Message-ID: <86ve53okk9.fsf@lola.quinscape.zz> (raw)
In-Reply-To: <E1JMIn0-0007ZQ-NH@fencepost.gnu.org> (Richard Stallman's message of "Tue, 05 Feb 2008 03:04:22 -0500")
Richard Stallman <rms@gnu.org> writes:
> All the built in text property functions which compare properties appear
> to use `eq' for the comparison. Some of these actually say this in
> their doc-strings or the pertinent manual page, some of them might
> actually say it in both. ;-(
>
> `eq' is faster,
More importantly, it is constant time.
> I would dearly love to use text-property-any to locate such a
> buffer position, but unfortunately (eq '(1) '(1)) => nil. :-( So
> I've had to code up a clumsy equivalent which will certainly be
> much slower.
>
> You can write code which uses the primitives to find the next non-eq
> property, then comparing it with equal and looping so that you find
> the next non-equal property.
One can also see where the constant '(1) is created and keep a copy of
that for eq-comparison.
--
David Kastrup
prev parent reply other threads:[~2008-02-05 8:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-04 20:53 How about text-property-functions using `equal' rather than `eq'? Alan Mackenzie
2008-02-05 8:04 ` Richard Stallman
2008-02-05 8:48 ` David Kastrup [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86ve53okk9.fsf@lola.quinscape.zz \
--to=dak@gnu.org \
--cc=acm@muc.de \
--cc=emacs-devel@gnu.org \
--cc=rms@gnu.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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.