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: isearch, auto-composition-mode and display properties
Date: Sat, 23 Feb 2008 23:24:14 +0100	[thread overview]
Message-ID: <87fxvj9ur5.fsf_-_@escher.local.home> (raw)
In-Reply-To: jwvd4qq5lfr.fsf-monnier+emacs@gnu.org

[-- Attachment #1: Type: text/plain, Size: 2808 bytes --]

On Thu, 21 Feb 2008 11:23:45 -0500 Stefan Monnier <monnier@IRO.UMontreal.CA> wrote:

>> merge).  So I would like to know, again, if auto-composition-mode is
>> really supposed to add the auto-composed property to the display string.
>
> Yes.  As a matter of fact, it goes through a fair bit of extra trouble
> to be able to do that.

Ok.  Too bad it's also causing me trouble, but maybe there's hope ...

>> And does anyone have any suggestions for how I can debug isearch?
>
> When Edebug is uncooperative, `message' is your friend,

I don't see where in the isearch code it would be helpful to invoke
`message' for the problem at hand.  But maybe someone else will: I have
in the mean time come up with a fairly minimal recipe for reproducing
the isearch problem that does not depend on my mode.  Here it is:

1. emacs -Q --eval "(add-hook 'post-command-hook 'ignore)" isearch-test[1]

2. M-: (setq header-line-format "test")

3. Evaluate the following sexp (this assumes frame-height is 40 and
frame-width is 80):

	(progn
	  (put-text-property 70 71 'display " \n")
	  (put-text-property 137 138 'display " \n")
	  (copy-region-as-kill 1 188)
	  (goto-char 188)
	  (dotimes (_ 20) (yank))
	  (goto-char (point-min))
	  (scroll-up 1))

Now point should be at window-start, point-min should be above
window-start, and the last visible line in the window should contain an
occurrence of the string "search".

4. Type `C-s s e C-w' to make "search" the isearch target.

5. Keeping type `C-s' until it reaches the "search" in the last visible
line (line 13).

6. Typing `C-s' again makes the cursor jump to the beginning of line 7.
Continuing to type `C-s' cycles over lines 7 to 13 ad infinitum.

7. Type `M-x auto-composition-mode' to disable auto-composition-mode.
Now typing `C-s' makes isearch find all "search" strings to the end of
the buffer, i.e., now isearch functions as it should.

I note that the problematic effect in step 6 only happens if
post-command-hook is non-nil (but AFAICT the value is otherwise
irrelevant), header-line-format is non-nil and the text is situated as
described at the end of step 3.  (With the mode where I first observed
this problem, I saw somewhat different effects, possibly depending on
frame-height: in one test isearch simply stopped at the bottom of the
window, i.e. continuing to type `C-s' had no effect; in another test the
cursor jumped only a couple of lines higher, not to the middle of the
window; in yet another test the cursor jumped to the beginning of the
line.  Also there were configurations where the last occurrence of the
isearch target string was not on the last visible line but several
above.)

I hope others can reproduce this problem and someone can figure out
what's going on.

Steve Berman

Footnotes: 
[1]  Here is the file isearch-test:

[-- Attachment #2: isearch-test --]
[-- Type: application/octet-stream, Size: 187 bytes --]

Test test test test test test test test test test test test test test test test test test test test test search test test test test test test test test test test test test test test test

  reply	other threads:[~2008-02-23 22:24 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   ` Stephen Berman [this message]
2008-02-24 19:09     ` isearch, " Juri Linkov
2008-05-30  8:49       ` Stephen Berman
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=87fxvj9ur5.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).