From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: rudalics@gmx.at Newsgroups: gmane.emacs.bugs Subject: obscure Emacs redisplay bug Date: Mon, 7 Mar 2005 07:40:06 +0100 (MET) Message-ID: <10931.1110177606@www24.gmx.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1110177379 4978 80.91.229.2 (7 Mar 2005 06:36:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 7 Mar 2005 06:36:19 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 07 07:36:18 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1D8BqE-0006by-KF for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Mar 2005 07:35:47 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D8C9w-0005QV-9V for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Mar 2005 01:56:08 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D8C9q-0005LB-Fi for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2005 01:56:02 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D8C9m-0005Im-5s for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2005 01:56:01 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D8C9m-0005IO-2e for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2005 01:55:58 -0500 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.34) id 1D8BuR-0002BR-1p for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2005 01:40:07 -0500 Original-Received: (qmail 31122 invoked by uid 0); 7 Mar 2005 06:40:06 -0000 Original-Received: from 62.47.40.177 by www24.gmx.net with HTTP; Mon, 7 Mar 2005 07:40:06 +0100 (MET) Original-To: bug-gnu-emacs@gnu.org X-Priority: 3 (Normal) X-Authenticated: #14592706 X-Mailer: WWW-Mail 1.6 (Global Message Exchange) X-Flags: 0001 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org X-MailScanner-To: geb-bug-gnu-emacs@m.gmane.org Xref: news.gmane.org gmane.emacs.bugs:10874 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:10874 Let me tell you about an obscure bug that garbles a few lines of text during Emacs redisplay. The "original" text can be restored by typing C-l or by moving the cursor over it, that's why I relate the bug to redisplay. Unfortunately, it's non-trivial to reproduce the bug. I've been using Emacs 21.2 on Debian Linux and 21.2/21.3 on Windows ME and a window displaying the following stretch of code: ------------------------- top of window ------------------- (defun foo () "A silly function called foo." (and (or (not nil) t (not (not t))) t (or nil t t))) (defun bar () "Another silly function called bar." (and (or (not nil) t (not t)) (not t) (or (not nil) t t))) I now clone the code's buffer, vertically split the window, and display the indirect buffer in the right window. In addition I use a number of overlays, namely: (1) Invisibility overlays represented by an ellipsis (2) An "ECHO" overlay displaying text in some face (3) "MATCH" overlays displaying text in another face (4) A "CURRENT" overlay displaying text in a third face I shall indicate start and end of ECHO with square brackets, and start and end of CURRENT with angle brackets. `point' is invariantly before the first character of CURRENT. I won't bother to indicate MATCH overlays: They span every single occurrence of `nil' in the right window. My right window now appears as follows: ------------------------- top of window ------------------- (and (or (not nil) t (not (not t))) t (or t t))) ] (defun bar () ... function called bar." (and (or (not nil) t (not t)) (not t) (or (not nil) t t))) Hence ECHO starts somewhere at or before `window-start' and CURRENT is on the second visible `nil'. The first two lines of the documentation string of `bar' have been replaced by an ellipsis. `selected-window' is the left window which simply displays the numbers of the lines of occurrences of `nil' in the right window. I now move in the left window down by one line which implicitly causes a recentering of the right window and a relocation of ECHO and CURRENT: ------------------------- top of window ------------------- t))) [(defun bar () ... function called bar." (and (or (not ) t (not t)) (not t) (or (not nil) t t))) ] Thus ECHO now spans the entire code of `bar' and CURRENT the first occurrence of `nil' in `bar'. Finally, I move in the left window up by one line which should restore the previous state of the right window: ------------------------- top of window ------------------- (and (or (not nil) t (not (not t))) t (or t t))) ] (defun bar () ... t called bar." (and (or (not nil) t (not t)) (not t) (or (not nil) t t))) However, the last line of the documentation string of `bar' originally reading function called bar." has been replaced by a line reading t called bar." where all characters preceding `called' are decorated with the ECHO overlay face. Switching to the right window now implicitly removes all overlays. The incriminated line, however, is not restored. As mentioned above, I can restore the original text by simply moving over it. Moving by one character restores one character of the original text. C-l will also restore the original text but this seems less indicative to me since on a "suitably" centered window the bug wouldn't have shown up in the first place. Obviously the bug may be traced back to some sillyness I wrote myself. However, I was not able to reproduce it when I replaced one single character of any of the identical lines of `foo' or `bar', namely the two lines (or (not nil) t and the two lines reading t t))) with a different character. I conjecture that the combined effects of changing the window start of an indirect buffer with invisibility and other overlays vex some redisplay routine based on the comparison of identical pieces of text. Variants of the bug with two or more obscured lines exist. Common to all of them is: (1) The ECHO overlay gets relocated to some position nearer to `point-min' and near the top of the window it appears. (2) An invisibility overlay precedes the obscured lines. (3) Two instances of identic text blocks comprising at least two lines exist. Only text appearing in these blocks obscurs other text. (4) Obscuring text appears at precisely the same window position occupied by identic text before redisplay. The indirect buffer is never modified. Switching on/off font-locking has no impact on the outcome. The scenario sketched above could only describe the symptoms of the bug. Please tell me if you want to reproduce them with my code. Be warned: It's some 7000 elisp lines long. In GNU Emacs 21.3.1 (i386-mingw-windows98.3000) of 2004-03-10 on NYAUMO configured using `configure --with-gcc (3.2)' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: dea locale-coding-system: iso-latin-1 default-enable-multibyte-characters: t -- DSL Komplett von GMX +++ Supergünstig und stressfrei einsteigen! AKTION "Kein Einrichtungspreis" nutzen: http://www.gmx.net/de/go/dsl