unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stephen Berman <Stephen.Berman@gmx.net>
To: emacs-devel@gnu.org
Subject: Re: isearch, auto-composition-mode and display properties
Date: Fri, 30 May 2008 10:49:10 +0200	[thread overview]
Message-ID: <87iqwwrxbt.fsf@escher.local.home> (raw)
In-Reply-To: 87wsouuq7g.fsf@jurta.org

On Sun, 24 Feb 2008 21:09:07 +0200 Juri Linkov <juri@jurta.org> 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  <rms@gnu.org>

	* 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





  reply	other threads:[~2008-05-30  8:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-21 16:12 auto-composition-mode and display properties Stephen Berman
2008-02-21 16:23 ` Stefan Monnier
2008-02-23 22:24   ` isearch, " Stephen Berman
2008-02-24 19:09     ` Juri Linkov
2008-05-30  8:49       ` Stephen Berman [this message]
2008-05-30 14:17         ` Stephen Berman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87iqwwrxbt.fsf@escher.local.home \
    --to=stephen.berman@gmx.net \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).