From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#50660: 28.0.50; Text artifacting when the cursor moves over text under mouse face that originally displayed a box Date: Sat, 02 Oct 2021 17:46:14 +0800 Message-ID: <87mtnrdajd.fsf@yahoo.com> References: <87czp6ysw7.fsf.ref@yahoo.com> <838rzs4i09.fsf@gnu.org> <87fsu06oxi.fsf@yahoo.com> <83ee9j3ju3.fsf@gnu.org> <834kaf3ets.fsf@gnu.org> <8335pz3dli.fsf@gnu.org> <87r1dj4q4m.fsf@yahoo.com> <83zgs71su7.fsf@gnu.org> <87k0jb4k5l.fsf@yahoo.com> <83sfxz1pw0.fsf@gnu.org> <87o88m14g0.fsf@yahoo.com> <83sfxyxeer.fsf@gnu.org> <87h7ee1252.fsf@yahoo.com> <83pmt2xcox.fsf@gnu.org> <87lf3myhlb.fsf@yahoo.com> <87a6jzvnpq.fsf@yahoo.com> <83o88fom1k.fsf@gnu.org> <871r5bvex8.fsf@yahoo.com> <83v92mkzft.fsf@gnu.org> <87k0j0rwo3.fsf@yahoo.com> <838rzbddfa.fsf@gnu.org> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6743"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: larsi@gnus.org, 50660@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 02 11:47:16 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mWbbw-0001Ws-7e for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 Oct 2021 11:47:16 +0200 Original-Received: from localhost ([::1]:53280 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWbbv-0005mi-4n for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 Oct 2021 05:47:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33260) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWbbi-0005mY-QJ for bug-gnu-emacs@gnu.org; Sat, 02 Oct 2021 05:47:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46332) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWbbi-0004XJ-J9 for bug-gnu-emacs@gnu.org; Sat, 02 Oct 2021 05:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mWbbi-0006Uw-F3 for bug-gnu-emacs@gnu.org; Sat, 02 Oct 2021 05:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Oct 2021 09:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50660 X-GNU-PR-Package: emacs Original-Received: via spool by 50660-submit@debbugs.gnu.org id=B50660.163316799224942 (code B ref 50660); Sat, 02 Oct 2021 09:47:02 +0000 Original-Received: (at 50660) by debbugs.gnu.org; 2 Oct 2021 09:46:32 +0000 Original-Received: from localhost ([127.0.0.1]:57878 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWbbE-0006UE-Ip for submit@debbugs.gnu.org; Sat, 02 Oct 2021 05:46:32 -0400 Original-Received: from sonic304-20.consmr.mail.ne1.yahoo.com ([66.163.191.146]:37355) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWbbB-0006Tw-OK for 50660@debbugs.gnu.org; Sat, 02 Oct 2021 05:46:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1633167983; bh=/bF4MGxa0sAEgaD3yjiP4QMLYTPK3qeNHv/9Gc3w/Yo=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=V/mUaDjq9SPEmE+Seki94g73qr5soJawjmSgSeYGspWE3HlDoNR/81qWWM/5rknW36grj0pAC/B34BT//nfskg8z+Jr4/7nwHv69nFVaXhdpbV3VZx1jjcmNTDw+/7dQr9RP+i/wJjet0X67oPA3crW03pUaxvgjKmCiV69Xus7NzjxZvTXDSeefeT5KW8WW22eISbPyhJ25wsI53TIbaSKOdtnXPrNk0OUnWwqhdjuIuv8ha97NkPgeG4DE+pryq+Th0pf1MleTHTuTZcq9t0NBJTg/U2kgZwMBXnp53gkvI81Yodk8Dco/Qqv78z9cH2E6hh9cInzxplQ6s2m4DQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1633167984; bh=ZUqiYQi7zKpWhrBWUqpL/76gtaLl0C/s5vkR7DQN8UH=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=m3VrCVffhVq04j+NQEheYUeNwdR1RXJJxcmRMS/BUWxXyb8+wu+VjrarrvQMyTj9d3COBiA90OSC/3Yi/8M2kae4q4DrqoJHqUaemx5XrjvnSWGs514fGxFovEBBoC4zpX9BRhtoiKU8jn1XM5v58Y8nr1mf79wh6CyeIATdVLFk2IJTK3vMagfw4KZa7f/8RKvJhf/2Jzos/tqtU4a+UtX7fSNS/nWkwF4+z+SJ+vgkduS540euuG8XTVHSslE0yhG2w/jUpxmbqjc8uFz/3Hy0+hcQjuNAoeRcXy6Vz5e3IVTk5S7VnwKLqbRXcla/Phn1dt+iAJRbBiis1rPOyA== X-YMail-OSG: 5hEk7p0VM1kzPfxA1iXoJyEfWwIaxhU5sAPSuytxvCcCY5GQkToaI.z7sWXiEOf j2b0x6.MfsrwQkTQqlLYhZ5yVUuLNNDy9613wSTQLzR8llZnhT.f7tX2nTFdzV3gwJoZRu4doP3q VDPBgQJO8NsMsn4Vp22gh1.03x_Qh2xfy10bch0dXDUp37is8goMKZvhrtWgik9jtfz3z6Svkh8I _q9EmuxsW9tA4.cxX3N2BAwHgo1TDP7zvjTof4pFgyAX80AyHWQIEwfnm5yOGwGnOVvVw8E8cYuV i2ghRKHBpnFf59ArIbyCo8J1IYTwIjQ612uQhY7VsM8X4vtpZ7N3KDhl7tFoiJsudShv.OVSaKbw ga6u7UlDCLK06.HVPAwHDcIRhLCDZ33XTsvYLIZ2PxyLyspU3Y9b8vsU3q2kLJwWyFU9w7VA9qwR olxD2Q8RDoXYUJl2YKi0x82v1ox6qY7W0yrtKPJKpNUjOH_JNn2KZaatqNstkOw.j_s1bq.wDRvQ 1TsgjLBOUizoYSxWUyh8Cq_YvT3Dmt2yJpjcNVJvRROm_ioLLkB7Yu0zYSYit7vPy9tbCrMzxi.c CXuDo_lWufv7pAVGLpoMsZUdq1YDoIYQl6iDEwwSoGpyQqc5g7tX20itRVOdSNsWXPKd3Pn72nUi 175om1Ju9h1Ii31NrjWsiL22keilAjl4ifH9jWVUXFMgAgzFvV8UrkLJ7BhX2efSClYABPinpDEw 64ERya7gKrWckA_MUYDKw08FXkwPn_utouPVJprQbuBPfBdjhOWTUcnFVqi0jdXWNI.CSJko__cM vfbzeLynG9I3dD4BffkarnXnA0HnUsadhXOrS_nZ2G X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.ne1.yahoo.com with HTTP; Sat, 2 Oct 2021 09:46:23 +0000 Original-Received: by kubenode516.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 5eed3052e5761a75dff57b6e2f619506; Sat, 02 Oct 2021 09:46:17 +0000 (UTC) In-Reply-To: <838rzbddfa.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 02 Oct 2021 11:43:53 +0300") X-Mailer: WebService/1.1.19076 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:216118 Archived-At: Eli Zaretskii writes: > Thanks, this looks almost right to me, see the minor stylistic > comments and questions below. (I didn't yet have time to try the > patch, but if you did try it in all the relevant combinations, > including R2L text, that's good enough for me.) I tried to make it work with RTL text, but right now I don't have access to the machine where I developed that patch, so I wasn't able to test it. (For me to move code between machines at work onto my personal machine is difficult due to the policies of my organization. But they have no issue with making the changes public. Oh well, can't convince the suits.) I will correct the issues ASAP. > But it looks like the code in both conditions is the same? More > generally, what kind of problem specific to images does this part try > to handle? Thanks, I think that's a problem. The conditions should be different depending on whether or not the row is reversed, because produce_image_glyph uses start_of_box_run_p and end_of_box_run_p, which AFAIU is unaffected by the row being reversed. This part exists to take into account produce_image_glyph testing for several conditions being met before appending the box width to the iterator. (See this part of produce_image_glyph, somewhere around line 29542:) if (it->start_of_box_run_p && slice.x == 0) ^^^^^^^^^^^^ it->pixel_width += face->box_vertical_line_width; if (it->end_of_box_run_p && slice.x + slice.width == img->width) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it->pixel_width += face->box_vertical_line_width; I suppose it should be made a comment. That will be done shortly, thanks. >> + if (do_left_box_p) >> + *offset -= max (0, regular_face->box_vertical_line_width); >> + /* Likewise with the right box line, as there may be a >> + box there as well. */ >> + if (do_right_box_p) >> + *offset -= max (0, regular_face->box_vertical_line_width); > There's no reason to use -= and += here. The callers never initialize > the argument to anything but zero, nor should they. This function > _calculates_ the offset, it doesn't _correct_ it. So a simple > assignment should do better, because using the above begs the > question: what could the initial value be? The callers should add or > subtract the corrections as they see fit. Yes, that one is specifically one of my vices. Thanks for pointing it out.