From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#46590: 27.1.91; abnormal whitespace-mode behavior Date: Sat, 20 Feb 2021 11:27:25 +0200 Message-ID: <837dn3143m.fsf@gnu.org> References: <20210217150614.1eaecfdd@Cornafion.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39544"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 46590@debbugs.gnu.org To: =?UTF-8?Q?Fr=C3=A9d=C3=A9ric?= Baldit Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 20 10:28:09 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 1lDOYb-000ACj-Pz for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Feb 2021 10:28:09 +0100 Original-Received: from localhost ([::1]:40642 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lDOYa-0003dy-Ku for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Feb 2021 04:28:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56698) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lDOYU-0003dk-9V for bug-gnu-emacs@gnu.org; Sat, 20 Feb 2021 04:28:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39462) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lDOYU-0003t6-2L for bug-gnu-emacs@gnu.org; Sat, 20 Feb 2021 04:28:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lDOYT-0007KS-Uc for bug-gnu-emacs@gnu.org; Sat, 20 Feb 2021 04:28:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Feb 2021 09:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46590 X-GNU-PR-Package: emacs Original-Received: via spool by 46590-submit@debbugs.gnu.org id=B46590.161381327328151 (code B ref 46590); Sat, 20 Feb 2021 09:28:01 +0000 Original-Received: (at 46590) by debbugs.gnu.org; 20 Feb 2021 09:27:53 +0000 Original-Received: from localhost ([127.0.0.1]:51008 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lDOYK-0007Jy-Mh for submit@debbugs.gnu.org; Sat, 20 Feb 2021 04:27:52 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:38824) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lDOYG-0007Jj-K6 for 46590@debbugs.gnu.org; Sat, 20 Feb 2021 04:27:51 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:41151) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lDOYA-0003kx-Rr; Sat, 20 Feb 2021 04:27:42 -0500 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3541 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lDOYA-0005sX-3O; Sat, 20 Feb 2021 04:27:42 -0500 In-Reply-To: <20210217150614.1eaecfdd@Cornafion.lan> (message from =?UTF-8?Q?Fr=C3=A9d=C3=A9ric?= Baldit on Wed, 17 Feb 2021 15:06:14 +0100) 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:200409 Archived-At: > Date: Wed, 17 Feb 2021 15:06:14 +0100 > From: Frédéric Baldit > > emacs -Q test.txt & > > 2) M-x whitespace-mode RET > > 3) type the following text («.» for spacebar key): > > «....First line of text in emacs», then type RET > > 4) DEL DEL to suppress backward two spaces on line 2, then type text > «Second one» > > 5) M-2 M-b > > 6) TAB TAB TAB TAB: point should be at line 2, column 18, vertically > aligned with fourth word of line 1 («text»), but it is at column 26: > that's the bug. It's a known misfeature of whitespace-mode. There's a comment in whitespace.el to that effect: ;; WARNING: the mapping below has a problem. ;; When a TAB occupies exactly one column, it will display the ;; character ?\xBB at that column followed by a TAB which goes to ;; the next TAB column. ;; If this is a problem for you, please, comment the line below. (tab-mark ?\t [?» ?\t] [?\\ ?\t]) ; tab - right guillemet You could customize whitespace-display-mappings to remove tab-mark from it, if you want to avoid this issue. > Rq1: what is curious (to me) is that deactivating whitespace-mode > removes abnormally inserted tab character (8 spaces) and everything is > OK. That's because disabling whitespace-mode deactivates the display-table mappings, which include the above mapping. > Rq2: I noted that with a different text, this behavior of > whitespace-mode disappears. For example, if one uses the following first > line of text: > > «....This.is.a.first.line.of.text.with.a.few.words», > > then the result of typing TAB multiple times is as expected, with or > without whitespace-mode activated! Most probably because the "TAB occupies exactly one column" condition doesn't happen there. Thanks.