Skip to content

Commit

Permalink
org-mouse: Make recently ported change compatible with Emacs < 29
Browse files Browse the repository at this point in the history
* lisp/org-mouse.el (org-mouse-show-context-menu): Conditionally
restore old code path, falling back to double-click-time if
mouse-double-click-time isn't available.

This is a follow-up to the port of Emacs's 2fba71cf1.
  • Loading branch information
kyleam committed Oct 4, 2022
1 parent 42c4186 commit abc34b4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lisp/org-mouse.el
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,11 @@ this function is called. Otherwise, the current major mode menu is used."
(interactive "@e \nP")
(if (and (= (event-click-count event) 1)
(or (not mark-active)
(sit-for (/ (mouse-double-click-time) 1000.0))))
(sit-for
(/ (if (fboundp 'mouse-double-click-time) ; Emacs >= 29
(mouse-double-click-time)
double-click-time)
1000.0))))
(progn
(select-window (posn-window (event-start event)))
(when (not (org-mouse-mark-active))
Expand Down

0 comments on commit abc34b4

Please sign in to comment.