From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tak Kunihiro Newsgroups: gmane.emacs.bugs Subject: bug#45915: 28.2; delete-char deletes two letters Date: Sat, 17 Sep 2022 17:20:26 +0900 Message-ID: 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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4395"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (darwin) Cc: Tak Kunihiro , tkk@misasa.okayama-u.ac.jp, yantar92@gmail.com, 45915@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 17 10:21:11 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 1oZT4Y-0000wV-Qi for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Sep 2022 10:21:10 +0200 Original-Received: from localhost ([::1]:44774 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oZT4X-0004up-G1 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Sep 2022 04:21:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48108) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZT4R-0004ug-C8 for bug-gnu-emacs@gnu.org; Sat, 17 Sep 2022 04:21:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46069) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oZT4Q-0003zF-HK for bug-gnu-emacs@gnu.org; Sat, 17 Sep 2022 04:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oZT4Q-0000wM-CD for bug-gnu-emacs@gnu.org; Sat, 17 Sep 2022 04:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tak Kunihiro Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Sep 2022 08:21: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.16634028383556 (code B ref 45915); Sat, 17 Sep 2022 08:21:02 +0000 Original-Received: (at 45915) by debbugs.gnu.org; 17 Sep 2022 08:20:38 +0000 Original-Received: from localhost ([127.0.0.1]:45145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZT41-0000vI-LF for submit@debbugs.gnu.org; Sat, 17 Sep 2022 04:20:38 -0400 Original-Received: from mail-pf1-f179.google.com ([209.85.210.179]:44903) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZT40-0000v6-7V for 45915@debbugs.gnu.org; Sat, 17 Sep 2022 04:20:36 -0400 Original-Received: by mail-pf1-f179.google.com with SMTP id j12so23366234pfi.11 for <45915@debbugs.gnu.org>; Sat, 17 Sep 2022 01:20:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:cc:to:from:from:to:cc:subject:date; bh=6QZL9JbpztL8Vpi1sSspS9KTJnFLM6WDNAFwrtc5qy8=; b=RuaKEHNnoi69PaEnwvIPskgeD00A8YtQ1OARh/FFxz6HaBXWakFonrldm12sjOwse5 XmpZv9h/oJcVRV0tN75MVMQQjFV4sUGa/fSKpcwd64vkPOGDAy2uYzw2UCrYBWsMH9R1 nkBLKfM0frnKit47V7Zb6SqjrS5pYNTZOTwNvQLBxQGx2QF43Ldv8iy7aBnsOX/ZfoDk qv9Doo6n76gGtdsROJ+R+0elK/i9fJCuUdREtZ1bX0Y8iuHLun2L/N3nxLyje41+Vejz UzEu9wAMPwnzz1sMqPj8viNcJeo4/YSzfAsV7ZnNdGdxyafg8xh7fQOr3KLgJSEpVMws c1Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:cc:to:from:x-gm-message-state:from:to:cc:subject:date; bh=6QZL9JbpztL8Vpi1sSspS9KTJnFLM6WDNAFwrtc5qy8=; b=vj+pLZj0ZTOa8HaMVmwyG8C7jVHPDLt3AdR0ucKPlIKpCM4LtBnvuPfUWbPtDNXhEm uoYrAmj4otBsfcT+R3d6GGivP+E428wubHN0zQXLnHcjGnhtrY3Gn6DTpMrA9G6SwPPc dOY6nLbOrU6SYjP1pdz+dkKycv3VBRqitpdD3toW/1VOpuEoV66GId3P0h7OrBKX8vxo +W6OH9gzREXlI0gwAz+hBzewRRFglNTySw9qfzapZ1fdrtOucZ6mMijVB+27JMEov9LV e2f7ciAKWZ5z8rIDsqbchxCx9SwUBXBIJEkDZswJPUglOR+Rse7rF20+QkdFjpwuSNCC j1kA== X-Gm-Message-State: ACrzQf18I7LVnUKhxSNCAlPdVuzsqAq+L1aoXE+dhmoN3ZgclJqzaFTI kGcvOOKcRFodsRO1RnaMax4= X-Google-Smtp-Source: AMsMyM6RRVQI2Hq3fKRmK7EHpE5LCn0HEsOW9R3Aslqal8m4Q3a8O/7hM8bAdVp1n3A6JwEi9K/nsA== X-Received: by 2002:a63:8949:0:b0:439:c1df:5e6e with SMTP id v70-20020a638949000000b00439c1df5e6emr4874373pgd.112.1663402830464; Sat, 17 Sep 2022 01:20:30 -0700 (PDT) Original-Received: from DreamBook2017.local ([2400:4153:47a0:f300:a5d9:f759:ecf2:293f]) by smtp.gmail.com with ESMTPSA id r2-20020aa79ec2000000b00545f5046372sm10109166pfq.208.2022.09.17.01.20.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Sep 2022 01:20:30 -0700 (PDT) X-Google-Original-From: Tak Kunihiro In-Reply-To: <83bkre33pa.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 17 Sep 2022 09:38:57 +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" Xref: news.gmane.io gmane.emacs.bugs:242849 Archived-At: Eli Zaretskii writes: >> Cc: tkk@misasa.okayama-u.ac.jp, Ihor Radchenko >> From: Tak Kunihiro >> Date: Sat, 17 Sep 2022 12:48:56 +0900 >> >> I see a light. >> With the following patch, deletes only a letter. >> >> The (org-table-align) inserts string with text properties. >> It seems that the text properties matter. >> >> However, I do not understand what's going on there. Can you take a look >> (org-table-align) with this hint and revise it in correct way? > > Why do you think your proposed change is incorrect? > > Rather than asking us to study how org-table works and why it > misbehaves in this case, would it be possible for some Org expert to > explain that in simple terms, so that the relation of what happens to > the relevant core Emacs features could be easier to realize? For > example, what are the text properties involved in this case, the ones > that substring-no-properties removes? Is it possible that one of > these properties is 'composition'? Dear Eli, thank you for the response. I really want to fix it to switch to 28.2 from 26.3! 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 | 3. I wonder what is the difference between two lines. I examined each line with following statement. (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))) 4. Although I do not know how to understand the return for line 2, I speculated the problem is something to do with text properties. 5. It is (org-table-align) that generates and inserts the second line with text properties. 6. I tried to remove text-properties from string to be inserted by (org-table-align) using substring-no-properties (as shown in the patch). Now, both lines returns the same "| 1 |". Problem disappeared. 7. Since I do not know intention why (org-table-align) wants to give text properties to tables, I cannot tell the side effect of the patch. TIA