unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Michael Olson <mwolson@gnu.org>
Cc: Lars Magne Ingebrigtsen <larsi@gnus.org>,
	10387@debbugs.gnu.org, Jari Aalto <jari.aalto@cante.net>
Subject: bug#10387: CODE wishlist: search-prop.el
Date: Fri, 13 Apr 2012 09:03:42 -0400	[thread overview]
Message-ID: <jwvehrr6bg4.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <CAN4ruPi5ZJphKpgOw=Y1qJ3GMsi7dehKpBm4tSia=x7PJYfajQ@mail.gmail.com> (Michael Olson's message of "Thu, 12 Apr 2012 20:29:13 -0700")

>> > I like this.  Gnus uses text properties extensively, and searching for
>> > them using the standard functions (`next-property-change' and friends)
>> > is a hassle.
>> > `search-property' looks like what I have needed in the past.
>> text-property-any (and t-p-not-all) seems to do the same, except it only
>> searches forward.  Is there some other difference I'm missing (other
>> than the `cycle' which doesn't seem tremendously useful)?
> Differences compared to text-property-any:
>  - Includes helper functions 'search-property-forward' and
>   'search-property-backward' which move point and closely match the
>   interface and behavior of 'search-forward' and 'search-backward'.
>   (Except for 'count'.)  The interactive use is nice: when you need
>   it, you really need it.

I can't remember needing such a thing, but maybe it's just because it
didn't occur to me.

>  - I don't remember what the original use case was for 'cycle'.  Possibly
>    to emulate the effect of hitting TAB in Emacs Muse to go to the next URL
>    (behavior that I would remove if I was starting again from scratch).

I guess the cycle makes sense for interactive use, tho it can be
implemented on top of a non-cycling primitive.

So all in all, I think the main points are:
- search backward.
- UI.
- names with "search" and with direction.
I actually like it, so I suggest to provide new functions
(search-text-property-forward START END PROP VALUE &optional OBJECT NOT-EQ)
and search-text-property-backward, implemented in C and then reimplement
text-property-any and text-property-not-all in Elisp on top of them (and
make them obsolete).


        Stefan





  reply	other threads:[~2012-04-13 13:03 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-28  7:59 bug#10387: CODE wishlist: search-prop.el Jari Aalto
2012-04-12 20:07 ` Lars Magne Ingebrigtsen
2012-04-12 21:55   ` Stefan Monnier
2012-04-13  3:29     ` Michael Olson
2012-04-13 13:03       ` Stefan Monnier [this message]
2016-02-25  6:29         ` Lars Ingebrigtsen
2016-02-25 14:55           ` Drew Adams
2019-06-27 15:47   ` Lars Ingebrigtsen
2013-11-23 17:35 ` Drew Adams
2013-11-23 23:34   ` Juri Linkov
2013-11-24  0:00     ` Drew Adams
2013-11-24  1:01       ` Andreas Schwab
2013-11-24  1:07         ` Drew Adams
2013-11-24 11:36           ` Andreas Schwab
2013-11-24 16:51             ` Drew Adams
2013-11-24 17:04               ` Eli Zaretskii
2013-11-25  3:20                 ` Stefan Monnier
2013-11-25  9:55                   ` Andreas Schwab
2013-11-24 17:17               ` Andreas Schwab
2013-11-24 16:43           ` Stefan Monnier
2013-11-24 16:54             ` Drew Adams
2013-11-24 17:06               ` Eli Zaretskii
     [not found] <<87wr9h2kju.fsf@cante.cante.net>
     [not found] ` <<4e9dd7b9-9109-4f67-a9a2-d3c13635c566@default>
     [not found]   ` <<87eh664rrr.fsf@mail.jurta.org>
     [not found]     ` <<c05a5e24-a7be-4a23-9698-814b611e46e0@default>
     [not found]       ` <<878uwe62ae.fsf@igel.home>
     [not found]         ` <<7b510b39-00e7-49f6-a1ee-114652fd701c@default>
     [not found]           ` <<jwvfvqlwy23.fsf-monnier+emacsbugs@gnu.org>
     [not found]             ` <<dee893b9-9538-46ce-9c8e-18468026da14@default>
     [not found]               ` <<83vbzhbugs.fsf@gnu.org>
2013-11-24 17:49                 ` Drew Adams

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=jwvehrr6bg4.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=10387@debbugs.gnu.org \
    --cc=jari.aalto@cante.net \
    --cc=larsi@gnus.org \
    --cc=mwolson@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 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).