summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraikrahguzar <88336724+aikrahguzar@users.noreply.github.com>2025-12-29 04:44:57 +0100
committerGitHub <noreply@github.com>2025-12-29 09:14:57 +0530
commit0cca3b6925da8e1e128259f6c63250cc99c96cb2 (patch)
tree556f591f5019001a7625e1b10cfe91b2b6f6ecc3
parent4c634387bafee20407de67f0d11eb6c4a225cca9 (diff)
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
-rw-r--r--lisp/pdf-view.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/pdf-view.el b/lisp/pdf-view.el
index 8dbb547..e94762b 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))