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

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

[elpa] master 0a172c5 47/66: company-search-map: Support keypad numbers


From: Dmitry Gutov
Subject: [elpa] master 0a172c5 47/66: company-search-map: Support keypad numbers
Date: Tue, 13 Jan 2015 02:45:01 +0000

branch: master
commit 0a172c53217dd20fbc4c331780cd050ee3c9fdc9
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    company-search-map: Support keypad numbers
    
    Fixes #273
---
 company.el |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/company.el b/company.el
index e6bebbf..066f1c0 100644
--- a/company.el
+++ b/company.el
@@ -1583,6 +1583,12 @@ from the rest of the back-ends in the group, if any, 
will be left at the end."
         (cl-return i))
       (cl-incf i))))
 
+(defun company-search-keypad ()
+  (interactive)
+  (let* ((name (symbol-name last-command-event))
+         (last-command-event (aref name (1- (length name)))))
+    (company-search-printing-char)))
+
 (defun company-search-printing-char ()
   (interactive)
   (company-search-assert-enabled)
@@ -1674,6 +1680,8 @@ from the rest of the back-ends in the group, if any, will 
be left at the end."
     (while (< i 256)
       (define-key keymap (vector i) 'company-search-printing-char)
       (cl-incf i))
+    (dotimes (i 10)
+      (define-key keymap (read (format "[kp-%s]" i)) 'company-search-keypad))
     (let ((meta-map (make-sparse-keymap)))
       (define-key keymap (char-to-string meta-prefix-char) meta-map)
       (define-key keymap [escape] meta-map))



reply via email to

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