From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Overlay mechanic improvements Date: Fri, 19 Sep 2014 14:03:52 -0400 Message-ID: References: Reply-To: rms@gnu.org NNTP-Posting-Host: plane.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: ger.gmane.org 1411149850 31392 80.91.229.3 (19 Sep 2014 18:04:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 19 Sep 2014 18:04:10 +0000 (UTC) Cc: emacs-devel@gnu.org To: Vladimir Kazanov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 19 20:04:05 2014 Return-path: Envelope-to: ged-emacs-devel@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 1XV2XN-0004NI-DU for ged-emacs-devel@m.gmane.org; Fri, 19 Sep 2014 20:04:05 +0200 Original-Received: from localhost ([::1]:59774 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XV2XM-0007A6-Vf for ged-emacs-devel@m.gmane.org; Fri, 19 Sep 2014 14:04:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33244) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XV2XI-00077W-9Z for emacs-devel@gnu.org; Fri, 19 Sep 2014 14:04:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XV2XF-0001G4-QP for emacs-devel@gnu.org; Fri, 19 Sep 2014 14:04:00 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59233) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XV2XF-00016T-NG for emacs-devel@gnu.org; Fri, 19 Sep 2014 14:03:57 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1XV2XA-0002kq-7t; Fri, 19 Sep 2014 14:03:52 -0400 In-reply-to: (message from Vladimir Kazanov on Fri, 19 Sep 2014 17:59:34 +0300) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:174571 Archived-At: [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] It turns out that the only viable alternative to overlays is using text properties, and text properties were not meant for the purpose. I designed text properties precisely for uses like this. All I need is an ability to save position pairs, the positions should survive text insertion/deletion I see multiple meanings for that; could you clarify? and there should be a way to find those pairs given a buffer point. Text properties are designed to be preserved through copying of text. Overlays are not. So it seems to me that you must use text properties. For each token, you put a text property 'token' onto the characters in the token. The value of the property would say what token they are. The property would be eq for all the characters in one token. Then you can use 'next-single-char-property-change' and 'previous-single-char-property-change' to find the end and the beginning of the token. If you run into any difficulties using the existing interfaces for text properties, we should improve the interfaces to make your program easier to write. -- Dr Richard Stallman President, Free Software Foundation 51 Franklin St Boston MA 02110 USA www.fsf.org www.gnu.org Skype: No way! That's nonfree (freedom-denying) software. Use Ekiga or an ordinary phone call.