From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Diane Murray Newsgroups: gmane.emacs.devel Subject: Fix previous-button to work with connected buttons Date: Sun, 11 Mar 2007 00:53:25 +0100 Message-ID: <87wt1o8xl6.fsf@x3y2z1.net> NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1173570759 31485 80.91.229.12 (10 Mar 2007 23:52:39 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 10 Mar 2007 23:52:39 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 11 00:52:34 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 1HQBMV-0006ws-RN for ged-emacs-devel@m.gmane.org; Sun, 11 Mar 2007 00:52:32 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HQBMz-00034s-IM for ged-emacs-devel@m.gmane.org; Sat, 10 Mar 2007 18:53:01 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HQBMo-00033Y-1p for emacs-devel@gnu.org; Sat, 10 Mar 2007 18:52:50 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HQBMn-00032z-6O for emacs-devel@gnu.org; Sat, 10 Mar 2007 18:52:49 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HQBMn-00032w-2G for emacs-devel@gnu.org; Sat, 10 Mar 2007 18:52:49 -0500 Original-Received: from mailout03.sul.t-online.com ([194.25.134.81]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HQBMI-0005XM-IY for emacs-devel@gnu.org; Sat, 10 Mar 2007 18:52:18 -0500 Original-Received: from fwd34.aul.t-online.de by mailout03.sul.t-online.com with smtp id 1HQBMG-0003mY-01; Sun, 11 Mar 2007 00:52:16 +0100 Original-Received: from spargel (SaQWZBZaQecQSSVp0LS0Uhqbk29j7-sPzHbkQBv580m8FraW6WPmQl@[84.189.213.176]) by fwd34.sul.t-online.de with esmtp id 1HQBMD-0HEJ0K0; Sun, 11 Mar 2007 00:52:13 +0100 X-ID: SaQWZBZaQecQSSVp0LS0Uhqbk29j7-sPzHbkQBv580m8FraW6WPmQl@t-dialin.net X-TOI-MSGID: f6108851-19d5-484c-8a69-dba776101ecf 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:67694 Archived-At: `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 * 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))))