unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Fix previous-button to work with connected buttons
@ 2007-03-10 23:53 Diane Murray
  2007-03-11  2:08 ` Stefan Monnier
  2007-04-01  2:28 ` Diane Murray
  0 siblings, 2 replies; 13+ messages in thread
From: Diane Murray @ 2007-03-10 23:53 UTC (permalink / raw)
  To: emacs-devel

`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  <disumu@x3y2z1.net>

	* 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))))

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-04-01 17:15 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-10 23:53 Fix previous-button to work with connected buttons Diane Murray
2007-03-11  2:08 ` Stefan Monnier
2007-03-11  2:45   ` Miles Bader
2007-03-11  6:00     ` Stefan Monnier
2007-03-11  6:12       ` Miles Bader
2007-03-11 10:55         ` David Kastrup
2007-03-11 12:53           ` Miles Bader
2007-03-11 13:04             ` David Kastrup
2007-03-11 21:46         ` Stefan Monnier
2007-03-11 22:52           ` Miles Bader
2007-04-01  2:28 ` Diane Murray
2007-04-01 14:00   ` Richard Stallman
2007-04-01 17:15   ` Chong Yidong

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).