diff --git a/lisp/simple.el b/lisp/simple.el index accc119e2b..5fba27b868 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -9108,6 +9108,13 @@ next-completion With prefix argument N, move N items (negative N means move backward)." (interactive "p") + (let ((prev (previous-single-property-change (point) 'mouse-face))) + (goto-char (cond + ((not prev) + (1- (next-single-property-change (point) 'mouse-face))) + ((/= prev (point)) + (point)) + (t prev)))) (let ((beg (point-min)) (end (point-max))) (catch 'bound (while (> n 0)