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#64395: [PATCH] * src/xdisp.c (display_string): Don't truncate mode line in terminal Date: Sat, 01 Jul 2023 15:47:39 +0300 Message-ID: <83ttunpzmc.fsf@gnu.org> References: <20230701062756.78266-1-gongqijian@gmail.com> <83zg4gqdef.fsf@gnu.org> <834jmnrjzv.fsf@gnu.org> <831qhrrjlb.fsf@gnu.org> <83zg4fq48r.fsf@gnu.org> <83wmzjq1sf.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36303"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 64395@debbugs.gnu.org To: gongqijian@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 01 14:48:21 2023 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 1qFa1T-0009FS-NM for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 01 Jul 2023 14:48:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qFa1E-0006xq-IG; Sat, 01 Jul 2023 08:48:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFa1C-0006wu-QV for bug-gnu-emacs@gnu.org; Sat, 01 Jul 2023 08:48:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFa1C-0001V9-HI for bug-gnu-emacs@gnu.org; Sat, 01 Jul 2023 08:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qFa1B-0000x5-TK for bug-gnu-emacs@gnu.org; Sat, 01 Jul 2023 08:48:01 -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, 01 Jul 2023 12:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64395 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 64395-submit@debbugs.gnu.org id=B64395.16882156363446 (code B ref 64395); Sat, 01 Jul 2023 12:48:01 +0000 Original-Received: (at 64395) by debbugs.gnu.org; 1 Jul 2023 12:47:16 +0000 Original-Received: from localhost ([127.0.0.1]:56955 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFa0S-0000tW-3d for submit@debbugs.gnu.org; Sat, 01 Jul 2023 08:47:16 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:34144) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFa0O-0000tF-NZ for 64395@debbugs.gnu.org; Sat, 01 Jul 2023 08:47:14 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFa0J-0001Jn-Cb; Sat, 01 Jul 2023 08:47:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=4Bgy9oKGbv7jWH9vjcedHHZodpmtCrOAvWTiN1fTLXM=; b=SFqn3yMDOFD8 KYmaa/r5h9F8wecMGdHTo++XiwkTIqep+oLjBZNhkaSePm5Ngd/Ixfb0cbKwU8RiMriowt6SS5Ngj mf2bNXWzz7af74+Qs3HLUYTOq4bUG+8sXGnQ10DKeMYBEl8lADsuipxKPBl3SiywsCuV0jWd6LSzK Xw0K5tZhxBMHAOtVACuM5TWZ40IOGrDXwUlT7RvaQHDCsBr1p17T5UuUyQSesOTiT5TJQ5aBWOAvp xjlPyykdi0BLuV72YdF9BFxjDCEczpy/0oSsKGv5e+OZZOQ4ztJbZYfMWWCOHTq0INQfK3Jiy9t8X G/nfLz2mkRjUORhqh8lfrg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFa0I-0007fQ-T6; Sat, 01 Jul 2023 08:47:07 -0400 In-Reply-To: <83wmzjq1sf.fsf@gnu.org> (message from Eli Zaretskii on Sat, 01 Jul 2023 15:00:48 +0300) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:264403 Archived-At: > Cc: 64395@debbugs.gnu.org > Date: Sat, 01 Jul 2023 15:00:48 +0300 > From: Eli Zaretskii > > > From: qijian gong > > Date: Sat, 1 Jul 2023 19:25:26 +0800 > > Cc: 64395@debbugs.gnu.org > > > > The picture I sent earlier is an animation. It shows the entire reproduction process and the result. > > Sorry, I didn't realize that it included animation. > > I think I see the issue now. OK, I've now found a way of reproducing the problem on a system to which I have access. Your proposed change fixes the problem, but it fixes it incorrectly: after applying the patch, I see a truncation glyph "$" at the end of the mode line. This should never happen on the mode line: we don't show truncation glyphs there. Compare the display after applying your patch with the mode-line displayed after evaluating the below: (setq mode-line-format (concat (format-mode-line "- Ln %l, Col %c ") (make-string 100 ?-))) As you see, the expected display of the mode line that is truncated is simply not to see the truncated part, without any "$" truncation glyph at the end of the mode line. So a slightly different change is needed to properly fix this case. I'm working on such a proper fix.