emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

isearch, auto-composition-mode and display properties


From: Stephen Berman
Subject: isearch, auto-composition-mode and display properties
Date: Sat, 23 Feb 2008 23:24:14 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

On Thu, 21 Feb 2008 11:23:45 -0500 Stefan Monnier <address@hidden> 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: ll-test34a
Description: isearch-test


reply via email to

[Prev in Thread] Current Thread [Next in Thread]