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: Re: Fix previous-button to work with connected buttons Date: Sun, 01 Apr 2007 04:28:10 +0200 Message-ID: <87648gzv45.fsf@x3y2z1.net> References: <87wt1o8xl6.fsf@x3y2z1.net> NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1175394364 14086 80.91.229.12 (1 Apr 2007 02:26:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 1 Apr 2007 02:26:04 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 01 04:25:58 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 1HXplV-0004bc-Gz for ged-emacs-devel@m.gmane.org; Sun, 01 Apr 2007 04:25:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HXpoN-0001Wo-5h for ged-emacs-devel@m.gmane.org; Sat, 31 Mar 2007 21:28:55 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HXpoF-0001Ub-9B for emacs-devel@gnu.org; Sat, 31 Mar 2007 22:28:47 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HXpoC-0001Th-Kc for emacs-devel@gnu.org; Sat, 31 Mar 2007 22:28:46 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HXpoC-0001Ta-AS for emacs-devel@gnu.org; Sat, 31 Mar 2007 21:28:44 -0500 Original-Received: from mailout10.sul.t-online.com ([194.25.134.21]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HXplJ-0007S3-Q5 for emacs-devel@gnu.org; Sat, 31 Mar 2007 22:25:46 -0400 Original-Received: from fwd28.aul.t-online.de by mailout10.sul.t-online.com with smtp id 1HXplI-0002dc-00; Sun, 01 Apr 2007 04:25:44 +0200 Original-Received: from spargel (VyeQCwZcQem0HnqsLWSbdl-4CNoanx07aJceegWVKx8hnZrGTYpF6y@[84.189.252.61]) by fwd28.sul.t-online.de with esmtp id 1HXplA-0vLnQ80; Sun, 1 Apr 2007 04:25:36 +0200 X-ID: VyeQCwZcQem0HnqsLWSbdl-4CNoanx07aJceegWVKx8hnZrGTYpF6y@t-dialin.net X-TOI-MSGID: 7bccae7a-9a80-4c2c-b714-ea2f9a7f0d38 X-detected-kernel: Linux 2.6 (newer, 3) 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:68877 Archived-At: The latest changes to button.el have added a new distinct button property which makes it possible to correctly determine that neighboring buttons are different and to navigate through them even when they are right next to each other. There is still one little bug, however, which I corrected in a patch I sent in my original email - the problem it fixes is that any previous adjacent button is skipped. Please see the patch below with a new diff from the latest revision. 2007-04-01 Diane Murray * button.el (previous-button): Fixed to work correctly when two buttons are next to each other. *** button.el 28 Mar 2007 03:20:30 -0000 1.23 --- button.el 1 Apr 2007 02:21:12 -0000 *************** *** 372,378 **** (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)))) --- 372,378 ---- (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))))