I want to change the mouse behaviour in Emacs:
When I click between windows (i.e. from one window into another)), I only want to select the new window and not change point. This is the behaviour globally enabled through:
(progn
(global-set-key [mouse-1] 'mouse-select-window)
(global-unset-key [down-mouse-1])
(global-unset-key [drag-mouse-1]))
When I stay with my mouse click in the same window I want Emacs' out-of the box behaviour with moving point and selecting on drag, i.e.
(progn
(global-set-key [mouse-1] 'mouse-set-point)
(global-set-key [down-mouse-1] 'mouse-drag-region)
(global-set-key [drag-mouse-1] 'mouse-set-region))
Is there a standard way to do this? I have tried to provide my own customised function for [mouse-1]
but somehow this is not enough.