diff --git a/lisp/mouse.el b/lisp/mouse.el index 21264adf6ad..1e9b664c36e 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -1204,7 +1204,8 @@ and selects that window." (if (null beg) (error "No completion here")) (setq beg (previous-single-property-change beg 'mouse-face)) - (setq end (next-single-property-change end 'mouse-face)) + (setq end (or (next-single-property-change end 'mouse-face) + (point-max))) (setq choice (buffer-substring beg end))))) (let ((owindow (selected-window))) (select-window (posn-window (event-start event)))