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] Console based mouse face highlighting. Date: Tue, 15 May 2007 15:53:16 +1200 Message-ID: <17993.11948.400368.430713@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> 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 1179201214 10032 80.91.229.12 (15 May 2007 03:53:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 15 May 2007 03:53:34 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 15 05:53:31 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 1Hno6N-0008EL-Jd for ged-emacs-devel@m.gmane.org; Tue, 15 May 2007 05:53:31 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HnoEC-0002K1-Kn for ged-emacs-devel@m.gmane.org; Tue, 15 May 2007 00:01:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HnoE9-0002Jw-MN for emacs-devel@gnu.org; Tue, 15 May 2007 00:01:33 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HnoE9-0002Jk-3k for emacs-devel@gnu.org; Tue, 15 May 2007 00:01:33 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HnoE8-0002Jh-W1 for emacs-devel@gnu.org; Tue, 15 May 2007 00:01:33 -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 1Hno6H-00053K-GI; Mon, 14 May 2007 23:53:26 -0400 Original-Received: from kahikatea.snap.net.nz (39.63.255.123.dynamic.snap.net.nz [123.255.63.39]) by viper.snap.net.nz (Postfix) with ESMTP id 3337D3D8DEA; Tue, 15 May 2007 15:53:21 +1200 (NZST) Original-Received: by kahikatea.snap.net.nz (Postfix, from userid 1000) id 2BFC98F92B; Tue, 15 May 2007 15:53:17 +1200 (NZST) In-Reply-To: X-Mailer: VM 7.19 under Emacs 22.1.50.206 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:71092 Archived-At: > I think curX and curY store the current location of the cursor. They > are updated in cm.c. OK, thanks. Is cursor movement expensive on GNU/Linux? If not, I would do something like below in term_show_mouse_face. That would just leave drawing the highlighting where I've now put TODO (previously I manipulated write_glyphs to use mouse_face_face_id but that was probably wrong). msdos.c uses: IT_set_face (dpyinfo->mouse_face_face_id); _farsetsel (_dos_ds); while (nglyphs--) { _farnspokeb (offset, ScreenAttrib); offset += 2; } if (screen_virtual_segment) dosv_refresh_virtual_screen (start_offset, end_hpos - start_hpos); Can I write directly to the screen like this in term.c? Or do I have to modify the current glyph matrix somehow? (Which might be what xdisp.c does.) -- Nick http://www.inet.net.nz/~nickrob >>From term_show_mouse_face in my term.c: if(draw_mouse_face == DRAW_MOUSE_FACE) { //TODO } else /* draw_mouse_face == DRAW_NORMAL_TEXT */ { /* write_glyphs writes at cursor position, so we need to temporarily move cursor coordinates to the beginning of the highlight region. */ /* Save current cursor co-ordinates */ save_x = curX; save_y = curY; pos_x = row->used[LEFT_MARGIN_AREA] + start_hpos + WINDOW_LEFT_EDGE_X (w); pos_y = row->y + WINDOW_TOP_EDGE_Y (w); cursor_to (pos_x, pos_y); write_glyphs (row->glyphs[TEXT_AREA] + start_hpos, nglyphs); cursor_to (save_x, save_y); } }