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: Wed, 20 Dec 2023 16:09:56 +0200 Message-ID: <83il4tge2z.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4010"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67925@debbugs.gnu.org To: awrhygty@outlook.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 20 15:12:16 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 1rFxJ2-0000uR-GH for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 20 Dec 2023 15:12:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rFxIr-0003dF-QA; Wed, 20 Dec 2023 09:12:07 -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 1rFxIl-0003d2-0M for bug-gnu-emacs@gnu.org; Wed, 20 Dec 2023 09:12:00 -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 1rFxIk-0008Ui-Od for bug-gnu-emacs@gnu.org; Wed, 20 Dec 2023 09:11:58 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rFxIn-0006x7-JD for bug-gnu-emacs@gnu.org; Wed, 20 Dec 2023 09:12: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: Wed, 20 Dec 2023 14:12:01 +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.170308146226636 (code B ref 67925); Wed, 20 Dec 2023 14:12:01 +0000 Original-Received: (at 67925) by debbugs.gnu.org; 20 Dec 2023 14:11:02 +0000 Original-Received: from localhost ([127.0.0.1]:38950 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rFxHq-0006vV-2i for submit@debbugs.gnu.org; Wed, 20 Dec 2023 09:11:02 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59096) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rFxHl-0006vB-Tt for 67925@debbugs.gnu.org; Wed, 20 Dec 2023 09:11:00 -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 1rFxHc-00071s-R0; Wed, 20 Dec 2023 09:10:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=I7oBg0D4QpNVqjbYfzatC3AlnrG3BoOu8VPW88RL3Yk=; b=FfwGeCG1KWhP5SVtGlA7 4kknhI7oNmrTASGw67Z9Ya8xkT37nTyFGLmjWi8F7QYFgKRMp9alRcbqH8Z939ryZuoFegD/q4mVP AW85cHtESGyuwqjvFWSudDHYy4JCx5g52MG7pE2DYhbyLffkQXwMelu4ED9yuRXEj6NRZZFxJK8js JxP9K0aZH1oDfFHD1byvJnVhl+HiY+Ur7AL8d8mu5ZgaY4Sm6uEpw/V708mzKld4eRyEljIYRh9/N 8kqu9ixVLgeQ8Ty3W5wh3eFPOHOWpFLovCOd3zRu/h7TVUQpuzp6eLxvP3IYyPUWpM+YgbKvKDFdP Ph+AYVScPmDYgw==; 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:276570 Archived-At: > From: awrhygty@outlook.com > Date: Wed, 20 Dec 2023 19:58:49 +0900 > > > If a multi-column character is crossing the start column of a intended > rectangle, no characters are deleted in the same line. > > For example, type 'C-x r d'(delete-rectangle) from column 1 to column 4 > of the text below, the second line characters are not deleted. > > 01234 > 一二4 > 01234 > > result: > 04 > 一二4 > 04 > > This does not apply to #'kill-rectangle. > kill-rectangle result: > 04 > 一4 > 04 Thanks. Does the patch below give good results? diff --git a/lisp/rect.el b/lisp/rect.el index 8dc188b..9049e32 100644 --- a/lisp/rect.el +++ b/lisp/rect.el @@ -212,7 +212,10 @@ rectangle-dimensions (cons width height)))) (defun delete-rectangle-line (startcol endcol fill) - (when (= (move-to-column startcol (if fill t 'coerce)) startcol) + ;; We use >= here, not =, for characters that use more than one + ;; column on display, when STARTCOL is in the middle of such a + ;; character. + (when (>= (move-to-column startcol (if fill t 'coerce)) startcol) (delete-region (point) (progn (move-to-column endcol 'coerce) (point)))))