From b61a81c2d83b4f52b92ae65e4fca666dd27e6652 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 11 Oct 1995 03:11:11 +0000 Subject: [PATCH] (next-completion): Specify the LIMIT arg when searching for text properties. --- lisp/simple.el | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lisp/simple.el b/lisp/simple.el index 9c362cf8e41..da201283d2c 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2832,22 +2832,25 @@ Go to the window from which completion was requested." WIth prefix argument N, move N items (negative N means move backward)." (interactive "p") (while (and (> n 0) (not (eobp))) - (let ((prop (get-text-property (point) 'mouse-face))) + (let ((prop (get-text-property (point) 'mouse-face)) + (end (point-max))) ;; If in a completion, move to the end of it. (if prop - (goto-char (next-single-property-change (point) 'mouse-face))) + (goto-char (next-single-property-change (point) 'mouse-face nil end))) ;; Move to start of next one. - (goto-char (next-single-property-change (point) 'mouse-face))) + (goto-char (next-single-property-change (point) 'mouse-face nil end))) (setq n (1- n))) (while (and (< n 0) (not (bobp))) - (let ((prop (get-text-property (1- (point)) 'mouse-face))) + (let ((prop (get-text-property (1- (point)) 'mouse-face)) + (end (point-min))) ;; If in a completion, move to the start of it. (if prop - (goto-char (previous-single-property-change (point) 'mouse-face))) + (goto-char (previous-single-property-change + (point) 'mouse-face nil end))) ;; Move to end of the previous completion. - (goto-char (previous-single-property-change (point) 'mouse-face)) + (goto-char (previous-single-property-change (point) 'mouse-face nil end)) ;; Move to the start of that one. - (goto-char (previous-single-property-change (point) 'mouse-face))) + (goto-char (previous-single-property-change (point) 'mouse-face nil end))) (setq n (1+ n)))) (defun choose-completion () -- 2.39.2