]> code.delx.au - gnu-emacs-elpa/commitdiff
Merge pull request #51 from tarsius/keep-bindings
authorDmitry Gutov <dgutov@yandex.ru>
Tue, 18 Aug 2015 15:22:56 +0000 (18:22 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Tue, 18 Aug 2015 15:22:56 +0000 (18:22 +0300)
Define diff-hl-command-map without destroying existing bindings

diff-hl.el

index 8f2221a7c0ee399488b8f0c1375eeff86315722f..18b92c716cba3d3fe5fc983cb5e30b749f15345e 100644 (file)
@@ -437,13 +437,13 @@ in the source file, or the last line of the hunk above it."
   (interactive)
   (diff-hl-next-hunk t))
 
-(define-prefix-command 'diff-hl-command-map)
-
-(let ((map diff-hl-command-map))
-  (define-key map "n" 'diff-hl-revert-hunk)
-  (define-key map "[" 'diff-hl-previous-hunk)
-  (define-key map "]" 'diff-hl-next-hunk)
-  map)
+(defvar diff-hl-command-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map "n" 'diff-hl-revert-hunk)
+    (define-key map "[" 'diff-hl-previous-hunk)
+    (define-key map "]" 'diff-hl-next-hunk)
+    map))
+(fset 'diff-hl-command-map diff-hl-command-map)
 
 ;;;###autoload
 (define-minor-mode diff-hl-mode