baruch
baruch

Reputation: 157

Emacs Lisp: How to activate window of mouse event?

Having an event from a mouse click: How to activate the window where the event occured?

As I want to insert some text at the position of the mouse event, I use (goto-char (nth 1 (event-start event))).

But in case the mouse event occured in another window than the active one, what is the appropriate way to first switch to that other window?

Upvotes: 0

Views: 196

Answers (1)

Stefan
Stefan

Reputation: 28541

I recommend you do

(posn-set-point (event-end event))

Upvotes: 1

Related Questions