From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#10387: CODE wishlist: search-prop.el Date: Fri, 13 Apr 2012 09:03:42 -0400 Message-ID: References: <87wr9h2kju.fsf@cante.cante.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1334322304 14976 80.91.229.3 (13 Apr 2012 13:05:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 13 Apr 2012 13:05:04 +0000 (UTC) Cc: Lars Magne Ingebrigtsen , 10387@debbugs.gnu.org, Jari Aalto To: Michael Olson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Apr 13 15:05:02 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SIgBO-0000Wy-Vu for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Apr 2012 15:04:59 +0200 Original-Received: from localhost ([::1]:37538 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SIgBO-0008OT-Au for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Apr 2012 09:04:58 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39273) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SIgBC-0008MU-Q9 for bug-gnu-emacs@gnu.org; Fri, 13 Apr 2012 09:04:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SIgBA-0004cH-RD for bug-gnu-emacs@gnu.org; Fri, 13 Apr 2012 09:04:46 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59796) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SIgBA-0004cC-OI for bug-gnu-emacs@gnu.org; Fri, 13 Apr 2012 09:04:44 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SIgCQ-0007Qr-A4 for bug-gnu-emacs@gnu.org; Fri, 13 Apr 2012 09:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Apr 2012 13:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10387 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 10387-submit@debbugs.gnu.org id=B10387.133432230428505 (code B ref 10387); Fri, 13 Apr 2012 13:06:02 +0000 Original-Received: (at 10387) by debbugs.gnu.org; 13 Apr 2012 13:05:04 +0000 Original-Received: from localhost ([127.0.0.1]:56334 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SIgBU-0007Ph-7I for submit@debbugs.gnu.org; Fri, 13 Apr 2012 09:05:04 -0400 Original-Received: from ironport-out.teksavvy.com ([206.248.143.162]:37364) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SIgBR-0007Pa-W7 for 10387@debbugs.gnu.org; Fri, 13 Apr 2012 09:05:02 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApYIACxOgk9sr+di/2dsb2JhbABDuCMDgQyBCIIJAQEEAVYjEAsOJhIUGA0kiBwFtjKLYYR5BKRFgV2DAw X-IronPort-AV: E=Sophos;i="4.75,391,1330923600"; d="scan'208";a="174055477" Original-Received: from 108-175-231-98.dsl.teksavvy.com (HELO pastel.home) ([108.175.231.98]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 13 Apr 2012 09:03:42 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id A316F5809E; Fri, 13 Apr 2012 09:03:42 -0400 (EDT) In-Reply-To: (Michael Olson's message of "Thu, 12 Apr 2012 20:29:13 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:58987 Archived-At: >> > 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