From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Greg Hill Newsgroups: gmane.emacs.devel Subject: Re: Fwd: Re: Re: bug in field-string and field-string-no-properties Date: Thu, 28 Aug 2003 19:20:32 -0700 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <200308282132.h7SLWeV1009685@rum.cs.yale.edu> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Trace: sea.gmane.org 1062125327 8136 80.91.224.253 (29 Aug 2003 02:48:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 29 Aug 2003 02:48:47 +0000 (UTC) Cc: emacs-devel@gnu.org, monnier@cs.yale.edu, miles@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri Aug 29 04:48:45 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19sZJc-0003Ux-00 for ; Fri, 29 Aug 2003 04:48:44 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19sZQm-0005jg-00 for ; Fri, 29 Aug 2003 04:56:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.22) id 19sZGP-00060U-8v for emacs-devel@quimby.gnus.org; Thu, 28 Aug 2003 22:45:25 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.22) id 19sYyr-0002xZ-Tr for emacs-devel@gnu.org; Thu, 28 Aug 2003 22:27:22 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.22) id 19sYtW-000888-Jb for emacs-devel@gnu.org; Thu, 28 Aug 2003 22:21:47 -0400 Original-Received: from [153.105.4.30] (helo=synergymicro.com) by monty-python.gnu.org with esmtp (Exim 4.22) id 19sYsm-0007nM-VF; Thu, 28 Aug 2003 22:21:01 -0400 Original-Received: from synergy.synergy.encinitas.ca.us ([153.105.4.29]) by synergymicro.com (8.9.3/8.9.3) with ESMTP id TAA32521; Thu, 28 Aug 2003 19:22:46 -0700 Original-Received: from [198.17.100.22] (G_Hill_Mac [198.17.100.22]) by synergy.synergy.encinitas.ca.us (8.12.8/8.12.8) with ESMTP id h7T2L4IB000777; Thu, 28 Aug 2003 19:21:08 -0700 In-Reply-To: <200308282132.h7SLWeV1009685@rum.cs.yale.edu> Original-To: "Stefan Monnier" , Richard Stallman X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:16181 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:16181 At 5:32 PM -0400 8/28/03, Stefan Monnier wrote: > > > As it stands, field-string returns a string only if the character to > > the left AND the character to the right of POS both have the same > > field property. > >Can you show a precise test case that shows that ? >It works correctly in my tests (and in actual use by `customize' it also >seems to work). (progn (set-buffer (get-buffer-create "junk")) (erase-buffer) (insert "xXyY") (put-text-property 1 3 'field 'X) (put-text-property 3 5 'field 'Y) (message (concat "At 1, field-property = %s, field-string = '%s'\n" " At 2, field-property = %s, field-string = '%s'\n" " At 3, field-property = %s, field-string = '%s'\n" " At 4, field-property = %s, field-string = '%s'\n" " At 5, field-property = %s, field-string = '%s'\n") (get-text-property 1 'field) (field-string-no-properties 1) (get-text-property 2 'field) (field-string-no-properties 2) (get-text-property 3 'field) (field-string-no-properties 3) (get-text-property 4 'field) (field-string-no-properties 4) (get-text-property 5 'field) (field-string-no-properties 5))) produces: "At 1, field-property = X, field-string = '' At 2, field-property = X, field-string = 'xX' At 3, field-property = Y, field-string = '' At 4, field-property = Y, field-string = 'yY' At 5, field-property = nil, field-string = '' " The kind of function I would find useful wouldn't depend on stickiness at all. For a given buffer position, the value of the field property returned by get-text-property would determine the string returned by field-string when it is passed the same buffer position. Thus, in the example above, since the characters at positions 3 and 4 both have the same value, 'Y, for their field property, field-string would return the same string, "yY", for both of those positions. If this were the case, the `buffer-pos' in the event caused by mouse-clicking on the "y" at position 3 in the example above would always return "yY" as the field-string, not an empty string, and certainly not "xX" just because the "X" happened to be rear-sticky. --Greg