From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#56176: 28.1.50; csv-align-mode misaligns when display-line-numbers-mode is on Date: Mon, 27 Jun 2022 08:55:07 -0400 Message-ID: References: <87pmizjftu.fsf@fastmail.fm> <87zgi2qu3r.fsf@gnus.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4972"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Joost Kremers , 56176@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 27 14:56:19 2022 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 1o5oHr-00016p-GZ for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 27 Jun 2022 14:56:19 +0200 Original-Received: from localhost ([::1]:38154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o5oHp-0001sD-HV for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 27 Jun 2022 08:56:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52146) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5oHa-0001rq-EZ for bug-gnu-emacs@gnu.org; Mon, 27 Jun 2022 08:56:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56378) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o5oHa-0001Yl-6K for bug-gnu-emacs@gnu.org; Mon, 27 Jun 2022 08:56:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o5oHa-0008Mj-1s for bug-gnu-emacs@gnu.org; Mon, 27 Jun 2022 08:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 Jun 2022 12:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56176 X-GNU-PR-Package: emacs Original-Received: via spool by 56176-submit@debbugs.gnu.org id=B56176.165633451932109 (code B ref 56176); Mon, 27 Jun 2022 12:56:01 +0000 Original-Received: (at 56176) by debbugs.gnu.org; 27 Jun 2022 12:55:19 +0000 Original-Received: from localhost ([127.0.0.1]:50275 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5oGt-0008Lo-Bn for submit@debbugs.gnu.org; Mon, 27 Jun 2022 08:55:19 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:37208) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5oGr-0008La-LN for 56176@debbugs.gnu.org; Mon, 27 Jun 2022 08:55:18 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id BD6328076B; Mon, 27 Jun 2022 08:55:11 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id DCB4D80699; Mon, 27 Jun 2022 08:55:09 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1656334509; bh=N4G7ZlyDui1KzargrcooZsVvrBL5oGG4cMsFXNiGZNg=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Ms+++V1pZlftNHvniJEAjW90XG63mnTcK3/z5z8nM7yw2qWuLRR0IyYa+qPtM/MPZ vJ95t1HI32+kw4/bK7fbn5FBrF5TOo7WLNsOmI9ePbP/Zpah4/Iy2JcBfHsfAIdK1u ZjqWlq44Rq/IaRfRozu+0Tm+sTMnf+NtqkwpXPahVo3Wu48P5rl/uKe52Oyx/i7sHB cQ2E35ztZuT1/9vZ5wTbp5lA583jSysofs8xT57J1muc8YFbDkFjnEPxYiNH6Y/Ylb Vbcd3qTZKNcPYbSSQd0eoyJi17g/SvVJfbeEZUATGsYnt0jjvsPTRb01GM/XLwr6pj tCXna58KUUIKg== Original-Received: from alfajor (smb-adp04.hotspot.hub-one.net [213.174.99.154]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 3D4181201CA; Mon, 27 Jun 2022 08:55:09 -0400 (EDT) In-Reply-To: <87zgi2qu3r.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 24 Jun 2022 11:38:32 +0200") 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:235450 Archived-At: Lars Ingebrigtsen [2022-06-24 11:38:32] wrote: > Joost Kremers writes: >> I work with csv files with long lines, which do not fit the window. If I >> activate csv-align-mode and display-line-numbers-mode, then move to the end of a >> line (so that the first few columns are not visible anymore), the columns that >> are visible are no longer properly aligned. If I disable >> display-line-numbers-mode, they are propely aligned again. >> >> I could attach some screen shots showing the problem, but I'm not sure >> attachments are allowed here. Let me know if I should. > Attachments are allowed, but I can reproduce the problem without them. > The problem seems to be in the computations in csv--jit-align, which > don't take the line numbers mode area into account. But after poking at > it for a couple of minutes, it's not immediately clear to me what the > algorithm is actually doing, so I've added Stefan to the CCs. I'm not sure the problem is on `csv-mode.el`, tho. I just tried it on a TSV file of mine where I can indeed see incorrect alignment (tho it is correct both when displaying the leftmost columns and when displaying the rightmost column: the errors show up only when I scrolled in the middle for me). But when I look with `C-u C-x =` at the TAB separator between two columns, I see that two misaligned separators both show: display (space :align-to 63) and when I try `M-: (current-column)` I see that one of them says 60 and the other says 61, so both elastic spaces *should* end at the same column 63, AFAICT, even tho they clearly don't on my screen. Also, the 60 -vs- 61 is odd because the column position on screen of those two positions differs by 3 rather than by 1, according to my eyes. So, my crystal ball suggests the error might be in the redisplay. Stefan