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

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

[elpa] master d56ddaa 006/173: Allow scrolling the doc window with the m


From: Dmitry Gutov
Subject: [elpa] master d56ddaa 006/173: Allow scrolling the doc window with the mouse wheel
Date: Thu, 23 Jun 2016 00:28:34 +0000 (UTC)

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

    Allow scrolling the doc window with the mouse wheel
    
    Resolves #309
---
 NEWS.md    |    1 +
 company.el |    9 ++++++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/NEWS.md b/NEWS.md
index c8dd158..d4b767d 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -2,6 +2,7 @@
 
 ## Next
 
+* The documentation buffer window can be scrolled with the mouse wheel.
 * New command `company-diag`. Use it in bug reports.
 
 ## 2015-02-02 (0.8.10)
diff --git a/company.el b/company.el
index a594f70..eae36ef 100644
--- a/company.el
+++ b/company.el
@@ -2015,7 +2015,7 @@ character, stripping the modifiers.  That character must 
be a digit."
     (current-buffer)))
 
 (defvar company--electric-commands
-  '(scroll-other-window scroll-other-window-down)
+  '(scroll-other-window scroll-other-window-down mwheel-scroll)
   "List of Commands that won't break out of electric commands.")
 
 (defmacro company--electric-do (&rest body)
@@ -2029,9 +2029,12 @@ character, stripping the modifiers.  That character must 
be a digit."
          (and (< (window-height) height)
               (< (- (window-height) row 2) company-tooltip-limit)
               (recenter (- (window-height) row 2)))
-         (while (memq (setq cmd (key-binding (vector (list (read-event)))))
+         (while (memq (setq cmd (key-binding (read-key-sequence-vector nil)))
                       company--electric-commands)
-           (call-interactively cmd))
+           (condition-case err
+               (call-interactively cmd)
+             ((beginning-of-buffer end-of-buffer)
+              (message (error-message-string err)))))
          (company--unread-last-input)))))
 
 (defun company--unread-last-input ()



reply via email to

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