Subject: bug#18183: 24.3; table-fixed-width-mode fails with kill/yank

From: Lars Ingebrigtsen <[email-masked]>
Date: Tue, 08 Dec 2020 14:59:50 +0100

Boruch Baum <[email-masked]> writes:

>> > Hi Lars. I've been doing some more work on the bug and have a solution
>> > for the secondary issue found, the one that I marked previously as
>> > 'tangent'. In that related bug, aborting from a table.el edit sets POINT
>> > at the beginning of the table instead of where it was upon entry to the
>> > edit session. The solution was simply to save and restore point. The
>> > saving is done in function org-src--edit-element and the restore is
>> > performed in function org-edit-src-abort. Here are the modified
>> > functions with the two additional lines marked with arrows ; <------
>>
>> Could you send that as a patch instead?  It's easier to read.
>
> Attached.

[...]

> +      (setq-local org-src--return-point (point))
>        ;; Discard old edit buffer.
>        (when old-edit-buffer
>  	(with-current-buffer old-edit-buffer (org-src--remove-overlay))
> @@ -1106,7 +1107,9 @@ the area in the Org mode buffer."
>  (defun org-edit-src-abort ()
>    "Abort editing of the src code and return to the Org buffer."
>    (interactive)
> -  (let (org-src--allow-write-back) (org-edit-src-exit)))
> +  (let (org-src--allow-write-back)
> +    (org-edit-src-exit)
> +    (goto-char org-src--return-point)))

I think this makes sense, but I'm not an org expert, so I've added
Michael to the Cc's.  Any comments?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no