From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#13623: 24.3.50; Redisplay issue with transient-mark-mode Date: Tue, 05 Feb 2013 19:45:42 +0200 Message-ID: <83fw1aac3d.fsf@gnu.org> References: <877gmp5a04.fsf@ed.ac.uk> <83vca89izh.fsf@gnu.org> <5110906D.7020406@yandex.ru> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1360086424 16993 80.91.229.3 (5 Feb 2013 17:47:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Feb 2013 17:47:04 +0000 (UTC) Cc: wence@gmx.li, 13623@debbugs.gnu.org To: Dmitry Antipov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 05 18:47:21 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U2mc3-0004D2-13 for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Feb 2013 18:47:19 +0100 Original-Received: from localhost ([::1]:40911 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U2mbk-000546-BZ for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Feb 2013 12:47:00 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:37810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U2mbc-00053u-Ht for bug-gnu-emacs@gnu.org; Tue, 05 Feb 2013 12:46:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U2mba-00007R-RO for bug-gnu-emacs@gnu.org; Tue, 05 Feb 2013 12:46:52 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60962) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U2mba-00007F-NJ for bug-gnu-emacs@gnu.org; Tue, 05 Feb 2013 12:46:50 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1U2mcj-0007CU-R1 for bug-gnu-emacs@gnu.org; Tue, 05 Feb 2013 12:48:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Feb 2013 17:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13623 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13623-submit@debbugs.gnu.org id=B13623.136008642727586 (code B ref 13623); Tue, 05 Feb 2013 17:48:01 +0000 Original-Received: (at 13623) by debbugs.gnu.org; 5 Feb 2013 17:47:07 +0000 Original-Received: from localhost ([127.0.0.1]:38192 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U2mbq-0007At-Ln for submit@debbugs.gnu.org; Tue, 05 Feb 2013 12:47:06 -0500 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:47496) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U2mbn-0007Ai-Qw for 13623@debbugs.gnu.org; Tue, 05 Feb 2013 12:47:05 -0500 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MHR00000D7LE900@a-mtaout22.012.net.il> for 13623@debbugs.gnu.org; Tue, 05 Feb 2013 19:45:31 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MHR00NI7DBU29C0@a-mtaout22.012.net.il>; Tue, 05 Feb 2013 19:45:31 +0200 (IST) In-reply-to: <5110906D.7020406@yandex.ru> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:70721 Archived-At: > Date: Tue, 05 Feb 2013 08:54:05 +0400 > From: Dmitry Antipov > CC: Lawrence Mitchell , 13623@debbugs.gnu.org > > > - /* If showing the region, and mark has changed, we must redisplay > > - the whole window. The assignment to this_line_start_pos prevents > > - the optimization directly below this if-statement. */ > > - if (((!NILP (Vtransient_mark_mode) > > - && !NILP (BVAR (XBUFFER (w->buffer), mark_active))) > > - != !NILP (w->region_showing)) > > - || (!NILP (w->region_showing) > > - && !EQ (w->region_showing, > > - Fmarker_position (BVAR (XBUFFER (w->buffer), mark))))) > > - CHARPOS (this_line_start_pos) = 0; > > Hm. Although this is an obvious bug, are you sure that we must redisplay > the whole window even if the region doesn't span multiple lines? IIUC > it should be enough to redisplay the current line only. As long as we don't restrict the 'region' face to a very small subset of possible face customizations (e.g., just the background and the foreground colors), and ignore the other attributes, an arbitrary face change on one line might potentially affect many more lines in the window. E.g., try customizing the 'region' face to twice its normal height. And I'm not sure this is worth optimizing anyway: region changes are relatively rare and almost always driven by user input, so I don't think redisplay will become significantly faster as result of any optimizations in this area.