emacs-devel
[Top][All Lists]
Advanced

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

Fix previous-button to work with connected buttons


From: Diane Murray
Subject: Fix previous-button to work with connected buttons
Date: Sun, 11 Mar 2007 00:53:25 +0100

`previous-button' doesn't work correctly when two buttons inserted
with `insert-button' are right next to each other.  Instead of
returning the previous button, it skips it and returns the one before
it, even though there's no skip property set.  The following patch
fixes this.

Neither `previous-button' nor `next-button' work well with neighboring
buttons inserted with `insert-text-button' - this patch is *not* able
to solve that problem.


2007-03-11  Diane Murray  <address@hidden>

        * button.el (previous-button): Fixed to work correctly when two
        overlay buttons are next to each other.


*** button.el   24 Jan 2007 13:01:15 +0100      1.22
--- button.el   11 Mar 2007 00:20:28 +0100      
***************
*** 371,377 ****
    (unless count-current
      (setq pos (previous-single-char-property-change pos 'button)))
    (and (> pos (point-min))
!        (or (button-at (1- pos))
           ;; We must have originally been on a button, and are now in
           ;; the inter-button space.  Recurse to find a button.
           (previous-button pos))))
--- 371,377 ----
    (unless count-current
      (setq pos (previous-single-char-property-change pos 'button)))
    (and (> pos (point-min))
!        (or (button-at pos)
           ;; We must have originally been on a button, and are now in
           ;; the inter-button space.  Recurse to find a button.
           (previous-button pos))))




reply via email to

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