[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug] deleting backward char does not do undo-boundary
From: |
Samuel Wales |
Subject: |
Re: [bug] deleting backward char does not do undo-boundary |
Date: |
Fri, 21 Aug 2020 21:38:18 -0700 |
ah, so org did the remap and i tried to remap the remap?
my brain is not working right now, but i think you might be right. in
either case, your solution works and is straightforward.
thank you.
On 8/21/20, Kyle Meyer <kyle@kyleam.com> wrote:
> Samuel Wales writes:
>
>> here is my code to try to fix it [note that i fix teh rest of emacs 25
>> also]. but that one command does not accept the undo-boundary that i
>> call. i do not udnerstand why this is the case.
>
> Without looking at this too closely, I'd guess it's because ...
>
>> (define-key org-mode-map [remap org-delete-backward-char]
>> #'alpha-org-delete-backward-char)
>> (define-key org-mode-map [remap org-delete-char]
>> #'alpha-org-delete-char)
>> (defun alpha-org-delete-char () (interactive)
>> (alpha-wrap-with-undo-boundary 'org-delete-char))
>> (defun alpha-org-delete-backward-char () (interactive)
>> (alpha-wrap-with-undo-boundary 'org-delete-backward-char))
>
> ... you're trying to remap a command that is itself remapping a command.
>
> (info "(elisp)remapping commands")
>
> In addition, remapping only works through a single level; in the
> following example,
>
> (define-key my-mode-map [remap kill-line] 'my-kill-line)
> (define-key my-mode-map [remap my-kill-line] 'my-other-kill-line)
>
> ‘kill-line’ is _not_ remapped to ‘my-other-kill-line’. Instead, if
> an ordinary key binding specifies ‘kill-line’, it is remapped to
> ‘my-kill-line’; if an ordinary binding specifies ‘my-kill-line’, it
> is remapped to ‘my-other-kill-line’.
>
> Perhaps just bind it directly?
>
> (define-key org-mode-map (kbd "DEL") #'alpha-org-delete-backward-char)
>
--
The Kafka Pandemic
Please learn what misopathy is.
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html