branch: elpa/pdf-tools
commit 0cca3b6925da8e1e128259f6c63250cc99c96cb2
Author: aikrahguzar <[email protected]>
Commit: GitHub <[email protected]>
feat(pdf-view): enable horizontal mouse wheel scrolling
Add support for horizontal scrolling using mouse wheel by setting
mwheel-scroll-left/right-function to image-mode's scroll functions.
Includes boundp checks for compatibility with older Emacs versions.
Closes: #234
Author: @aikrahguzar
---
lisp/pdf-view.el | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/lisp/pdf-view.el b/lisp/pdf-view.el
index 8dbb547c56a..e94762b24cd 100644
--- a/lisp/pdf-view.el
+++ b/lisp/pdf-view.el
@@ -378,6 +378,14 @@ PNG images in Emacs buffers."
(setq-local mwheel-scroll-down-function
#'pdf-view-scroll-down-or-previous-page))
+ (if (boundp 'mwheel-scroll-left-function)
+ (setq-local mwheel-scroll-left-function
+ #'image-scroll-left))
+
+ (if (boundp 'mwheel-scroll-right-function)
+ (setq-local mwheel-scroll-right-function
+ #'image-scroll-right))
+
;; Disable pixel-scroll-precision-mode locally if enabled
(if (bound-and-true-p pixel-scroll-precision-mode)
(set (make-local-variable 'pixel-scroll-precision-mode) nil))