From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Newsgroups: gmane.emacs.bugs Subject: bug#25592: Feature request: sorting overlays Date: Fri, 3 Feb 2017 16:51:24 -0500 Message-ID: <1d90ade3-b0a4-f07a-d424-b052a68fd4a7@live.com> References: <837f5avzdm.fsf@gnu.org> <75813a2b-ba63-e356-d766-cd9ae77b28e2@live.com> <83mve4uxwr.fsf@gnu.org> <83tw8bt1mh.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Ej48am4KTvrb9dSu9jdwFotw27dtt00w1" X-Trace: blaine.gmane.org 1486158733 16375 195.159.176.226 (3 Feb 2017 21:52:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 3 Feb 2017 21:52:13 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 Cc: 25592@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 03 22:52:07 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1cZlm2-0003wv-Dj for geb-bug-gnu-emacs@m.gmane.org; Fri, 03 Feb 2017 22:52:06 +0100 Original-Received: from localhost ([::1]:37020 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZlm7-0001ul-OB for geb-bug-gnu-emacs@m.gmane.org; Fri, 03 Feb 2017 16:52:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35626) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZlm1-0001ud-NX for bug-gnu-emacs@gnu.org; Fri, 03 Feb 2017 16:52:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cZlly-0002bQ-IX for bug-gnu-emacs@gnu.org; Fri, 03 Feb 2017 16:52:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57211) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cZlly-0002bM-F9 for bug-gnu-emacs@gnu.org; Fri, 03 Feb 2017 16:52:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cZlly-0003b1-4C for bug-gnu-emacs@gnu.org; Fri, 03 Feb 2017 16:52:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 Feb 2017 21:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25592 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25592-submit@debbugs.gnu.org id=B25592.148615870413800 (code B ref 25592); Fri, 03 Feb 2017 21:52:02 +0000 Original-Received: (at 25592) by debbugs.gnu.org; 3 Feb 2017 21:51:44 +0000 Original-Received: from localhost ([127.0.0.1]:55410 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cZllg-0003aW-CS for submit@debbugs.gnu.org; Fri, 03 Feb 2017 16:51:44 -0500 Original-Received: from mout.kundenserver.de ([212.227.126.134]:49517) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cZlld-0003aH-L1 for 25592@debbugs.gnu.org; Fri, 03 Feb 2017 16:51:42 -0500 Original-Received: from [18.26.2.123] ([18.26.2.123]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.168]) with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Apj1rQKa6L ytRZARfOtnoeQ0waoRCuoXbeAsGNR/kghE7RYyuxV0ndcFub3Ujl3D2gYbUaSSk6R9Q8= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:128930 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Ej48am4KTvrb9dSu9jdwFotw27dtt00w1 Content-Type: multipart/mixed; boundary="4lAd3oOVSBEuPiEFS4QgDg7Lo2i04FeRX"; protected-headers="v1" From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= To: Eli Zaretskii Cc: 25592@debbugs.gnu.org Message-ID: <1d90ade3-b0a4-f07a-d424-b052a68fd4a7@live.com> Subject: Re: bug#25592: Feature request: sorting overlays References: <837f5avzdm.fsf@gnu.org> <75813a2b-ba63-e356-d766-cd9ae77b28e2@live.com> <83mve4uxwr.fsf@gnu.org> <83tw8bt1mh.fsf@gnu.org> In-Reply-To: <83tw8bt1mh.fsf@gnu.org> --4lAd3oOVSBEuPiEFS4QgDg7Lo2i04FeRX Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2017-02-03 16:17, Eli Zaretskii wrote: >> Cc: 25592@debbugs.gnu.org >> From: Cl=C3=A9ment Pit--Claudel >> Date: Fri, 3 Feb 2017 10:19:15 -0500 >> >>>> I'm writing a function that copies overlay properties to text proper= ties. >>> >>> That function probably converts overlays by traversing buffer >>> positions from beginning to end, no? Then overlays-at should be what= >>> you need, and next-overlay-change is your friend to move to the next >>> "interesting" position when you are done with this one. >>> >>> Isn't that what you are doing? >> >> No: I'm iterating over all overlays, and applying them one by one. >=20 > Why not do it as I suggest? Then your problems with sorting will be > solved as a nice side-effect. I'm worried about the cost and the additional implementation complexity. = My current algorithm is very simple: iterate over overlays, applying the= ir properties to the ranges they cover. In contrast, scanning over overl= ays introduces additional complexity (I need to keep track of which overl= ays I have already applied and move around the buffer), and additional co= sts (next-overlay-change seems to do quite a bit of work). None of this is a show stopper (in fact, I don't even know for sure that = the slowdown would be significant, and I do know that I don't expect to h= ave that many overlays anyway :), but it'd be nice to be able to use the = "simpler" solution. >>>> I reimplemented compare_overlays in ELisp, but that seems brittle. >>> >>> How did you implement in Lisp the "last resort" of comparison, which >>> compares addresses of the C structs? >> >> I didn't :) >=20 > So it isn't really a solution ;-) It's not a full reimplementation, but it's enough of a solution for me :)= The docs say =E2=80=9CIf SORTED is non-=E2=80=98nil=E2=80=99, the list i= s in decreasing order of priority=E2=80=9D, and that's what my implementa= tion does. Cheers, Cl=C3=A9ment. --4lAd3oOVSBEuPiEFS4QgDg7Lo2i04FeRX-- --Ej48am4KTvrb9dSu9jdwFotw27dtt00w1 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYlPtcAAoJEPqg+cTm90wjfqgQAKEhZerHukBX4IA3iYhpfKKb 82fUoBdmpRMK6B3S6FFDOhGJwYXfG0fjKM8rMr0ZNNuWG0aq7wAIx6xULgAQ4s5p c4rNAZit0e9Rze0M4oR1I4t+Y04l5zwoIMTc059bj5jyJiwRYTpcV4smhJidRg60 H3E6M3Mc0iKdt4kVassgpL1drt8Liu7q6XDARS2dWz1aRd49B9zxJvBGCECLTvKy tA9mmaVHiVKWedaLIrQlP+M0bOTBVPYU+4rBX0HS1WD3SGJizaG4V2Vvc1iqQ6Wp VpbnqltFOdi+NDOmwefD4lwUGdoKb0yL2+bOUjqzBihZGeBAihRNEftKyJrD1A++ 0o7Tz7QRiaNivMr9u22pHMqAPE85YrzFyA+SUfutzveYLXj2lw90l4933u5IqbG3 aLXtm4ASclSETyQVEDoGjSDlW0NsZr2D/la1vATIucZJmjvpmNl/WcheJZ+WzwD9 /q7xK0DtTyt+I+P1ne7Que1zcWQv+C3rqarOMtUJ8NVQPOfp+jsnyvHWxr/8/WPt iH6MMXWZgw5Eu0M8HnQWNYweT0ptvVNS3MH9fdaTW/MeQ8fDbZ0wPBvGIGYmfpMj 7VprtmeKuVDI4GtcHgHvQws1oQTFJHr65VCMvYPzTuCbnR9bAjGclmFWJVbG4AQD caNQecJNAj4owmzaMvzN =S1vS -----END PGP SIGNATURE----- --Ej48am4KTvrb9dSu9jdwFotw27dtt00w1--