[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug] deleting backward char does not do undo-boundary

From: Samuel Wales
Subject: [bug] deleting backward char does not do undo-boundary
Date: Fri, 14 Aug 2020 16:18:27 -0700

you know that thing in emacs where up to 20 self-insert-command
invocations are undone all at once?  i dislike it and have fixed it
for everything except one command in org.

in org, backspace [org delete backward char] clusters for undo
["amalgamates" in emacs lingo] even when
org-self-insert-cluster-for-undo is nil.  this is not true of delete,
which works ok.

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.

  (defun alpha-wrap-with-undo-boundary (old)
    ;; (defun (make-symbol (concat "alpha-") old) ()
    ;;   (interactive)
    (call-interactively old)
  (define-key global-map [remap delete-char] #'alpha-delete-char)
  (define-key global-map [remap delete-forward-char]
  (define-key global-map [remap delete-backward-char]
  (define-key global-map [remap backward-delete-char-untabify]
  (defun alpha-delete-char () (interactive)
(alpha-wrap-with-undo-boundary 'delete-char))
  (defun alpha-backward-delete-char-untabify ()
    (alpha-wrap-with-undo-boundary 'backward-delete-char-untabify))
  (defun alpha-delete-forward-char ()
    (alpha-wrap-with-undo-boundary 'delete-forward-char))
  (defun alpha-delete-backward-char ()
    (alpha-wrap-with-undo-boundary 'delete-backward-char))
  ;; ;; not work.   it is an alias.  trying org versions.
  ;; (define-key global-map [remap backward-delete-char]
  ;; (defun alpha-backward-delete-char ()
  ;;   (interactive)
  ;;   (alpha-wrap-with-undo-boundary 'backward-delete-char))
  (define-key org-mode-map [remap 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))

The Kafka Pandemic

Please learn what misopathy is.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]