all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Tak Kunihiro <homeros.misasa@gmail.com>
Cc: tkk@misasa.okayama-u.ac.jp, yantar92@gmail.com, 45915@debbugs.gnu.org
Subject: bug#45915: 28.2; delete-char deletes two letters
Date: Sat, 17 Sep 2022 14:17:41 +0300	[thread overview]
Message-ID: <83o7ve1c8a.fsf@gnu.org> (raw)
In-Reply-To: <m2pmfuwgxh.fsf@misasa.okayama-u.ac.jp> (message from Tak Kunihiro on Sat, 17 Sep 2022 17:20:26 +0900)

> From: Tak Kunihiro <homeros.misasa@gmail.com>
> Cc: Tak Kunihiro <homeros.misasa@gmail.com>,  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. <delete> 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 <Delete>, 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.





  reply	other threads:[~2022-09-17 11:17 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-16  8:01 bug#45915: 27.1; deletechar distorts org-table Tak Kunihiro
2021-01-31  2:54 ` bug#45915: 27.1.91; " Tak Kunihiro
2021-04-28  6:03   ` Bastien
2021-04-28  8:36     ` bug#45915: 27.2; " Tak Kunihiro
2021-10-11  0:45       ` bug#45915: 29.0.50; " Tak Kunihiro
2021-12-07  8:43         ` bug#45915: 28.0.90; " Tak Kunihiro
2021-12-19 12:53           ` Ihor Radchenko
2021-12-29  6:28             ` Tak Kunihiro
2022-04-30  4:00               ` Ihor Radchenko
2022-05-23  9:26                 ` Tak Kunihiro
2022-05-23  9:55                   ` Ihor Radchenko
2022-06-18  6:20                     ` Ihor Radchenko
2022-04-30  4:00               ` Ihor Radchenko
2022-07-13 10:17                 ` bug#45915: 28.1; delete-char deletes two letters Tak Kunihiro
2022-09-15  9:30                   ` bug#45915: 28.2; " Tak Kunihiro
2022-09-16  3:59                     ` Ihor Radchenko
2022-09-17  3:48                     ` Tak Kunihiro
2022-09-17  6:38                       ` Eli Zaretskii
2022-09-17  8:20                         ` Tak Kunihiro
2022-09-17 11:17                           ` Eli Zaretskii [this message]
2022-09-18  5:44                             ` Tak Kunihiro
2022-09-18  5:56                               ` Eli Zaretskii
2022-09-18  8:05                                 ` Eli Zaretskii
2022-09-19  1:02                                   ` Tak Kunihiro
2022-09-22 12:03                                   ` Ihor Radchenko
2022-09-22 12:03                                   ` Ihor Radchenko
2022-09-22 12:46                                     ` Eli Zaretskii
2022-09-22 12:46                                       ` Eli Zaretskii
2022-09-22 21:36                                       ` Tak Kunihiro
2022-09-23  6:02                                         ` Eli Zaretskii
2022-09-23  6:02                                         ` Eli Zaretskii
2022-09-22 21:36                                       ` Tak Kunihiro
2022-09-19  1:24                                 ` Tak Kunihiro
2022-09-19 13:27                                   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83o7ve1c8a.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=45915@debbugs.gnu.org \
    --cc=homeros.misasa@gmail.com \
    --cc=tkk@misasa.okayama-u.ac.jp \
    --cc=yantar92@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.