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: [RFA] Console based mouse face highlighting. Date: Wed, 16 May 2007 22:00:52 +1200 Message-ID: <17994.54868.931947.611990@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> <17994.32856.216525.50726@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 1179309678 2725 80.91.229.12 (16 May 2007 10:01:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 16 May 2007 10:01:18 +0000 (UTC) To: Eli Zaretskii , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 16 12:01:15 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 1HoGJn-00057l-0Z for ged-emacs-devel@m.gmane.org; Wed, 16 May 2007 12:01:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HoGRk-0001Kn-Jz for ged-emacs-devel@m.gmane.org; Wed, 16 May 2007 06:09:28 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HoGRg-0001JU-I1 for emacs-devel@gnu.org; Wed, 16 May 2007 06:09:24 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HoGRc-0001GH-Ed for emacs-devel@gnu.org; Wed, 16 May 2007 06:09:23 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HoGRc-0001GA-7p for emacs-devel@gnu.org; Wed, 16 May 2007 06:09:20 -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 1HoGJb-0007X1-SP; Wed, 16 May 2007 06:01:04 -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 0A6F03D90B0; Wed, 16 May 2007 22:01:00 +1200 (NZST) Original-Received: by kahikatea.snap.net.nz (Postfix, from userid 1000) id B65A88F92B; Wed, 16 May 2007 22:00:53 +1200 (NZST) In-Reply-To: <17994.32856.216525.50726@kahikatea.snap.net.nz> X-Mailer: VM 7.19 under Emacs 22.1.50.243 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:71155 Archived-At: > ...However I don't think declaring a new > struct glyph_row varable would save much. I'm not sure what else I could > do. Actually I can do better than this, as below, which doesn't modify the glyph matrix and does indeed eliminate some problems. OK to apply now? -- Nick http://www.inet.net.nz/~nickrob term_show_mouse_face (draw) loop ... if (draw == DRAW_MOUSE_FACE) { glyph = xmalloc (nglyphs * sizeof (struct glyph)); memcpy (glyph, row->glyphs[TEXT_AREA] + start_hpos, nglyphs * sizeof (struct glyph)); for (j = 0; j < nglyphs; j = j++) (glyph + j)->face_id = mouse_face_face_id; } else /* draw == DRAW_NORMAL_TEXT */ glyph = row->glyphs[TEXT_AREA] + start_hpos; 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 (glyph, nglyphs); if (draw == DRAW_MOUSE_FACE) xfree (glyph); cursor_to (save_y, save_x); }