emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/hyperbole a831ef9 36/50: Fix bug #46606 by replacing hk


From: Stefan Monnier
Subject: [elpa] externals/hyperbole a831ef9 36/50: Fix bug #46606 by replacing hkey-define-key with hkey-global-set-key
Date: Wed, 17 Mar 2021 18:44:20 -0400 (EDT)

branch: externals/hyperbole
commit a831ef9e7574a14f681adbda69487083b32863fb
Author: Bob Weiner <rsw@gnu.org>
Commit: Bob Weiner <rsw@gnu.org>

    Fix bug #46606 by replacing hkey-define-key with hkey-global-set-key
---
 Changes      |  6 ++++++
 hyperbole.el | 15 ++++-----------
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/Changes b/Changes
index 7bb69fb..801a325 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,9 @@
+2021-02-21  Bob Weiner  <rsw@gnu.org>
+
+* hyperbole.el (hkey-define-key): Removed, had bug that did not use prefix
+    keymap properly; use hkey-global-set-key with a full key sequence instead.
+               (hkey-initialize): Replaced calls to above function.
+
 2021-02-20  Mats Lidell  <matsl@gnu.org>
 
 * test/hibtypes-tests.el (mail-address-at-p-test)
diff --git a/hyperbole.el b/hyperbole.el
index febca84..bf645ce 100644
--- a/hyperbole.el
+++ b/hyperbole.el
@@ -5,7 +5,7 @@
 ;; Author:           Bob Weiner
 ;; Maintainer:       Bob Weiner <rsw@gnu.org>, Mats Lidell <matsl@gnu.org>
 ;; Created:          06-Oct-92 at 11:52:51
-;; Released:         15-Feb-21
+;; Released:         21-Feb-21
 ;; Version:          7.1.4 (pre-release)
 ;; Keywords:         comm, convenience, files, frames, hypermedia, languages, 
mail, matching, mouse, multimedia, outlines, tools, wp
 ;; Package:          hyperbole
@@ -186,12 +186,6 @@ Entry format is: (key-description key-sequence 
key-binding)."
   (mapcar (lambda (key) (hkey-binding-entry key))
          (hkey-bindings-keys hkey-previous-bindings)))
 
-(defun hkey-define-key (keymap key command &optional no-add)
-  "Same as `define-key' except saves prior binding for later restoration 
unless optional 4rd argument NO-ADD is given as a non-nil value."
-  (unless no-add
-    (add-to-list 'hkey-previous-bindings (hkey-binding-entry key)))
-  (define-key keymap key command))
-
 (defun hkey-global-set-key (key command &optional no-add)
   "Same as `global-set-key' except saves prior binding for later restoration 
unless optional 3rd argument NO-ADD is given as a non-nil value."
   (unless no-add
@@ -210,7 +204,7 @@ Entry format is: (key-description key-sequence 
key-binding)."
     ;; Typically bind the key, {C-h A}, for Action Key help and {C-u C-h A} 
for Assist key
     ;; help.
     (or (where-is-internal 'hkey-help)
-       (hkey-define-key help-map "A" 'hkey-help))
+       (hkey-global-set-key [help ?A] 'hkey-help))
     ;;
     ;; Setup so Hyperbole menus can be accessed from a key.  If not
     ;; already bound to a key, this typically binds the command `hyperbole' to 
{C-h h}.
@@ -218,7 +212,7 @@ Entry format is: (key-description key-sequence 
key-binding)."
        ;; In GNU Emacs, this binding replaces a command that shows
        ;; the word hello in foreign languages; this binding makes this
        ;; key much more useful.
-       (hkey-define-key help-map "h" 'hyperbole))
+       (hkey-global-set-key [help ?h] 'hyperbole))
     ;;
     ;; Provides a site standard way of emulating most Hyperbole mouse drag
     ;; commands from the keyboard.  This is most useful for rapidly creating
@@ -272,8 +266,7 @@ Entry format is: (key-description key-sequence 
key-binding)."
     ;;
     ;; Store Hyperbole key bindings so can turn them on and off.
     (setq hkey-bindings (hkey-get-bindings)
-         hkey-bindings-flag t)
-    ))
+         hkey-bindings-flag t)))
 
 (defun hkey-maybe-global-set-key (key command &optional no-add)
   "Globally set KEY to COMMAND if KEY is unbound and COMMAND is not on any 
global key.



reply via email to

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