unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Jared Finder <jared@finder.org>
Cc: joaotavora@gmail.com, emacs-devel@gnu.org
Subject: Re: Mouse-hovering over 'mouse-face' overlays/regions on a TTY Emacs
Date: Sat, 05 Dec 2020 12:39:50 +0200	[thread overview]
Message-ID: <83blf8cz9l.fsf@gnu.org> (raw)
In-Reply-To: <5aff1d6ff795552203292395560a5075@finder.org> (message from Jared Finder on Wed, 02 Dec 2020 00:40:01 -0800)

> Date: Wed, 02 Dec 2020 00:40:01 -0800
> From: Jared Finder <jared@finder.org>
> Cc: joaotavora@gmail.com, emacs-devel@gnu.org
> 
> * src/frame.c (Fset_mouse_position, Fset_mouse_pixel_position): Call
> Fselect_frame in all terminals, independent of defines.

Maybe I'm missing something, but I don't see how the proposed changes
cause Fselect_frame to be called fore any display type.

> diff --git a/src/frame.c b/src/frame.c
> index 17ec455d2d..4bbcb74667 100644
> --- a/src/frame.c
> +++ b/src/frame.c
> @@ -2574,22 +2574,28 @@ DEFUN ("set-mouse-position", Fset_mouse_position, Sset_mouse_position, 3, 3, 0,
>    /* I think this should be done with a hook.  */
>  #ifdef HAVE_WINDOW_SYSTEM
>    if (FRAME_WINDOW_P (XFRAME (frame)))
> -    /* Warping the mouse will cause enternotify and focus events.  */
> -    frame_set_mouse_position (XFRAME (frame), xval, yval);
> -#elif defined MSDOS
> +    {
> +      /* Warping the mouse will cause enternotify and focus events.  */
> +      frame_set_mouse_position (XFRAME (frame), xval, yval);
> +      return Qnil;
> +    }
> +#endif /* HAVE_WINDOW_SYSTEM */
> +#ifdef MSDOS
>    if (FRAME_MSDOS_P (XFRAME (frame)))
>      {
>        Fselect_frame (frame, Qnil);
>        mouse_moveto (xval, yval);
> +      return Qnil;
>      }

Can we do this without introducing multiple return points?  if nothing
else, that makes it harder to assess correctness and harder to debug
the code.

> +#if defined (HAVE_GPM) && ! defined (HAVE_WINDOW_SYSTEM)
>    term_mouse_moveto (xval, yval);
>  #else

The additional HAVE_WINDOW_SYSTEM condition is because
term_mouse_moveto is conditioned the same on term.c?  If so, I think
we should remove the HAVE_WINDOW_SYSTEM part there as well: there's no
reason why a --with-x build couldn't also support GPM.

Thanks.



  reply	other threads:[~2020-12-05 10:39 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-29 21:33 Mouse-hovering over 'mouse-face' overlays/regions on a TTY Emacs João Távora
2020-11-30  3:28 ` Eli Zaretskii
2020-11-30  8:21   ` João Távora
2020-11-30 16:09     ` Eli Zaretskii
2020-11-30 16:25       ` João Távora
2020-11-30 16:43         ` Eli Zaretskii
2020-11-30 16:47           ` João Távora
2020-11-30 18:05           ` João Távora
2020-11-30 18:24             ` Eli Zaretskii
2020-11-30 18:28               ` João Távora
2020-11-30 18:58                 ` Eli Zaretskii
2020-11-30 19:09                   ` João Távora
2020-11-30 20:07                     ` Stefan Monnier
2020-12-01  7:10                     ` Jared Finder via Emacs development discussions.
2020-12-01 18:20                       ` Eli Zaretskii
2020-12-02  8:40                         ` Jared Finder via Emacs development discussions.
2020-12-05 10:39                           ` Eli Zaretskii [this message]
2020-12-08  5:46                             ` Jared Finder via Emacs development discussions.
2021-01-16  5:31                               ` Jared Finder via Emacs development discussions.
2021-01-16  7:53                                 ` Eli Zaretskii
2021-01-16 13:06                                   ` Eli Zaretskii
2021-01-16 22:27                                     ` jared--- via Emacs development discussions.
2021-01-22 12:20                                       ` Eli Zaretskii
2021-01-22 16:47                                         ` João Távora

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83blf8cz9l.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=jared@finder.org \
    --cc=joaotavora@gmail.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).