all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: storm@cua.dk (Kim F. Storm)
Cc: emacs-devel@gnu.org, Stefan Monnier <monnier+gnu/emacs@rum.cs.yale.edu>
Subject: Re: The display margin
Date: 23 Nov 2003 03:08:25 +0100	[thread overview]
Message-ID: <m3d6bjq1k6.fsf@kfs-l.imdomain.dk> (raw)
In-Reply-To: <16082.42589.935105.932019@nick.uklinux.net>


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 <nick@nick.uklinux.net> 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:
> 
> (#<window 9 on myprog.c> 132 (19 . 163) 114022256)
> 
> whereas the on the left margin gives:
> 
> (#<window 9 on myprog.c> 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:
> 
> (#<window 9 on myprog.c> (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 <storm@cua.dk> http://www.cua.dk

  reply	other threads:[~2003-11-23  2:08 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-25 16:22 The display margin Nick Roberts
2003-05-25 16:36 ` Stefan Monnier
2003-05-26 23:42   ` Nick Roberts
2003-11-23  2:08     ` Kim F. Storm [this message]
2003-11-23 22:53       ` Nick Roberts
2003-11-23 23:12         ` David Kastrup
2003-11-24  9:52           ` Kim F. Storm
2003-11-24 15:33             ` Kim F. Storm
2003-11-27 23:08           ` Kim F. Storm
2003-11-27 22:30             ` David Kastrup
2003-11-27 23:17               ` Stefan Monnier
2003-11-28 11:09               ` Kim F. Storm
2003-11-28 10:53                 ` David Kastrup
2003-11-28 14:23                   ` Thien-Thi Nguyen
2003-11-28 16:02                     ` David Kastrup
2003-11-28 17:01                       ` Thien-Thi Nguyen
2003-11-29  3:15                   ` Kim F. Storm
2003-11-29 11:37                     ` David Kastrup
2003-12-01 10:15                       ` Kim F. Storm
2003-12-01 13:08                         ` David Kastrup
2003-12-28  1:43                           ` Kim F. Storm
2003-12-29 11:54                             ` Richard Stallman
2003-11-24  0:09         ` Kim F. Storm
2003-11-25 21:11           ` Nick Roberts
2003-11-25 22:42             ` Kim F. Storm
  -- strict thread matches above, loose matches on Subject: below --
2003-11-28 12:47 David PONCE

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3d6bjq1k6.fsf@kfs-l.imdomain.dk \
    --to=storm@cua.dk \
    --cc=emacs-devel@gnu.org \
    --cc=monnier+gnu/emacs@rum.cs.yale.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.