From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Possible `point-entered' `point-left' Text Property Bug Date: Fri, 12 May 2006 00:15:45 -0400 Message-ID: References: <87r7304jck.fsf@stupidchicken.com> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1147407608 15132 80.91.229.2 (12 May 2006 04:20:08 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 12 May 2006 04:20:08 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 12 06:20:07 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FeP86-0001Fc-9c for ged-emacs-devel@m.gmane.org; Fri, 12 May 2006 06:20:02 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FeP7w-0001SN-2A for ged-emacs-devel@m.gmane.org; Fri, 12 May 2006 00:19:44 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FeP4o-0006h5-9v for emacs-devel@gnu.org; Fri, 12 May 2006 00:16:30 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FeP4n-0006gh-K4 for emacs-devel@gnu.org; Fri, 12 May 2006 00:16:29 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FeP4n-0006gZ-CE for emacs-devel@gnu.org; Fri, 12 May 2006 00:16:29 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FeP6E-0005ml-0B for emacs-devel@gnu.org; Fri, 12 May 2006 00:17:58 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1FeP45-0002PM-8j; Fri, 12 May 2006 00:15:45 -0400 Original-To: Chong Yidong In-reply-to: <87r7304jck.fsf@stupidchicken.com> (message from Chong Yidong on Thu, 11 May 2006 12:27:55 -0400) 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:54300 Archived-At: When executing previous-line and next-line, a situation can arise where no "character before point" is found for the point left, whereas one exists for the point entered (or vice versa). That's why the point-entered/left hooks are called. That seems like correct behavior to me. At least, more correct than the alternative. If the entered/left functions are called in this case, they can detect this case and decide to do nothing. But if we change the code NOT to call them in this case, and some program wants them to be called, there is nothing it can do. Does this behavior really cause a problem that is hard to work around? Or did it just strike people as incorrect? I don't know why this happens even when moving vertically with point in the middle of a line, but I am not familiar with the point motion code. I am really surprised about this because line-move-1 binds inhibit-point-motion-hooks to t, which ought to prevent the point-entered/left functions from even being checked for all the intermediate positions. The easy way to determine why they get called is to put breakpoints on the call2 lines: if (! EQ (leave_before, enter_before) && !NILP (leave_before)) call2 (leave_before, make_number (old_position), make_number (charpos)); if (! EQ (leave_after, enter_after) && !NILP (leave_after)) call2 (leave_after, make_number (old_position), make_number (charpos)); if (! EQ (enter_before, leave_before) && !NILP (enter_before)) call2 (enter_before, make_number (old_position), make_number (charpos)); if (! EQ (enter_after, leave_after) && !NILP (enter_after)) call2 (enter_after, make_number (old_position), make_number (charpos));