From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: The display margin Date: 23 Nov 2003 03:08:25 +0100 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <16080.60869.212521.952911@nick.uklinux.net> <200305251636.h4PGa1ll021935@rum.cs.yale.edu> <16082.42589.935105.932019@nick.uklinux.net> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1069549873 7009 80.91.224.253 (23 Nov 2003 01:11:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 23 Nov 2003 01:11:13 +0000 (UTC) Cc: emacs-devel@gnu.org, Stefan Monnier Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sun Nov 23 02:11:10 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1ANimM-0004f2-00 for ; Sun, 23 Nov 2003 02:11:10 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1ANimM-0008UN-00 for ; Sun, 23 Nov 2003 02:11:10 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ANji6-0007e2-CC for emacs-devel@quimby.gnus.org; Sat, 22 Nov 2003 21:10:50 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1ANji0-0007dI-PS for emacs-devel@gnu.org; Sat, 22 Nov 2003 21:10:44 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1ANjhU-0007DC-Jq for emacs-devel@gnu.org; Sat, 22 Nov 2003 21:10:43 -0500 Original-Received: from [193.162.153.4] (helo=pfepc.post.tele.dk) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ANjhU-0007D9-5x for emacs-devel@gnu.org; Sat, 22 Nov 2003 21:10:12 -0500 Original-Received: from kfs-l.imdomain.dk.cua.dk (0x503e2644.bynxx3.adsl-dhcp.tele.dk [80.62.38.68]) by pfepc.post.tele.dk (Postfix) with SMTP id 5706526293C; Sun, 23 Nov 2003 02:08:46 +0100 (CET) Original-To: Nick Roberts In-Reply-To: <16082.42589.935105.932019@nick.uklinux.net> Original-Lines: 95 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:18046 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:18046 Hi Nick (and the rest of the emacs-devel team), I have just checked in fixes to improve event handling for mouse clicks in the marginal areas and on the fringes. Events now have additional information: (WINDOW AREA-OR-POS (X . Y) TIMESTAMP OBJECT POS (COL . ROW)) AREA-OR-POS is not changed as such -- but it may now contain left-fringe and right-fringe. For clicks in the text area, POS is the same as AREA-OR-POS (the buffer position clicked on). For clicks in other areas, POS is the buffer position of the first visible glyph on the corresponding row. As an example, try M-x gdba and click mouse-1 on the left margin or fringe of a source window [it should toggle breakpoint on that line]. [Note: Some strange scrolling happens if I remove a breakpoint in the lower half of a window, but I strongly suspect this has something to do with comint doing strange things to the wrong window -- as I have traced this (using gdba :-) and it seems to happens inside a comint filter or some such -- when stepping, it actually happens to scroll and redisplay the window BEFORE the breakpoint icon disappears.] Docs in commands.texi have been updated to reflect changes. Note that previously mouse click on fringes were just handled like clicks in the text area. Now they are separate event types, so I have added bindings for them in mouse.el to allow h-scrolling by clicking on fringes to work as before. If mouse events starts to behave differently than before, pls. let me know. ++kfs Nick Roberts writes: > > 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 > > > _______________________________________________ > Emacs-devel mailing list > Emacs-devel@gnu.org > http://mail.gnu.org/mailman/listinfo/emacs-devel > > -- Kim F. Storm http://www.cua.dk