From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Console based mouse face highlighting. Date: Tue, 15 May 2007 06:26:30 +0300 Message-ID: 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> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1179199607 6723 80.91.229.12 (15 May 2007 03:26:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 15 May 2007 03:26:47 +0000 (UTC) Cc: emacs-devel@gnu.org To: Nick Roberts Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 15 05:26:46 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 1HnngT-0005BB-Pc for ged-emacs-devel@m.gmane.org; Tue, 15 May 2007 05:26:46 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HnnoI-0001Mu-Mq for ged-emacs-devel@m.gmane.org; Mon, 14 May 2007 23:34:50 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HnnoE-0001ME-Re for emacs-devel@gnu.org; Mon, 14 May 2007 23:34:46 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HnnoD-0001Lu-2m for emacs-devel@gnu.org; Mon, 14 May 2007 23:34:46 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HnnoC-0001Lr-W4 for emacs-devel@gnu.org; Mon, 14 May 2007 23:34:45 -0400 Original-Received: from romy.inter.net.il ([213.8.233.24]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HnngN-0002Yr-0S for emacs-devel@gnu.org; Mon, 14 May 2007 23:26:39 -0400 Original-Received: from HOME-C4E4A596F7 ([81.5.58.111]) by romy.inter.net.il (MOS 3.7.3-GA) with ESMTP id HVQ30359 (AUTH halo1); Tue, 15 May 2007 06:26:37 +0300 (IDT) In-reply-to: <17992.53379.953892.751275@kahikatea.snap.net.nz> (message from Nick Roberts on Tue, 15 May 2007 09:11:31 +1200) X-detected-kernel: FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) (2) 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:71090 Archived-At: > From: Nick Roberts > Date: Tue, 15 May 2007 09:11:31 +1200 > Cc: emacs-devel@gnu.org > > I'm getting closer. The help string appears now appears in the mini-buffer > when the pointer is over highlighting and I don't have to click. The correct > text is displayed with highlighting, however, it starts where the cursor is. > The file msdos.c says: > > /* IT_write_glyphs writes at cursor position,... > > and I guess the same is true for write_glyphs in term.c. Yes. > I don't quite follow what new_pos_X, new_pos_Y do, and their use > appears to use dos calls. They are part of the scheme that tracks the current and desired positions of the cursor. This comment before IT_cmgoto explains that at some length: /* Emacs calls cursor-movement functions a lot when it updates the display (probably a legacy of old terminals where you cannot update a screen line without first moving the cursor there). However, cursor movement is expensive on MSDOS (it calls a slow BIOS function and requires 2 mode switches), while actual screen updates access the video memory directly and don't depend on cursor position. To avoid slowing down the redisplay, we cheat: all functions that move the cursor only set internal variables which record the cursor position, whereas the cursor is only moved to its final position whenever screen update is complete. `IT_cmgoto' is called from the keyboard reading loop and when the frame update is complete. This means that we are ready for user input, so we update the cursor position to show where the point is, and also make the mouse pointer visible. Special treatment is required when the cursor is in the echo area, to put the cursor at the end of the text displayed there. */ You will see in the code the careful dance with current_pos_X/Y and new_pos_X/Y both of which are used in IT_cmgoto to decide whether it needs to invoke a system call to actually move the cursor. > I can't find a function that does the task of GET_CURSOR and when I do > this without it, for some reason, the highlighting appears in the > minibuffer where the help string is! I think curX and curY store the current location of the cursor. They are updated in cm.c.