From: Samuel Wales <samologist@gmail.com>
To: Kyle Meyer <kyle@kyleam.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [bug] deleting backward char does not do undo-boundary
Date: Fri, 21 Aug 2020 21:38:18 -0700 [thread overview]
Message-ID: <CAJcAo8s8qKbp998cxihZ6DC104=hw=c6WiBqrx=3_+PiEObrrg@mail.gmail.com> (raw)
In-Reply-To: <87d03jwbzv.fsf@kyleam.com>
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
next prev parent reply other threads:[~2020-08-22 4:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-14 23:18 [bug] deleting backward char does not do undo-boundary Samuel Wales
2020-08-22 4:17 ` Kyle Meyer
2020-08-22 4:38 ` Samuel Wales [this message]
2020-08-22 5:03 ` Kyle Meyer
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
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJcAo8s8qKbp998cxihZ6DC104=hw=c6WiBqrx=3_+PiEObrrg@mail.gmail.com' \
--to=samologist@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=kyle@kyleam.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 public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).