Hi,

If we have speed commands activated and we type (by mistake) a character
not associated with a command, the letter is printed at point. I think a
more appropriate behavior would be:

- key associated with a command: the command is activated

- key not associated with a command: an error message is displayed.

Attached a patch with that modification.

Best regards,

Juan Manuel 

>From fd380f41420aef9bc91baede9d4cd2cb7eadee0a Mon Sep 17 00:00:00 2001
From: Juan Manuel Macias <maciasch...@posteo.net>
Date: Sat, 30 Apr 2022 13:00:02 +0200
Subject: [PATCH] lisp/org-keys.el: error message when speed command is not
 defined

* (org-speed-command-activate): If a letter is not associated with a
command, an error message is displayed instead of typing the letter.
---
 lisp/org-keys.el | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/lisp/org-keys.el b/lisp/org-keys.el
index 782ffa871..a850abb4f 100644
--- a/lisp/org-keys.el
+++ b/lisp/org-keys.el
@@ -835,12 +835,14 @@ See `org-speed-commands' for configuring them."
   (when (or (and (bolp) (looking-at org-outline-regexp))
 	    (and (functionp org-use-speed-commands)
 		 (funcall org-use-speed-commands)))
-    (cdr (assoc keys
-                ;; FIXME: don't check `org-speed-commands-user' past 9.6
-                (if (boundp 'org-speed-commands-user)
-                    (append org-speed-commands
-                            org-speed-commands-user)
-                  org-speed-commands)))))
+    (let ((defined (cdr (assoc keys
+			       ;; FIXME: don't check `org-speed-commands-user' past 9.6
+			       (if (boundp 'org-speed-commands-user)
+				   (append org-speed-commands
+					   org-speed-commands-user)
+				 org-speed-commands)))))
+      (if defined defined
+	(error "Speed command not defined: \"h\" for help")))))
 
 
 ;;; Babel speed keys
-- 
2.36.0

Reply via email to