emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fix previous-button to work with connected buttons


From: David Kastrup
Subject: Re: Fix previous-button to work with connected buttons
Date: Sun, 11 Mar 2007 11:55:08 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.95 (gnu/linux)

Miles Bader <address@hidden> writes:

> Stefan Monnier <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]