From unknown Wed Sep 10 19:32:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#9149: 24.0.50; regression on mouse-face for completions Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 Jul 2011 14:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 9149 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 9149@debbugs.gnu.org X-Debbugs-Original-To: Received: via spool by submit@debbugs.gnu.org id=B.131134663810872 (code B ref -1); Fri, 22 Jul 2011 14:58:02 +0000 Received: (at submit) by debbugs.gnu.org; 22 Jul 2011 14:57:18 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QkHAE-0002pJ-Cn for submit@debbugs.gnu.org; Fri, 22 Jul 2011 10:57:18 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QkHAC-0002p7-Cz for submit@debbugs.gnu.org; Fri, 22 Jul 2011 10:57:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QkHA6-0003uS-K4 for submit@debbugs.gnu.org; Fri, 22 Jul 2011 10:57:11 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:38939) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkHA6-0003uO-IZ for submit@debbugs.gnu.org; Fri, 22 Jul 2011 10:57:10 -0400 Received: from eggs.gnu.org ([140.186.70.92]:46078) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkHA5-0002ND-JA for bug-gnu-emacs@gnu.org; Fri, 22 Jul 2011 10:57:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QkHA4-0003th-A4 for bug-gnu-emacs@gnu.org; Fri, 22 Jul 2011 10:57:09 -0400 Received: from rcsinet15.oracle.com ([148.87.113.117]:26212) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkHA4-0003rU-45 for bug-gnu-emacs@gnu.org; Fri, 22 Jul 2011 10:57:08 -0400 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by rcsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id p6MEv2tY008659 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 22 Jul 2011 14:57:04 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p6MEv1ed029085 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 22 Jul 2011 14:57:02 GMT Received: from abhmt117.oracle.com (abhmt117.oracle.com [141.146.116.69]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p6MEuusn011999 for ; Fri, 22 Jul 2011 09:56:56 -0500 Received: from dradamslap1 (/10.159.44.149) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 22 Jul 2011 07:56:56 -0700 From: "Drew Adams" Date: Fri, 22 Jul 2011 07:56:56 -0700 Message-ID: <5AD5B9D01FE74B009E3E5697483A6E47@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6109 Thread-Index: AcxIf5mYlH1BlsxCTp616omd3wbDEg== X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090202.4E298FC1.000C:SCFMA922111,ss=1,re=-4.000,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -6.2 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) This bug seems to have been introduced between the published Windows builds of 2010-10-19 (no bug) and 2010-10-25 (bug). I tried to examine changes made to the sources during that week, but didn't see anything super obvious as the cause. What might have introduced the bug was this change (just a guess): Eli Zaretskii2010-10-23 15:30:45(101157.1.16 test) Revision ID: eliz@gnu.org-20101023153045-9zcud9tw7y2p7b3a Implement mouse highlight for bidi-reordered lines. xdisp.c (fast_find_string_pos): #ifdef away, not used anymore. (mouse_face_from_string_pos): New function, replaces fast_find_string_pos. (note_mouse_highlight): Call it instead of fast_find_string_pos. (note_mode_line_or_margin_highlight): Support bidi-reordered strings and R2L glyph rows. Fix comments. (note_mouse_highlight): When bidi reordering is turned on in a buffer, call next-single-property-change and previous-single-property-change with last argument nil. Clear mouse highlight when mouse pointer is in a R2L row on the stretch glyph that stands for no text beyond the line end. (row_containing_pos): Don't return too early when CHARPOS is in a bidi-reordered continued line. Return immediately when the first hit is found in a line that is not continued, or when an exact match for CHARPOS is found. (rows_from_pos_range): New function. (mouse_face_from_buffer_pos): Use it instead of calling row_containing_pos for START_CHARPOS and END_CHARPOS. Rewrite the function to support mouse highlight in bidi-reordered lines and not to assume that START_CHARPOS is always in mouse_face_beg_row. If necessary, swap mouse_face_beg_row and mouse_face_end_row so that the former is always above the latter or identical to it. (show_mouse_face): Support drawing highlighted R2L lines. (coords_in_mouse_face_p): New function, bidi-aware. (cursor_in_mouse_face_p, note_mouse_highlight, erase_phys_cursor): Call it instead of comparing with mouse-face members of dpyinfo. (note_mode_line_or_margin_highlight): Fix confusingly swapped usage of hpos and vpos. files modified: src/ChangeLog src/xdisp.c The bug is that the `mouse-face' highlighting is not applied to an entire completion candidate, if that candidate is multiline and it contains an empty line. What happens is that the `mouse-face' highlighting stops as soon as the empty line (i.e., \n$) is encountered. The rest of the text of the candidate does not have the `mouse-face' highlighting. Here's a recipe to reproduce the problem: emacs -Q Evaluate this code: (setq foo '(("abcdefgh ijklmn opqrst uvwxyz abcde") ("123456 7890123 45678 9012345 678901 23456"))) (completing-read "ff: " foo) When you evaluate the `completing-read' call, move the mouse pointer over the two candidates in *Completions*. Each candidate should be completely `mouse-face' highlighted, but is not. The highlighting of each candidate stops as soon as the first blank line within the candidate is encountered. In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600) of 2011-07-18 on 3249CTO Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (4.5) --no-opt --cflags -Ic:/build/include' From unknown Wed Sep 10 19:32:14 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: "Drew Adams" Subject: bug#9149: closed (Re: bug#9149: 24.0.50; regression on mouse-face for completions) Message-ID: References: <83aac6dx9x.fsf@gnu.org> <5AD5B9D01FE74B009E3E5697483A6E47@us.oracle.com> X-Gnu-PR-Message: they-closed 9149 X-Gnu-PR-Package: emacs Reply-To: 9149@debbugs.gnu.org Date: Fri, 22 Jul 2011 17:46:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1311356762-26113-1" This is a multi-part message in MIME format... ------------=_1311356762-26113-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #9149: 24.0.50; regression on mouse-face for completions which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 9149@debbugs.gnu.org. --=20 9149: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D9149 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1311356762-26113-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 9149-done) by debbugs.gnu.org; 22 Jul 2011 17:45:55 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QkJnO-0006mq-VR for submit@debbugs.gnu.org; Fri, 22 Jul 2011 13:45:55 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QkJnN-0006md-25 for 9149-done@debbugs.gnu.org; Fri, 22 Jul 2011 13:45:53 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0LOQ00I00X9UFO00@a-mtaout20.012.net.il> for 9149-done@debbugs.gnu.org; Fri, 22 Jul 2011 20:45:41 +0300 (IDT) Received: from HOME-C4E4A596F7 ([84.229.133.66]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LOQ00IVHXC4F910@a-mtaout20.012.net.il>; Fri, 22 Jul 2011 20:45:41 +0300 (IDT) Date: Fri, 22 Jul 2011 20:45:46 +0300 From: Eli Zaretskii Subject: Re: bug#9149: 24.0.50; regression on mouse-face for completions In-reply-to: <5AD5B9D01FE74B009E3E5697483A6E47@us.oracle.com> X-012-Sender: halo1@inter.net.il To: Drew Adams Message-id: <83aac6dx9x.fsf@gnu.org> References: <5AD5B9D01FE74B009E3E5697483A6E47@us.oracle.com> X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 9149-done Cc: 9149-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.0 (--) > From: "Drew Adams" > Date: Fri, 22 Jul 2011 07:56:56 -0700 > > This bug seems to have been introduced between the published Windows > builds of 2010-10-19 (no bug) and 2010-10-25 (bug). I tried to examine > changes made to the sources during that week, but didn't see anything > super obvious as the cause. > > What might have introduced the bug was this change (just a guess): > > Eli Zaretskii2010-10-23 15:30:45(101157.1.16 test) > Revision ID: eliz@gnu.org-20101023153045-9zcud9tw7y2p7b3a > > Implement mouse highlight for bidi-reordered lines. Yes, it was my fault. Should be fixed now. Thanks for the test case. ------------=_1311356762-26113-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 22 Jul 2011 14:57:18 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QkHAE-0002pJ-Cn for submit@debbugs.gnu.org; Fri, 22 Jul 2011 10:57:18 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QkHAC-0002p7-Cz for submit@debbugs.gnu.org; Fri, 22 Jul 2011 10:57:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QkHA6-0003uS-K4 for submit@debbugs.gnu.org; Fri, 22 Jul 2011 10:57:11 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:38939) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkHA6-0003uO-IZ for submit@debbugs.gnu.org; Fri, 22 Jul 2011 10:57:10 -0400 Received: from eggs.gnu.org ([140.186.70.92]:46078) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkHA5-0002ND-JA for bug-gnu-emacs@gnu.org; Fri, 22 Jul 2011 10:57:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QkHA4-0003th-A4 for bug-gnu-emacs@gnu.org; Fri, 22 Jul 2011 10:57:09 -0400 Received: from rcsinet15.oracle.com ([148.87.113.117]:26212) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkHA4-0003rU-45 for bug-gnu-emacs@gnu.org; Fri, 22 Jul 2011 10:57:08 -0400 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by rcsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id p6MEv2tY008659 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 22 Jul 2011 14:57:04 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p6MEv1ed029085 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 22 Jul 2011 14:57:02 GMT Received: from abhmt117.oracle.com (abhmt117.oracle.com [141.146.116.69]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p6MEuusn011999 for ; Fri, 22 Jul 2011 09:56:56 -0500 Received: from dradamslap1 (/10.159.44.149) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 22 Jul 2011 07:56:56 -0700 From: "Drew Adams" To: Subject: 24.0.50; regression on mouse-face for completions Date: Fri, 22 Jul 2011 07:56:56 -0700 Message-ID: <5AD5B9D01FE74B009E3E5697483A6E47@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6109 Thread-Index: AcxIf5mYlH1BlsxCTp616omd3wbDEg== X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090202.4E298FC1.000C:SCFMA922111,ss=1,re=-4.000,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -6.2 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) This bug seems to have been introduced between the published Windows builds of 2010-10-19 (no bug) and 2010-10-25 (bug). I tried to examine changes made to the sources during that week, but didn't see anything super obvious as the cause. What might have introduced the bug was this change (just a guess): Eli Zaretskii2010-10-23 15:30:45(101157.1.16 test) Revision ID: eliz@gnu.org-20101023153045-9zcud9tw7y2p7b3a Implement mouse highlight for bidi-reordered lines. xdisp.c (fast_find_string_pos): #ifdef away, not used anymore. (mouse_face_from_string_pos): New function, replaces fast_find_string_pos. (note_mouse_highlight): Call it instead of fast_find_string_pos. (note_mode_line_or_margin_highlight): Support bidi-reordered strings and R2L glyph rows. Fix comments. (note_mouse_highlight): When bidi reordering is turned on in a buffer, call next-single-property-change and previous-single-property-change with last argument nil. Clear mouse highlight when mouse pointer is in a R2L row on the stretch glyph that stands for no text beyond the line end. (row_containing_pos): Don't return too early when CHARPOS is in a bidi-reordered continued line. Return immediately when the first hit is found in a line that is not continued, or when an exact match for CHARPOS is found. (rows_from_pos_range): New function. (mouse_face_from_buffer_pos): Use it instead of calling row_containing_pos for START_CHARPOS and END_CHARPOS. Rewrite the function to support mouse highlight in bidi-reordered lines and not to assume that START_CHARPOS is always in mouse_face_beg_row. If necessary, swap mouse_face_beg_row and mouse_face_end_row so that the former is always above the latter or identical to it. (show_mouse_face): Support drawing highlighted R2L lines. (coords_in_mouse_face_p): New function, bidi-aware. (cursor_in_mouse_face_p, note_mouse_highlight, erase_phys_cursor): Call it instead of comparing with mouse-face members of dpyinfo. (note_mode_line_or_margin_highlight): Fix confusingly swapped usage of hpos and vpos. files modified: src/ChangeLog src/xdisp.c The bug is that the `mouse-face' highlighting is not applied to an entire completion candidate, if that candidate is multiline and it contains an empty line. What happens is that the `mouse-face' highlighting stops as soon as the empty line (i.e., \n$) is encountered. The rest of the text of the candidate does not have the `mouse-face' highlighting. Here's a recipe to reproduce the problem: emacs -Q Evaluate this code: (setq foo '(("abcdefgh ijklmn opqrst uvwxyz abcde") ("123456 7890123 45678 9012345 678901 23456"))) (completing-read "ff: " foo) When you evaluate the `completing-read' call, move the mouse pointer over the two candidates in *Completions*. Each candidate should be completely `mouse-face' highlighted, but is not. The highlighting of each candidate stops as soon as the first blank line within the candidate is encountered. In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600) of 2011-07-18 on 3249CTO Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (4.5) --no-opt --cflags -Ic:/build/include' ------------=_1311356762-26113-1--