home · contact · privacy
Use suppress-keymap instead of plomvi-nothing shadowing hack.
authorChristian Heller <c.heller@plomlompom.de>
Mon, 11 Feb 2019 00:19:51 +0000 (01:19 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 11 Feb 2019 00:19:51 +0000 (01:19 +0100)
plomvi.el

index b98afc0db24709176a8ea3249221780193b48b8d..577e674c1812f857d1fa1f19a46452c24ebbfcee 100644 (file)
--- a/plomvi.el
+++ b/plomvi.el
 
 
 
-(defun plomvi-nothing()
-  "Do nothing. Used to shadow self-insert bindings in `plomvi-mode-editable-map'."
-  (interactive))
-
 (defun plomvi-half-scroll()
   "Scroll down half a screen width."
   (interactive)
@@ -211,12 +207,10 @@ Note that this ignores killed rectangles."
 (defvar plomvi-mode-basic-map (make-sparse-keymap)
   "Keymap for `plomvi-mode' on read-only buffers.
 
-In contrast to the keymap `plomvi-editable-mode' for editable buffers,
-this not only excludes keybindings for editing text, but also does not
-shadow keybindings that are bound to `self-insert-command'.
-
-Thus, it on the whole shadows much fewer keybindings of other keymaps
-that can therefore be used for other purposes.")
+In contrast to the keymap `plomvi-editable-mode' for editable
+buffers, this excludes keybindings for editing text, which thus
+become available to be used for other purposes.")
+(suppress-keymap plomvi-mode-basic-map t)
 (define-key plomvi-mode-basic-map (kbd ":") 'plomvi-prompt)
 (define-key plomvi-mode-basic-map (kbd "C-w") 'other-window)
 (define-key plomvi-mode-basic-map (kbd "k") 'previous-line)
@@ -252,11 +246,9 @@ that can therefore be used for other purposes.")
 (defvar plomvi-mode-editable-map (make-sparse-keymap)
   "Keymap for `plomvi-mode' on editable buffers.
 
-Inherits from `plomvi-mode-basic-map', but adds keybindings for text editing
-and shadows keybindings bound to `self-insert-command' to avoid accidentally
-typing text outside of what would be Vim's Insert mode.")
+Inherits from `plomvi-mode-basic-map', but adds keybindings for
+text editing.")
 (set-keymap-parent plomvi-mode-editable-map plomvi-mode-basic-map)
-(define-key plomvi-mode-editable-map [remap self-insert-command] 'plomvi-nothing)
 (define-key plomvi-mode-editable-map (kbd "i") 'plomvi-deactivate)
 (define-key plomvi-mode-editable-map (kbd "x") 'plomvi-x)
 (define-key plomvi-mode-editable-map (kbd "o") 'plomvi-newline-below)