emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: Samuel Wales <samologist@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: [bug] deleting backward char does not do undo-boundary
Date: Sat, 22 Aug 2020 00:17:08 -0400	[thread overview]
Message-ID: <87d03jwbzv.fsf@kyleam.com> (raw)
In-Reply-To: <CAJcAo8sThDPyGb_498F+8PAEMVMJ37Af-bSrXNFzcgKqEzYmpw@mail.gmail.com>

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)


  reply	other threads:[~2020-08-22  4:17 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 [this message]
2020-08-22  4:38   ` Samuel Wales
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=87d03jwbzv.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=samologist@gmail.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).