[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [BUG] `org-delete-char` and `org-delete-backward-char` don't respect
From: |
Ihor Radchenko |
Subject: |
Re: [BUG] `org-delete-char` and `org-delete-backward-char` don't respect `delete-active-region` |
Date: |
Wed, 19 Jul 2023 12:44:37 +0000 |
Okamsn <okamsn@protonmail.com> writes:
> With your clarification, I am asking that Org commands be added/changed
> to support `delete-active-region`.
Maybe something like below? (100% untested)
(defun org-delete-forward-char (N)
"Like `delete-forward-char', insert whitespace at field end in tables.
When deleting, in tables this function will insert whitespace in front
of the previous \"|\" separator, to keep the table aligned. The table
will still be marked for re-alignment if the field did fill the entire
column, because, in this case the deletion might narrow the column."
(interactive "p")
(save-match-data
(if (and (= N 1)
(not overwrite-mode)
(not (org-region-active-p))
(not (eq (char-after) ?|))
(looking-at-p ".*?|")
(org-at-table-p))
(org-delete-char 1)
(funcall-interactively #'delete-forward-char N)
(org-fix-tags-on-the-fly))))
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [BUG] `org-delete-char` and `org-delete-backward-char` don't respect `delete-active-region`,
Ihor Radchenko <=