From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.devel Subject: Re: isearch, auto-composition-mode and display properties Date: Fri, 30 May 2008 10:49:10 +0200 Message-ID: <87iqwwrxbt.fsf@escher.local.home> References: <878x1ee1ai.fsf@escher.local.home> <87fxvj9ur5.fsf_-_@escher.local.home> <87wsouuq7g.fsf@jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1212138750 27751 80.91.229.12 (30 May 2008 09:12:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 30 May 2008 09:12:30 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 30 11:13:11 2008 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 1K20fY-00064m-ID for ged-emacs-devel@m.gmane.org; Fri, 30 May 2008 11:13:04 +0200 Original-Received: from localhost ([127.0.0.1]:48242 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K20em-0006q2-MG for ged-emacs-devel@m.gmane.org; Fri, 30 May 2008 05:12:16 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K20If-0000Ic-2g for emacs-devel@gnu.org; Fri, 30 May 2008 04:49:25 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K20Ib-0000Ho-19 for emacs-devel@gnu.org; Fri, 30 May 2008 04:49:22 -0400 Original-Received: from [199.232.76.173] (port=56364 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K20Ia-0000HO-7T for emacs-devel@gnu.org; Fri, 30 May 2008 04:49:20 -0400 Original-Received: from main.gmane.org ([80.91.229.2]:37224 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K20IZ-0007Hr-GT for emacs-devel@gnu.org; Fri, 30 May 2008 04:49:19 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1K20IY-00030p-Iy for emacs-devel@gnu.org; Fri, 30 May 2008 08:49:18 +0000 Original-Received: from i5387d3c1.versanet.de ([83.135.211.193]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 30 May 2008 08:49:18 +0000 Original-Received: from Stephen.Berman by i5387d3c1.versanet.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 30 May 2008 08:49:18 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 69 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: i5387d3c1.versanet.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:98054 Archived-At: On Sun, 24 Feb 2008 21:09:07 +0200 Juri Linkov wrote: >> I hope others can reproduce this problem and someone can figure out >> what's going on. > > Thank you for the detailed test case. I was able to reproduce it. > > To debug isearch, you can instrument one of the top isearch functions > (e.g. `isearch-repeat-forward'), open the isearch.el file in another > frame/buffer (another frame is more preferable when debugging display > problems like in your case), and start typing C-s in the original > buffer. When it stops on an uninteresting place, just type `g' to > continue execution. Use `i' to go to a deeper function. > > The hardest part in debugging isearch is not forget not to use isearch > to navigate in the source buffer while edebug is active (e.g. to find > the next function to instrument, etc :) > > Using this technique, it is possible to find that your trouble is cased > by the following part of `isearch-update': > > ;; Keep same hscrolling as at the start of the search when possible > (let ((current-scroll (window-hscroll))) > (set-window-hscroll (selected-window) isearch-start-hscroll) > (unless (pos-visible-in-window-p) > (set-window-hscroll (selected-window) current-scroll))) > > Removing this part eliminates the bug you reported. Unfortunately, > I have no idea how to fix this since this depends on the details > how the display engine works. I'd like to return to this. Assuming a fix at the display level is too difficult or laborious, I wonder whether the above code really does what the comment says. In fact, I'm not sure what the comment is intending to achieve. I tested the code by starting isearch with different horizontal scrolling positions set, both with and without the above code, and saw no difference in behavior or resulting hscroll position. What difference is expected and what do you have to do to see it? Moreover, unless I misunderstand the manual, it looks like the above will always leave the hscroll position at (window-hscroll) (which is what my tests resulted in): (elisp) Window Start: The `pos-visible-in-window-p' function considers only vertical scrolling. If POSITION is out of view only because WINDOW has been scrolled horizontally, `pos-visible-in-window-p' returns non-`nil' anyway. Is it possible for (pos-visible-in-window-p) to return nil after an isearch? The above code was added by this change: 2001-12-15 Richard M. Stallman * isearch.el (isearch-start-hscroll): New variable. (isearch-mode): Set isearch-start-hscroll. (isearch-update): Restore original hscrolling if possible. I searched the emacs-devel, bug, and help archives prior to this change but found no relevant posts. If the above code either doesn't do what it was intended for, or if it doesn't make a difference in current Emacs, could it be eliminated? That would at least work around the still existing problem raised by my OP. Or if the code is still needed, can someone explain it to me and provide a concrete example where it DTRT? Steve Berman