From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Fix previous-button to work with connected buttons Date: Sun, 11 Mar 2007 17:46:19 -0400 Message-ID: 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 1173649609 7386 80.91.229.12 (11 Mar 2007 21:46:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 11 Mar 2007 21:46:49 +0000 (UTC) Cc: 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 22:46:43 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 1HQVsG-00075i-7O for ged-emacs-devel@m.gmane.org; Sun, 11 Mar 2007 22:46:40 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HQVsq-0001lr-9r for ged-emacs-devel@m.gmane.org; Sun, 11 Mar 2007 16:47:16 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HQVsf-0001lm-DD for emacs-devel@gnu.org; Sun, 11 Mar 2007 17:47:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HQVsc-0001la-W7 for emacs-devel@gnu.org; Sun, 11 Mar 2007 17:47:04 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HQVsc-0001lX-RI for emacs-devel@gnu.org; Sun, 11 Mar 2007 16:47:02 -0500 Original-Received: from tomts5.bellnexxia.net ([209.226.175.25] helo=tomts5-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HQVry-0004Y5-0b; Sun, 11 Mar 2007 17:46:22 -0400 Original-Received: from pastel.home ([74.12.204.225]) by tomts5-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20070311214619.BQX1671.tomts5-srv.bellnexxia.net@pastel.home>; Sun, 11 Mar 2007 17:46:19 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 4D7C87F26; Sun, 11 Mar 2007 17:46:19 -0400 (EDT) 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: Solaris 8 (1) 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:67743 Archived-At: >> 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? Because it's simpler and 100% reliable, and the waste is negligible (think of the amount of consing needed for the total list of properties, plus the amount of consing needed for the data-structure that keeps track of the text-properties, ...). > I imagine something like > (cons 'button (cons (setq button-counter (1+ button-counter)) properties)) > would work as well. Sure. Except for wraparounds, of course. Not that they're likely. Stefan