Skip to content

[Editor.Spacemacs] Mouse Wheel Can't Work on Emacs Which without Any Window System #6

Description

@Johnson9009

The mouse wheel can't work when the emacs is built without any window system, but the mouse click work well no matter left/right mouse click or double click.

(if (fboundp 'x-create-frame)
    ;; Do it after loading term/foo-win.el since the value of the
    ;; mouse-wheel-*-event vars depends on those files being loaded or not.
    (load "mwheel"))

After some investigation I found above code snippet in file "lisp/loadup.el", obviously the package "mwheel" won't be loaded if the Emacs is built without any window system, this is the root cause of this issue.

From comments in above code snippet, it seems that the package "mwheel" depends on window system packages, e.g., "term/ns-win.el", because of the initialization of variables "mouse-wheel-*-event", but from the source code of package "mwheel", these variables only depends on the feature "win32-win" and "ns-win" to set the initial value, in other words, the package "mwheel" can work without any window system.

After add below code snippet to the configuration file of Emacs, the mouse wheel work well on Emacs which built without any window system.

(require 'mwheel)
(mouse-wheel-mode t)

It seems that the developer of package "mwheel" is too strict for the condition to load it, so I file a bug report to https://debbugs.gnu.org/cgi/bugreport.cgi?bug=47162.

Metadata

Metadata

Assignees

Labels

P1High

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions