Mercurial > emacs
comparison lisp/simple.el @ 13171:ed9465203ed6
(next-completion): Specify the LIMIT arg when searching for text properties.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 11 Oct 1995 03:11:11 +0000 |
parents | a83a1515fd9b |
children | 344abd898be9 |
comparison
equal
deleted
inserted
replaced
13170:7fd22a2485f2 | 13171:ed9465203ed6 |
---|---|
2830 (defun next-completion (n) | 2830 (defun next-completion (n) |
2831 "Move to the next item in the completion list. | 2831 "Move to the next item in the completion list. |
2832 WIth prefix argument N, move N items (negative N means move backward)." | 2832 WIth prefix argument N, move N items (negative N means move backward)." |
2833 (interactive "p") | 2833 (interactive "p") |
2834 (while (and (> n 0) (not (eobp))) | 2834 (while (and (> n 0) (not (eobp))) |
2835 (let ((prop (get-text-property (point) 'mouse-face))) | 2835 (let ((prop (get-text-property (point) 'mouse-face)) |
2836 (end (point-max))) | |
2836 ;; If in a completion, move to the end of it. | 2837 ;; If in a completion, move to the end of it. |
2837 (if prop | 2838 (if prop |
2838 (goto-char (next-single-property-change (point) 'mouse-face))) | 2839 (goto-char (next-single-property-change (point) 'mouse-face nil end))) |
2839 ;; Move to start of next one. | 2840 ;; Move to start of next one. |
2840 (goto-char (next-single-property-change (point) 'mouse-face))) | 2841 (goto-char (next-single-property-change (point) 'mouse-face nil end))) |
2841 (setq n (1- n))) | 2842 (setq n (1- n))) |
2842 (while (and (< n 0) (not (bobp))) | 2843 (while (and (< n 0) (not (bobp))) |
2843 (let ((prop (get-text-property (1- (point)) 'mouse-face))) | 2844 (let ((prop (get-text-property (1- (point)) 'mouse-face)) |
2845 (end (point-min))) | |
2844 ;; If in a completion, move to the start of it. | 2846 ;; If in a completion, move to the start of it. |
2845 (if prop | 2847 (if prop |
2846 (goto-char (previous-single-property-change (point) 'mouse-face))) | 2848 (goto-char (previous-single-property-change |
2849 (point) 'mouse-face nil end))) | |
2847 ;; Move to end of the previous completion. | 2850 ;; Move to end of the previous completion. |
2848 (goto-char (previous-single-property-change (point) 'mouse-face)) | 2851 (goto-char (previous-single-property-change (point) 'mouse-face nil end)) |
2849 ;; Move to the start of that one. | 2852 ;; Move to the start of that one. |
2850 (goto-char (previous-single-property-change (point) 'mouse-face))) | 2853 (goto-char (previous-single-property-change (point) 'mouse-face nil end))) |
2851 (setq n (1+ n)))) | 2854 (setq n (1+ n)))) |
2852 | 2855 |
2853 (defun choose-completion () | 2856 (defun choose-completion () |
2854 "Choose the completion that point is in or next to." | 2857 "Choose the completion that point is in or next to." |
2855 (interactive) | 2858 (interactive) |