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

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

[elpa] externals/jinx 9b776ae84a: Add jinx-mode-map (Fix #22)


From: ELPA Syncer
Subject: [elpa] externals/jinx 9b776ae84a: Add jinx-mode-map (Fix #22)
Date: Wed, 29 Mar 2023 12:58:53 -0400 (EDT)

branch: externals/jinx
commit 9b776ae84a686810aab3495645b0e8433cbc3a8c
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Add jinx-mode-map (Fix #22)
---
 CHANGELOG.org |  2 ++
 jinx.el       | 19 ++++++++++++-------
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/CHANGELOG.org b/CHANGELOG.org
index 63750cbbc3..4481081c89 100644
--- a/CHANGELOG.org
+++ b/CHANGELOG.org
@@ -8,6 +8,8 @@
 - =jinx-correct=: When checking the whole buffer via =C-u M-$=, don't restore
   original point position upon =C-g= to ease cursory edits. Instead push a mark
   which can be used to go back to the original position.
+- Add =jinx-mode-map= to make it easy to bind keys if =jinx-mode= is enabled. 
The
+  map is empty by default.
 
 * Version 0.4 (2023-03-27)
 
diff --git a/jinx.el b/jinx.el
index 3cb4639a83..020036be82 100644
--- a/jinx.el
+++ b/jinx.el
@@ -200,6 +200,17 @@ checking."
   "List of modes included by `global-jinx-mode'."
   :type '(repeat symbol))
 
+;;;; Keymaps
+
+(defvar-keymap jinx-mode-map
+  :doc "Keymap for `jinx-mode'.")
+
+(defvar-keymap jinx-misspelled-map
+  :doc "Keymap attached to misspelled words."
+  "<mouse-1>" #'jinx-correct)
+
+(fset 'jinx-misspelled-map jinx-misspelled-map)
+
 ;;;; Internal variables
 
 (defvar jinx--predicates
@@ -258,12 +269,6 @@ Predicate may return a position to skip forward.")
 (put 'jinx 'insert-behind-hooks   (list #'jinx--overlay-modified))
 (put 'jinx 'keymap                'jinx-misspelled-map)
 
-(defvar-keymap jinx-misspelled-map
-  :doc "Keymap attached to misspelled words."
-  "<mouse-1>" #'jinx-correct)
-
-(fset 'jinx-misspelled-map jinx-misspelled-map)
-
 ;;;; Predicates
 
 (defun jinx--regexp-ignored-p (start)
@@ -675,7 +680,7 @@ If prefix argument ALL non-nil correct all misspellings."
 ;;;###autoload
 (define-minor-mode jinx-mode
   "Enchanted Just-in-time Spell Checker."
-  :global nil :group 'jinx
+  :global nil :group 'jinx :keymap jinx-mode-map
   (cond
    (jinx-mode
     (jinx--load-module)



reply via email to

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