From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Fix previous-button to work with connected buttons Date: Sun, 11 Mar 2007 11:55:08 +0100 Message-ID: <85mz2krqwj.fsf@lola.goethe.zz> References: <87wt1o8xl6.fsf@x3y2z1.net> <873b4c7b2f.fsf@catnip.gol.com> <87tzws5mx0.fsf@catnip.gol.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1173610540 14263 80.91.229.12 (11 Mar 2007 10:55:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 11 Mar 2007 10:55:40 +0000 (UTC) Cc: Stefan Monnier , Diane Murray , emacs-devel@gnu.org To: Miles Bader Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 11 11:55:32 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HQLi7-0005U9-ST for ged-emacs-devel@m.gmane.org; Sun, 11 Mar 2007 11:55:32 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HQLie-0004ca-Kx for ged-emacs-devel@m.gmane.org; Sun, 11 Mar 2007 05:56:04 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HQLiT-0004cV-9T for emacs-devel@gnu.org; Sun, 11 Mar 2007 06:55:53 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HQLiR-0004at-P6 for emacs-devel@gnu.org; Sun, 11 Mar 2007 06:55:52 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HQLiR-0004aS-Jl for emacs-devel@gnu.org; Sun, 11 Mar 2007 05:55:51 -0500 Original-Received: from mail-in-09.arcor-online.net ([151.189.21.49]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HQLhq-0002Mm-0c; Sun, 11 Mar 2007 06:55:14 -0400 Original-Received: from mail-in-04-z2.arcor-online.net (mail-in-04-z2.arcor-online.net [151.189.8.16]) by mail-in-09.arcor-online.net (Postfix) with ESMTP id 760CA30284D; Sun, 11 Mar 2007 11:55:12 +0100 (CET) Original-Received: from mail-in-02.arcor-online.net (mail-in-02.arcor-online.net [151.189.21.42]) by mail-in-04-z2.arcor-online.net (Postfix) with ESMTP id 6647DABAE9; Sun, 11 Mar 2007 11:55:12 +0100 (CET) Original-Received: from lola.goethe.zz (dslb-084-061-021-177.pools.arcor-ip.net [84.61.21.177]) by mail-in-02.arcor-online.net (Postfix) with ESMTP id 41A8A2D8E49; Sun, 11 Mar 2007 11:55:10 +0100 (CET) Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id 257E11C4F93F; Sun, 11 Mar 2007 11:55:09 +0100 (CET) In-Reply-To: <87tzws5mx0.fsf@catnip.gol.com> (Miles Bader's message of "Sun\, 11 Mar 2007 15\:12\:11 +0900") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.95 (gnu/linux) X-detected-kernel: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:67712 Archived-At: Miles Bader writes: > Stefan Monnier writes: >> How 'bout the patch below, then? >> + (add-text-properties beg end >> + ;; Each button should have a different `button' >> + ;; property so that next-single-property-change can >> + ;; detect boundaries reliably. >> + (cons 'button (cons (list t) properties))) > > Hmm. Any reason to waste a cons-cell? I imagine something like > (cons 'button (cons (setq button-counter (1+ button-counter)) properties)) ^^^^^^ > would work as well. How about (cons 'button (cons (car properties) (cdr properties)))? That provides an EQ-unique value without all the added fluff. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum