From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: Text property searching Date: Mon, 16 Apr 2018 16:16:01 +0100 Message-ID: References: <87lgdo5bb3.fsf@mouse.gnus.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a1147a6a25db0600569f8b439" X-Trace: blaine.gmane.org 1523891680 19171 195.159.176.226 (16 Apr 2018 15:14:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 16 Apr 2018 15:14:40 +0000 (UTC) Cc: emacs-devel To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 16 17:14:35 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f85py-0004sK-RG for ged-emacs-devel@m.gmane.org; Mon, 16 Apr 2018 17:14:35 +0200 Original-Received: from localhost ([::1]:52359 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f85s5-0002ff-Ba for ged-emacs-devel@m.gmane.org; Mon, 16 Apr 2018 11:16:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56494) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f85rn-0002cc-K1 for emacs-devel@gnu.org; Mon, 16 Apr 2018 11:16:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f85rj-0006LT-B8 for emacs-devel@gnu.org; Mon, 16 Apr 2018 11:16:27 -0400 Original-Received: from mail-qk0-x22b.google.com ([2607:f8b0:400d:c09::22b]:43474) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f85rj-0006Ka-65 for emacs-devel@gnu.org; Mon, 16 Apr 2018 11:16:23 -0400 Original-Received: by mail-qk0-x22b.google.com with SMTP id v2so16894027qkh.10 for ; Mon, 16 Apr 2018 08:16:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Ss0enqGlRbrZFx6vnPln9eXhK+J5nDoE1zsxY4pxcpY=; b=ZEC/TskJPS7CvfdyvIYQO6t9NS6w4AbD/3pDo5fJGEigIGLZiY4iygTEL5zNSOaW0m Yd46iAgo3q1hMJM1hOamSMTSSsjco+GSvme7Bylsj+k+XqF7VlEtBSJhUZypKN7UbYZB 51pNXMYPj1mXgj/PDOzM1EN1YOeD6mJGwNP988GQLIQmibwci6FMLkJ9rZZfSLZ008pN INVO8KTiltIcZxz84XCsjp9vrvIGWI9s8+4A14SDvG7U3qUuyZF4I5Q6Ih6vij3MkUQl oxXEUHqZu6JbVnqmr6B6Asr7cDS0BpKhYjrNqu6ODovOrvtD92HqQMmG2/DigdyDPNBW qupw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Ss0enqGlRbrZFx6vnPln9eXhK+J5nDoE1zsxY4pxcpY=; b=kYPmuqIwuan2wgoIEQ0IF9mRQXulAVqD7U+XXOd0i23MNo9FGiHpk41GsS4RapVHg+ bhEM7XrdCsBHjSc9zhF2c4aRsJa9priOX+JWxSPJNBD2hVXVEiFV9tLih1SMpBQKq9N7 lAs3g9qm59M/vUpN2vQhbuabmos+t/jwOUdp5iuQo7Gd6OLBIOt5fb6X6zDRvSXexzNK pMjlptnENysp3wN27l/7t1htY6UOagvqRsRgbbRIYHdBT7RXXKHXplQRkTik12wkjDMS uvRH4Zzq04c9gWIMmWvBCqCldkgYx2Hi4eHbYfpfd6xjrhWOsy6H011oWi+9je4khQ0L IoHw== X-Gm-Message-State: ALQs6tDCEmd3NXpOxwMa4hfyoknAKpPE6spwlDGyfOnHEVPP0Qc0OY6W NwyBVM3cpY0eSegJQh1fpPumn6CXPI1J+tubL4OXcE3o X-Google-Smtp-Source: AIpwx48Z6bVLxh8Jgmi8XqeCN1TVCsgy8o9fTYFOYlmipDPRbWKeBRyPLtViqM758zZxqPWYFlxonoy1HzIheGSlacs= X-Received: by 10.55.221.214 with SMTP id u83mr13546140qku.234.1523891782397; Mon, 16 Apr 2018 08:16:22 -0700 (PDT) Original-Received: by 10.12.148.200 with HTTP; Mon, 16 Apr 2018 08:16:01 -0700 (PDT) In-Reply-To: <87lgdo5bb3.fsf@mouse.gnus.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::22b X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:224646 Archived-At: --001a1147a6a25db0600569f8b439 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Sun, Apr 15, 2018 at 11:56 PM, Lars Ingebrigtsen wrote: > > (text-property-search-forward 'shr-url "http://fsf.org/" t) > > would place point at the end of that region, and `match-beginning' and > `match-end' would point to the start and end. > Great idea, I've wanted this badly in the past, too. Two cents: 1. What should happen if search starts in the region where the property is already set? 2. Can we generalize this to work for searches for regions where the property is set to some constant value and also for regions where the property is just present. What about "not-present"? Or do you envision this to be handled by the second and third arguments? Perhaps, in addition to the other type of value, both could also be passed a function: the second one a function of one arg, the buffer position, producing a value, and the third one a function of two values returning a boolean (this is vaguely CL's :key and :test, obviously). Bye, Jo=C3=A3o --001a1147a6a25db0600569f8b439 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

On Sun, Apr 15, 2018 at 11:56 PM, Lars Ingeb= rigtsen <larsi@gnus.org> wrote:

(text-property-search-forward 'shr-url "http://fsf.org/" t)

would place point at the end of that region, and `match-beginning' and<= br> `match-end' would point to the start and end.

=
Great idea, I've wanted this badly in the past, too. Tw= o cents:

1. What should happen if search starts in= the region where the
property is already set?

2. Can we generalize this to work for searches for regions where the=
property is set to some constant value and also for regions wher= e the
property is just present. What about "not-present"= ;? Or do you envision
this to be handled by the second and third = arguments? Perhaps, in
addition to the other type of value, both = could also be passed a
function: the second one a function of one= arg, the buffer position,
producing a value, and the third one a= function of two values
returning a boolean (this is vaguely CL&#= 39;s :key and :test, obviously).

Bye,
<= div>Jo=C3=A3o
--001a1147a6a25db0600569f8b439--