commit 57010198a88d62da308ca61deb64a77b8ec080f6
parent 6369c7dda22bdd2def38f9ced972c8304a2dd5df
Author: rmj <pwishie@gmail.com>
Date: Sat, 23 Nov 2019 02:51:19 -0800
proper backspacing
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/joestar.el b/joestar.el
@@ -274,7 +274,9 @@
(defun joe-backs ()
"Redefine the what the backspace key does to mimic joe."
(interactive)
- (cond ((bolp)
+ (if buffer-read-only ; do the normal backspacing if buffer is readonly
+ (setq unread-command-events (listify-key-sequence (kbd "DEL")))
+ (cond ((bolp)
(delete-char -1)
(indent-according-to-mode)
(when (looking-at "\\([ \t]+\\)[^ \t]")
@@ -286,7 +288,7 @@
(indent-according-to-mode))
(t
(let ((backward-delete-char-untabify-method 'hungry))
- (call-interactively 'backward-delete-char-untabify)))))
+ (call-interactively 'backward-delete-char-untabify))))))
(defun joe-backw ()
"Kill the word to the left of the cursor."