From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.devel Subject: Re: Truncating scroll runs that copy to where we copied to Date: Tue, 22 Nov 2011 16:26:41 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: <8339dibqlc.fsf@gnu.org> <6D358885-0CD8-4FC0-9598-549AB7E3D4AC@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: dough.gmane.org 1321946816 14818 80.91.229.12 (22 Nov 2011 07:26:56 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 22 Nov 2011 07:26:56 +0000 (UTC) Cc: David Reitter , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 22 08:26:52 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RSkkl-00030F-E8 for ged-emacs-devel@m.gmane.org; Tue, 22 Nov 2011 08:26:51 +0100 Original-Received: from localhost ([::1]:56737 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSkkk-0000zi-BQ for ged-emacs-devel@m.gmane.org; Tue, 22 Nov 2011 02:26:50 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:39932) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSkki-0000zd-2o for emacs-devel@gnu.org; Tue, 22 Nov 2011 02:26:48 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RSkkh-0003nB-7B for emacs-devel@gnu.org; Tue, 22 Nov 2011 02:26:48 -0500 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:59353) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSkkf-0003mL-7M; Tue, 22 Nov 2011 02:26:45 -0500 Original-Received: from church.math.s.chiba-u.ac.jp (church [133.82.132.36]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 83E69C0561; Tue, 22 Nov 2011 16:26:41 +0900 (JST) In-Reply-To: User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) X-detected-operating-system: by eggs.gnu.org: NetBSD 3.0 (DF) X-Received-From: 133.82.132.2 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:146135 Archived-At: >>>>> On Tue, 22 Nov 2011 01:04:45 -0500, Eli Zaretskii said: > You can help if you explain in more detail what is wrong with the > current code. That is what I need to assess the correctness of the > patch. I hoped that Yamamoto-san would do that. Failing that, I'll > need to figure it out myself, which will take more time, and thus > will have to wait a couple of days until I have that time to sit > down and look into this. I do intend to do that, make no mistake. Actually, I told what was wrong with the current code in my first post: >>>>> On Sun, 20 Nov 2011 16:13:59 +0900, YAMAMOTO Mitsuharu said: > I think that `scrolling_window' needs to truncate scroll runs that > copy to where we copied to; otherwise, `assign_row (to, from)' > assigns a previously disabled bogus row in the desired matrix when > we have an overlap in the copy destination. /* Assign matrix rows. */ for (j = 0; j < r->nrows; ++j) { struct glyph_row *from, *to; int to_overlapped_p; to = MATRIX_ROW (current_matrix, r->desired_vpos + j); from = MATRIX_ROW (desired_matrix, r->desired_vpos + j); to_overlapped_p = to->overlapped_p; from->redraw_fringe_bitmaps_p = from->fringe_bitmap_periodic_p; assign_row (to, from); to->enabled_p = 1, from->enabled_p = 0; to->overlapped_p = to_overlapped_p; } If there's an overlap (I don't mean the variable to_overlapped_p) in the copy destinations of two runs, then `from' row in the desired matrix becomes a bogus one that had been in the current matrix after processing the first run (because assign_row actually does swap), and that row is disabled by `from->enabled_p = 0'. So, when processing the second run, the `from' row is now the previously disabled bogus row and it is assigned to a row in the current matrix. YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp