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#45915: 28.2; delete-char deletes two letters Date: Sat, 17 Sep 2022 14:17:41 +0300 Message-ID: <83o7ve1c8a.fsf@gnu.org> References: <20210116.170134.789950463868688311.tkk@misasa.okayama-u.ac.jp> <87im477xpk.fsf@gnu.org> <1AD1B9B7-5A15-4F86-9274-B04B83694C85@misasa.okayama-u.ac.jp> <877dc0sqm6.fsf@localhost> <87ilqrusnk.fsf@localhost> <83bkre33pa.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34014"; mail-complaints-to="usenet@ciao.gmane.io" Cc: tkk@misasa.okayama-u.ac.jp, yantar92@gmail.com, 45915@debbugs.gnu.org To: Tak Kunihiro Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 17 13:18:33 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 1oZVqD-0008jg-H1 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Sep 2022 13:18:33 +0200 Original-Received: from localhost ([::1]:59102 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oZVqC-0002Bc-BJ for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Sep 2022 07:18:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51730) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZVpj-0002BD-4C for bug-gnu-emacs@gnu.org; Sat, 17 Sep 2022 07:18:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46181) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oZVpi-0005a5-LL for bug-gnu-emacs@gnu.org; Sat, 17 Sep 2022 07:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oZVpi-0005lE-DQ for bug-gnu-emacs@gnu.org; Sat, 17 Sep 2022 07:18:02 -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, 17 Sep 2022 11:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45915 X-GNU-PR-Package: emacs Original-Received: via spool by 45915-submit@debbugs.gnu.org id=B45915.166341347422112 (code B ref 45915); Sat, 17 Sep 2022 11:18:02 +0000 Original-Received: (at 45915) by debbugs.gnu.org; 17 Sep 2022 11:17:54 +0000 Original-Received: from localhost ([127.0.0.1]:45256 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZVpZ-0005kX-V8 for submit@debbugs.gnu.org; Sat, 17 Sep 2022 07:17:54 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:36986) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZVpX-0005k9-2U for 45915@debbugs.gnu.org; Sat, 17 Sep 2022 07:17:52 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:32770) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZVpQ-0005ZB-3z; Sat, 17 Sep 2022 07:17:44 -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=eDDrBmGLSLeG1BMv+d2oSVtw6nth/yJvfoL5CNJIZfg=; b=bRo75QFDr5GZ yv22ZSf7BXoHuYUYUimtA95Jt/ocummmYDZk0SkYt/DTGQXnAl5lduVU6Wv7LzyUA1LTHib8rcvRM Fdx4JI1X0JINJ1JsQLj17D82Kc1kh9xj9asoJYx11jpgXmmu5yz/0zMliq497htq8reEkzXo8g3vv VvgDVdwC66DvSVbM6K157pB25qauOSBRrl3jECWPUWVW7gpvIL5C6UMkjr+QbkxdInc+MCZKlywwy 7x/xq+BDdb6z25y5b1cCxn1tE89rFurzyRz48kcLrYnDhy3FSoaTq7VET/eQelaPebfmmCKqwn27d 8bQg75FFv8OMJfqd/rRdpg==; Original-Received: from [87.69.77.57] (port=3103 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 1oZVpP-00057M-Dr; Sat, 17 Sep 2022 07:17:43 -0400 In-Reply-To: (message from Tak Kunihiro on Sat, 17 Sep 2022 17:20:26 +0900) 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:242860 Archived-At: > From: Tak Kunihiro > Cc: Tak Kunihiro , 45915@debbugs.gnu.org, > yantar92@gmail.com > Cc: tkk@misasa.okayama-u.ac.jp > Date: Sat, 17 Sep 2022 17:20:26 +0900 > > 1. Following function will create a problematic org-table. > > (defun emacs-bug-reproduce-45915 () > "Reproduce bug#45915." > (interactive) > (with-current-buffer (get-buffer-create "*temp buffer*") > (erase-buffer) > (require 'org) > (orgtbl-mode 1) > (setq org-table-copy-increment nil) > (insert (format "emacs-version: %s, org-version: %s\n" emacs-version org-version)) > (insert "| 1 |")) > (switch-to-buffer-other-window "*temp buffer*") > (execute-kbd-macro (kbd "M-< C-n C-f C-f")) > (message "I will call #'org-table-copy-down.") > (call-interactively #'org-table-copy-down)) > ;;; (call-interactively 'emacs-bug-reproduce-45915) > > 2. Buffer is with the 1x2 table as shown below. deletes one > letter on the first row, and it does two letters on the > second row. > > emacs-version: 28.2, org-version: 9.5.5 > | 1 | > | 1 | No, it doesn't delete 2 characters in the 2nd line, it deletes just one. After you press , type C-b (to go to the space between the two '|' characters, and type "C-x =". You will see this: Char: SPC (32, #o40, #x20, part of display " ") point=51 of 54 (93%) column=1 Note the "51 to 54" part: there's a 'display' property there that covers _two_ buffer positions, not one. That's because the two 'display' properties on the two SPC characters before the deletion have the same value: > (buffer-substring (line-beginning-position) (line-end-position)) > > line 1 returns: "| 1 |" > line 2 returns: #("| 1 |" 1 2 (display (space :relative-width 1)) 3 4 > (display (space :relative-width 1))) Those two 'display' properties are now displayed as a single stretch glyph, because two adjacent text properties with the same value are indistinguishable from a single one that spans all of the buffer positions. This is not a bug, this is how Emacs always worked. The question is now why is this a problem for you, and how it affects Org Table. The solution, if there's a need for one, should IMO come from the Org side.