Subject: Re: bug#45915: 28.0.90; deletechar distorts org-table

From: Tak Kunihiro <[email-masked]>
Date: Wed, 29 Dec 2021 15:28:10 +0900

Dear Ihor

Thank you for the patch.  I applied the patch to org-table.el on Emacs
28.0.90.

And I still see the problem there.  Is the problem solved by the patch
on your environment?

Tak

Ihor Radchenko <[email-masked]> writes:

> Tak Kunihiro <[email-masked]> writes:
>
>> I confirm that there still is the problem with org-table on Emacs
>> 28.0.90 pretest with org-version 9.5.1.
>>
>> Here is a recipe to reproduce the problem.  I still have to stick to
>> 26.3.
>
> I was able to reproduce. Can you try the attached fix?
>
> Best,
> Ihor
>
> From 7b1a7d43e090292b6bd821c65a644f8c599b2044 Mon Sep 17 00:00:00 2001
> Message-Id: <[email-masked]>
> From: Ihor Radchenko <[email-masked]>
> Date: Sun, 19 Dec 2021 20:49:54 +0800
> Subject: [PATCH] org-table.el: Fix orgtbl-mode not remapping delete key
>
> * lisp/org-table.el (orgtbl-setup): Remap `delete-forward-char' in
> addition to `deleta-char'.  The former is called in Emacs >26.
>
> Fixes https://orgmode.org/list/[email-masked]
> ---
>  lisp/org-table.el | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/lisp/org-table.el b/lisp/org-table.el
> index 1546cd563..0560e32a1 100644
> --- a/lisp/org-table.el
> +++ b/lisp/org-table.el
> @@ -5290,6 +5290,7 @@ (defun orgtbl-setup ()
>        (org-remap orgtbl-mode-map
>  		 'self-insert-command 'orgtbl-self-insert-command
>  		 'delete-char 'org-delete-char
> +                 'delete-forward-char 'org-delete-char
>  		 'delete-backward-char 'org-delete-backward-char)
>        (org-defkey orgtbl-mode-map "|" 'org-force-self-insert))
>      t))