From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nick Roberts Newsgroups: gmane.emacs.devel Subject: Re: [PATCH/Now RFA] Console based mouse face highlighting. Date: Wed, 16 May 2007 15:54:00 +1200 Message-ID: <17994.32856.216525.50726@kahikatea.snap.net.nz> References: <17989.37070.393150.565546@kahikatea.snap.net.nz> <17990.21422.577087.305723@kahikatea.snap.net.nz> <17990.37305.657724.344516@kahikatea.snap.net.nz> <17992.53379.953892.751275@kahikatea.snap.net.nz> <17993.11948.400368.430713@kahikatea.snap.net.nz> <17994.14013.614407.875104@kahikatea.snap.net.nz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1179287662 4302 80.91.229.12 (16 May 2007 03:54:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 16 May 2007 03:54:22 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 16 05:54:20 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HoAag-0005Hp-GK for ged-emacs-devel@m.gmane.org; Wed, 16 May 2007 05:54:18 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HoAic-0003OT-Lg for ged-emacs-devel@m.gmane.org; Wed, 16 May 2007 00:02:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HoAiZ-0003OO-2p for emacs-devel@gnu.org; Wed, 16 May 2007 00:02:27 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HoAiX-0003OC-LG for emacs-devel@gnu.org; Wed, 16 May 2007 00:02:26 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HoAiX-0003O9-I1 for emacs-devel@gnu.org; Wed, 16 May 2007 00:02:25 -0400 Original-Received: from viper.snap.net.nz ([202.37.101.8]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HoAaX-0002P0-Af; Tue, 15 May 2007 23:54:10 -0400 Original-Received: from kahikatea.snap.net.nz (198.61.255.123.dynamic.snap.net.nz [123.255.61.198]) by viper.snap.net.nz (Postfix) with ESMTP id ED5633D88DC; Wed, 16 May 2007 15:54:04 +1200 (NZST) Original-Received: by kahikatea.snap.net.nz (Postfix, from userid 1000) id DAA928F92B; Wed, 16 May 2007 15:54:00 +1200 (NZST) In-Reply-To: X-Mailer: VM 7.19 under Emacs 22.1.50.240 X-detected-kernel: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:71140 Archived-At: > I actually don't understand at all why you need to modify the glyph > matrix. What are you modifying there, exactly? Just the face_id. I'm replacing it with mouse_face_face_id and putting it back afterwards: term_show_mouse_face (draw) i loop ... if(draw == DRAW_MOUSE_FACE) { struct glyph* glyph; face_ids[i] = xmalloc (nglyphs * sizeof (int)); for (j = 0; j < nglyphs; j = j++) { glyph = (row->glyphs[TEXT_AREA] + start_hpos + j); face_ids[i][j] = glyph->face_id; glyph->face_id = mouse_face_face_id; } } else /* draw == DRAW_NORMAL_TEXT */ { for (j = 0; j< nglyphs; j = j++) { (row->glyphs[TEXT_AREA] + start_hpos + j)->face_id = face_ids[i][j]; } if (face_ids[i]) { xfree (face_ids[i]); face_ids[i] = NULL; } } pos_y = row->y + WINDOW_TOP_EDGE_Y (w); pos_x = row->used[LEFT_MARGIN_AREA] + start_hpos + WINDOW_LEFT_EDGE_X (w); cursor_to (pos_y, pos_x); write_glyphs (row->glyphs[TEXT_AREA] + start_hpos, nglyphs); > > Anyway I'd like to commit these changes now. > > I'd be happier if you fixed the two aspects we've been talking about > (not change the glyph matrix and avoid calling this code on non-tty > frames. I think these are really nasty bugs. And I don't see any > reason for haste here. Thre's no hurry, but once it's in people can, and will, tell me what's wrong with it. I'm not sure these are really nasty bugs: you can only open a connection with Gpm from a Linux console, e.g., it's a no-op on X, and the display seems pretty much to DTRT. Currently, the variable row is a row from the current matrix, but it needn't be. However I don't think declaring a new struct glyph_row varable would save much. I'm not sure what else I could do. > Thanks for working on this. Thanks for the hints. -- Nick http://www.inet.net.nz/~nickrob