branch: externals/hyperbole commit 4ea5696ebbacb7e4af2e3616d14187eeb69d74b0 Author: Bob Weiner <r...@gnu.org> Commit: Bob Weiner <r...@gnu.org>
hyperbole.el (hkey-initialize): Add missing Hyperbole C-c prefix --- ChangeLog | 4 ++++ hyperbole.el | 21 ++++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index fe475ab..17b15de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2021-12-12 Bob Weiner <r...@gnu.org> + +* hyperbole.el (hkey-initialize): Add missing C-c prefix binding for hyperbole-mode-map. + 2021-12-05 Bob Weiner <r...@gnu.org> * hyrolo.el (hyrolo-next-match): Handle case when no prior regexp search. diff --git a/hyperbole.el b/hyperbole.el index b62f0f0..f8f1441 100644 --- a/hyperbole.el +++ b/hyperbole.el @@ -192,18 +192,20 @@ context (wherever point is). {C-u \\[hkey-help]} shows what the Assist Key will (defun hkey-maybe-global-set-key (key command &optional no-add) "Define a Hyperbole KEY bound to COMMAND if KEY is not bound in `hyperbole-mode-map'. Third argument NO-ADD is ignored." - (unless (lookup-key hyperbole-mode-map key) - (hkey-set-key key command no-add))) - -(defun hkey-set-key (key command) - "Define a Hyperbole global minor mode KEY bound to COMMAND." - (define-key hyperbole-mode-map key command)) + (hkey-maybe-set-key key command)) (defun hkey-maybe-set-key (key command &optional no-add) "Define a Hyperbole KEY bound to COMMAND if KEY is not bound in `hyperbole-mode-map'. Third argument NO-ADD is ignored." - (unless (lookup-key hyperbole-mode-map key) - (hkey-set-key key command))) + (let ((lookup-result (lookup-key hyperbole-mode-map key))) + (cond ((integerp lookup-result) + (hypb:error "(hkey-maybe-set-key): Prefix key used is not defined: {%s}" (key-description key))) + ((null lookup-result) + (hkey-set-key key command))))) + +(defun hkey-set-key (key command) + "Define a Hyperbole global minor mode KEY bound to COMMAND." + (define-key hyperbole-mode-map key command)) (defvar hmouse-middle-flag) (defvar hmouse-bindings-flag) @@ -222,7 +224,8 @@ of the commands." ;; In GNU Emacs, this binding replaces a command that shows ;; the word hello in foreign languages; this binding makes this ;; key much more useful. - (global-set-key (vector help-char ?h) #'hyperbole)) + (global-set-key (vector help-char ?h) #'hyperbole) + (hkey-set-key "\C-c" (make-sparse-keymap))) ;; ;; Bind the Action Key to {M-RET} and the Assist Key to {C-u M-RET} ;; and load the Hyperbole mouse key bindings.