From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Nick Roberts Newsgroups: gmane.emacs.devel Subject: Re: The display margin Date: Tue, 27 May 2003 00:42:21 +0100 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <16082.42589.935105.932019@nick.uklinux.net> References: <16080.60869.212521.952911@nick.uklinux.net> <200305251636.h4PGa1ll021935@rum.cs.yale.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1053992853 9604 80.91.224.249 (26 May 2003 23:47:33 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 26 May 2003 23:47:33 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue May 27 01:47:30 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19KRgf-0002Uh-00 for ; Tue, 27 May 2003 01:47:29 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19KRu6-0001NK-00 for ; Tue, 27 May 2003 02:01:22 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19KRhb-0002oc-OR for emacs-devel@quimby.gnus.org; Mon, 26 May 2003 19:48:27 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19KRhA-0002em-4E for emacs-devel@gnu.org; Mon, 26 May 2003 19:48:00 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19KRh7-0002cX-Ux for emacs-devel@gnu.org; Mon, 26 May 2003 19:47:58 -0400 Original-Received: from bts-0941.dialup.zetnet.co.uk ([194.247.51.173] helo=nick.uklinux.net) by monty-python.gnu.org with esmtp (Exim 4.20) id 19KRfV-0001vc-54 for emacs-devel@gnu.org; Mon, 26 May 2003 19:46:17 -0400 Original-Received: by nick.uklinux.net (Postfix, from userid 501) id 9E23B75FDD; Tue, 27 May 2003 00:42:22 +0100 (BST) Original-To: "Stefan Monnier" In-Reply-To: <200305251636.h4PGa1ll021935@rum.cs.yale.edu> X-Mailer: VM 6.97 under Emacs 21.2.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:14297 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:14297 > You might try something like: > > (defun gud-break (&optional event) > "Set break point." > (interactive (list last-input-event)) > ;; Go to wherever the event happened. > (if event (ignore-errors (mouse-set-point event))) > ...) > > I haven't tried it, tho. Also you might need to use separate functions > for gud-break-from-toolbar than gud-break-from-margin. If you mean: (defun gud-break (&optional event) "Set break point." (interactive (list last-input-event)) ;; Go to wherever the event happened. (if event (ignore-errors (mouse-set-point event))) (gud-call "break %f:%l" nil)) This works fine in the text area but I don't want to redefine any mouse clicks there. And it doesn't work in the margin presumably because the point can't be set there. Clicking on the text area gives positions like: (# 132 (19 . 163) 114022256) whereas the on the left margin gives: (# left-margin (4 . 164) 114018986) I don't know enough about emacs internals to know if the line number can be easily inferred from the X-Y co-ordinates. However, since the width and height of the margin are also expressible in characters could the postion not be expressed as something like: (# (left-margin . 32) (4 . 164) 114018986) where 32, say, gives the character position in the margin (from which the line number can easily be calculated)? Nick