Currently, I have text modes configured with wide margins for readability with
(defun text-margins ()
(setq left-margin-width 16)
(setq right-margin-width 16))
(add-hook 'text-mode-hook 'text-margins)
in my init.
And this is great, except that sometimes I want to use the mouse to move point to the beginning of a line (in the GUI, on MacOS).
Clicking on a line inside the text moves point to the location clicked, as expected.
However, clicking on my nice wide margin next to a line doesn't move point. Instead, it beeps at me with an error and leaves point where it started.
Is there any way to catch a mouse event inside a margin, so that I can give it a function to move point rather than just yell at me?