unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: jared--- via "Emacs development discussions." <emacs-devel@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: joaotavora@gmail.com, emacs-devel@gnu.org
Subject: Re: Mouse-hovering over 'mouse-face' overlays/regions on a TTY Emacs
Date: Sat, 16 Jan 2021 14:27:08 -0800	[thread overview]
Message-ID: <3a066478224e93c3a50c28575a713a5c@finder.org> (raw)
In-Reply-To: <835z3x9gl5.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1020 bytes --]

On 2021-01-16 5:06 am, Eli Zaretskii wrote:
>> Date: Sat, 16 Jan 2021 09:53:02 +0200
>> From: Eli Zaretskii <eliz@gnu.org>
>> Cc: joaotavora@gmail.com, emacs-devel@gnu.org
>> 
>> > Date: Fri, 15 Jan 2021 21:31:59 -0800
>> > From: Jared Finder <jared@finder.org>
>> > Cc: joaotavora@gmail.com, emacs-devel@gnu.org
>> >
>> > It seems like these set of patches got lost. Joao, Eli, is this no
>> > longer valuable?
>> 
>> It isn't lost, it is still in my queue.  Sorry for being such a slow
>> patch-processing machine.
> 
> I installed that changeset now, with a small followup change: I see no
> need in this case to have code that checks FRAME_MSDOS_P outside of
> the #ifdef MSDOS conditional, as the former will never happen there,
> and the number of #ifdef's would not be smaller anyway.
> 
> Thanks.

Thanks.  It looks like Joao's patch earlier in the thread slipped 
through the cracks.  To make things easy, I created a patch file with a 
changelog for Joao.  (He authored the patch, not I.)  Attached.

   -- MJF

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Enable-TTY-mouse-face-support-when-built-without-GPM.patch --]
[-- Type: text/x-diff; name=0001-Enable-TTY-mouse-face-support-when-built-without-GPM.patch, Size: 2866 bytes --]

From 801eb8f478e1617f3c49de16aba7d4de4163ccd3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= <joaotavora@gmail.com>
Date: Sat, 16 Jan 2021 14:17:58 -0800
Subject: [PATCH] Enable TTY mouse-face support when built without GPM support

* src/term.c (tty_write_glyphs_with_face): Move definition out of
ifdef block.
* src/xdisp.c (draw_row_with_mouse_face): Move call to
tty_draw_row_with_mouse_face out of ifdef block.
---
 src/term.c  | 35 ++++++++++++++++-------------------
 src/xdisp.c |  3 +--
 2 files changed, 17 insertions(+), 21 deletions(-)

diff --git a/src/term.c b/src/term.c
index 2e2ab2bf43..37c06a560d 100644
--- a/src/term.c
+++ b/src/term.c
@@ -790,8 +790,6 @@ tty_write_glyphs (struct frame *f, struct glyph *string, int len)
   cmcheckmagic (tty);
 }
 
-#ifdef HAVE_GPM			/* Only used by GPM code.  */
-
 static void
 tty_write_glyphs_with_face (register struct frame *f, register struct glyph *string,
 			    register int len, register int face_id)
@@ -847,7 +845,6 @@ tty_write_glyphs_with_face (register struct frame *f, register struct glyph *str
 
   cmcheckmagic (tty);
 }
-#endif
 
 /* An implementation of insert_glyphs for termcap frames. */
 
@@ -2380,22 +2377,6 @@ DEFUN ("resume-tty", Fresume_tty, Sresume_tty, 0, 1, 0,
 			       Mouse
  ***********************************************************************/
 
-#ifdef HAVE_GPM
-
-void
-term_mouse_moveto (int x, int y)
-{
-  /* TODO: how to set mouse position?
-  const char *name;
-  int fd;
-  name = (const char *) ttyname (0);
-  fd = emacs_open (name, O_WRONLY, 0);
-     SOME_FUNCTION (x, y, fd);
-  emacs_close (fd);
-  last_mouse_x = x;
-  last_mouse_y = y;  */
-}
-
 /* Implementation of draw_row_with_mouse_face for TTY/GPM.  */
 void
 tty_draw_row_with_mouse_face (struct window *w, struct glyph_row *row,
@@ -2428,6 +2409,22 @@ tty_draw_row_with_mouse_face (struct window *w, struct glyph_row *row,
   cursor_to (f, save_y, save_x);
 }
 
+#ifdef HAVE_GPM
+
+void
+term_mouse_moveto (int x, int y)
+{
+  /* TODO: how to set mouse position?
+  const char *name;
+  int fd;
+  name = (const char *) ttyname (0);
+  fd = emacs_open (name, O_WRONLY, 0);
+     SOME_FUNCTION (x, y, fd);
+  emacs_close (fd);
+  last_mouse_x = x;
+  last_mouse_y = y;  */
+}
+
 /* Return the current time, as a Time value.  Wrap around on overflow.  */
 static Time
 current_Time (void)
diff --git a/src/xdisp.c b/src/xdisp.c
index 32e9773b54..e1e4ff4136 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -31927,9 +31927,8 @@ draw_row_with_mouse_face (struct window *w, int start_x, struct glyph_row *row,
       return;
     }
 #endif
-#if defined (HAVE_GPM) || defined (MSDOS) || defined (WINDOWSNT)
+
   tty_draw_row_with_mouse_face (w, row, start_hpos, end_hpos, draw);
-#endif
 }
 
 /* Display the active region described by mouse_face_* according to DRAW.  */
-- 
2.20.1


  reply	other threads:[~2021-01-16 22:27 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
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. [this message]
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=3a066478224e93c3a50c28575a713a5c@finder.org \
    --to=emacs-devel@gnu.org \
    --cc=eliz@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).