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#67925: 29.1; delete-rectangle fails on multi-column characters Date: Thu, 21 Dec 2023 18:46:26 +0200 Message-ID: <83r0jffqql.fsf@gnu.org> References: <83il4tge2z.fsf@gnu.org> <831qbggd50.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28983"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67925@debbugs.gnu.org To: awrhygty@outlook.com, Stefan Monnier , Stefan Kangas , Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 21 17:47:29 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 1rGMCn-0007Nt-1X for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 21 Dec 2023 17:47:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rGMCK-0005SF-2s; Thu, 21 Dec 2023 11:47:00 -0500 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 1rGMCI-0005Rp-Dy for bug-gnu-emacs@gnu.org; Thu, 21 Dec 2023 11:46:58 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rGMCI-0002uu-5m for bug-gnu-emacs@gnu.org; Thu, 21 Dec 2023 11:46:58 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rGMCM-0000q9-4T for bug-gnu-emacs@gnu.org; Thu, 21 Dec 2023 11:47:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 21 Dec 2023 16:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67925 X-GNU-PR-Package: emacs Original-Received: via spool by 67925-submit@debbugs.gnu.org id=B67925.17031772173211 (code B ref 67925); Thu, 21 Dec 2023 16:47:02 +0000 Original-Received: (at 67925) by debbugs.gnu.org; 21 Dec 2023 16:46:57 +0000 Original-Received: from localhost ([127.0.0.1]:45330 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rGMCG-0000pi-Gi for submit@debbugs.gnu.org; Thu, 21 Dec 2023 11:46:56 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49658) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rGMCE-0000pU-Fr for 67925@debbugs.gnu.org; Thu, 21 Dec 2023 11:46:54 -0500 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 1rGMC2-0002tD-P2; Thu, 21 Dec 2023 11:46:42 -0500 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=6Mcu8hjcbPwqj93uYjADalrIAT4iMY7xU9c4ShlsCV0=; b=nD+lxNTeM6np 5pG1tDLfOgF4Ve56ckfkt3j02klOcqpRk95CcXXNniTIwd9dHysb7yYtsI7Ux8q5x60Z3Om7jDGgl nrE9GVEzr81G9TJdaUK5y0ZiphraF6suOP3m9PnILFJiZzPFmNQ4FghNdi88dcXlhrMNGYLSqnTK1 gqZS8UyvyknxlgAvotXocBYMbbuXjv0hjzxpQ0HGWxRWGWnhEBpazzil5WDhDyieIWSxs8jWKO2NX M1Fet0lFgd5DIWcKWHyLIIyIQYtSYlwOsLkru5NzULsO79pFznlSYHQgonyNIH7MmVMa50mOmBGUh QsTX9YQbc2GdWhbt8UAHlQ==; In-Reply-To: (awrhygty@outlook.com) 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:276639 Archived-At: > From: awrhygty@outlook.com > Cc: 67925@debbugs.gnu.org > Date: Thu, 21 Dec 2023 23:26:05 +0900 > > Eli Zaretskii writes: > > >> This patch gives similar result of kill-rectangle. > >> In the example above, I want all '4' characters moved to same column. > > > > How can that be done, when the first character takes 2 or more > > columns? Deleting the first character is IMO wrong, since the other > > lines leave the first character intact. Adding SPC to other lines is > > also wrong, since delete-rectangle is not supposed to _add_ columns. > > I think wide characters may be replaced with SPC like TAB. I don't think I agree. Let's see what others think Stefan, Juri, Stefan, any opinions? Does anyone else have an opinion on this? > >> And TAB characters crossing the end column are not edited correctly > >> with delete-rectangle if indent-tabs-mode is on. > >> > >> 012345678 > >> 8(TAB at head) > >> 012345678 > >> > >> The text above is edited to the text below. > >> 45678 > >> 8(TAB at head) > >> 45678 > >> > >> If indent-tabs-mode is off, the result is the text below. > >> 45678 > >> 8(four SPCs) > >> 45678 > > > > This is a separate issue with the original code. It also happens with > > kill-rectangle, btw. We could fix it by temporarily binding > > indent-tabs-mode to nil inside these commands -- would that be > > acceptable? The result will be that the killed rectangle includes > > spaces, not the leading TAB. > > I prefer that the killed rectangle has same column for each line. > If TAB is included when yanking, the current column affects the width of > the yanked string for each line. Again, does anyone else have an opinion here? I tend to think that we should bind indent-tabs-mode to nil inside those functions.