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#20410: 24.5.50; cursor not updated after yank of non-ASCII string from the clipboard Date: Sat, 25 Apr 2015 15:32:22 +0300 Message-ID: <83mw1wxuax.fsf@gnu.org> References: <83tww715y7.fsf@gnu.org> <838udiypuz.fsf@gnu.org> <83pp6sy0xo.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1429965711 20662 80.91.229.3 (25 Apr 2015 12:41:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 25 Apr 2015 12:41:51 +0000 (UTC) Cc: 20410@debbugs.gnu.org To: mituharu@math.s.chiba-u.ac.jp Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 25 14:41:37 2015 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 1YlzOq-0004Ty-E7 for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Apr 2015 14:41:36 +0200 Original-Received: from localhost ([::1]:48237 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlzOp-0007oj-OB for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Apr 2015 08:41:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34925) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlzOi-0006ft-AZ for bug-gnu-emacs@gnu.org; Sat, 25 Apr 2015 08:41:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YlzGY-0004sq-IQ for bug-gnu-emacs@gnu.org; Sat, 25 Apr 2015 08:33:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49506) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlzGY-0004sg-Fj for bug-gnu-emacs@gnu.org; Sat, 25 Apr 2015 08:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YlzGX-0008Rb-UY for bug-gnu-emacs@gnu.org; Sat, 25 Apr 2015 08:33:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Apr 2015 12:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20410 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20410-submit@debbugs.gnu.org id=B20410.142996516732438 (code B ref 20410); Sat, 25 Apr 2015 12:33:01 +0000 Original-Received: (at 20410) by debbugs.gnu.org; 25 Apr 2015 12:32:47 +0000 Original-Received: from localhost ([127.0.0.1]:39282 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YlzGI-0008R7-Nd for submit@debbugs.gnu.org; Sat, 25 Apr 2015 08:32:47 -0400 Original-Received: from mtaout26.012.net.il ([80.179.55.182]:46947) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YlzGG-0008Qr-Ac for 20410@debbugs.gnu.org; Sat, 25 Apr 2015 08:32:45 -0400 Original-Received: from conversion-daemon.mtaout26.012.net.il by mtaout26.012.net.il (HyperSendmail v2007.08) id <0NND00F0042E6Q00@mtaout26.012.net.il> for 20410@debbugs.gnu.org; Sat, 25 Apr 2015 15:34:13 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout26.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NND0045L491UL90@mtaout26.012.net.il>; Sat, 25 Apr 2015 15:34:13 +0300 (IDT) In-reply-to: <83pp6sy0xo.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.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:102019 Archived-At: > Date: Sat, 25 Apr 2015 13:09:07 +0300 > From: Eli Zaretskii > Cc: 20410@debbugs.gnu.org > > > 1. Create a file named a.el with the following contents: > > > > (global-set-key "a" (string #x3042)) ; HIRAGANA LETTER A > > > > 2. $ emacs -Q -D -l a.el & > > 3. Type "a" to insert a Japanese character. > > 4. Type "C-p" to move the cursor upward. > > > > Display is updated correctly until Step 3. But Step 4 does not change > > the display from the previous one. > > I succeeded in reproducing this, after changing the default fontset to > use a specific font for the u+3042 character. Thanks, I will look > into this. > > > As for expose events, I suspect the current matrices get corrupted, > > because the result of git bisect implies that it has something to do > > with adjustment of glyph matrices triggered by font loading. > > Sounds plausible, thanks. Adjusting frame glyphs makes all glyph rows disabled, so various redisplay optimizations should be disabled. In particular, new cursor position was correctly computed, but because it was on a disabled glyph row, display_and_set_cursor would not obey that new position, and exposing a window would not redraw the disabled glyph rows. Does the patch below fix the problems you see? (It might look a bit drastic, but then loading new fonts is not supposed to be a frequent operation, I think.) diff --git a/src/dispnew.c b/src/dispnew.c index 693dd49..c0fd679 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -1795,6 +1795,12 @@ struct glyph_row * f->glyphs_initialized_p = 1; + /* Disable all redisplay optimizations for this frame. This is + because adjusting frame glyphs makes all glyph rows disabled, so + many optimizations will fail anyway, and some might not test this + flag and do bogus things. */ + SET_FRAME_GARBAGED (f); + unblock_input (); }