comparison lisp/list-mode.el @ 4791:ea07b60c097f

Fix issue 546, use next-single-char-property-change in list-mode.el lisp/ChangeLog addition: 2009-12-31 Aidan Kehoe <kehoea@parhasard.net> * list-mode.el (next-list-mode-item, switch-to-completions): Use next-single-char-property-change, previous-single-char-property-change now next-single-property-change no longer pays attention to extents not created using the text property functions. Fix for issue 546, bug dates from changeset 8c96bdabcaf9.
author Aidan Kehoe <kehoea@parhasard.net>
date Thu, 31 Dec 2009 08:21:30 +0000
parents 9a1950c1e051
children fbafdc1bb4d2 308d34e9f07d
comparison
equal deleted inserted replaced
4790:bc4f2511bbea 4791:ea07b60c097f
172 (end (point-max))) 172 (end (point-max)))
173 ;; If in a completion, move to the end of it. 173 ;; If in a completion, move to the end of it.
174 (if extent (goto-char (extent-end-position extent))) 174 (if extent (goto-char (extent-end-position extent)))
175 ;; Move to start of next one. 175 ;; Move to start of next one.
176 (or (extent-at (point) (current-buffer) 'list-mode-item) 176 (or (extent-at (point) (current-buffer) 'list-mode-item)
177 (goto-char (next-single-property-change (point) 'list-mode-item 177 (goto-char (next-single-char-property-change (point)
178 nil end)))) 178 'list-mode-item
179 nil end))))
179 (setq n (1- n))) 180 (setq n (1- n)))
180 (while (and (< n 0) (not (bobp))) 181 (while (and (< n 0) (not (bobp)))
181 (let ((extent (extent-at (point) (current-buffer) 'list-mode-item)) 182 (let ((extent (extent-at (point) (current-buffer) 'list-mode-item))
182 (end (point-min))) 183 (end (point-min)))
183 ;; If in a completion, move to the start of it. 184 ;; If in a completion, move to the start of it.
184 (if extent (goto-char (extent-start-position extent))) 185 (if extent (goto-char (extent-start-position extent)))
185 ;; Move to the start of that one. 186 ;; Move to the start of that one.
186 (if (setq extent (extent-at (point) (current-buffer) 'list-mode-item 187 (if (setq extent (extent-at (point) (current-buffer) 'list-mode-item
187 nil 'before)) 188 nil 'before))
188 (goto-char (extent-start-position extent)) 189 (goto-char (extent-start-position extent))
189 (goto-char (previous-single-property-change 190 (goto-char (previous-single-char-property-change
190 (point) 'list-mode-item nil end)) 191 (point) 'list-mode-item nil end))
191 (if (setq extent (extent-at (point) (current-buffer) 'list-mode-item 192 (if (setq extent (extent-at (point) (current-buffer) 'list-mode-item
192 nil 'before)) 193 nil 'before))
193 (goto-char (extent-start-position extent))))) 194 (goto-char (extent-start-position extent)))))
194 (setq n (1+ n)))) 195 (setq n (1+ n))))
646 (or (get-buffer-window "*Completions*") 647 (or (get-buffer-window "*Completions*")
647 (minibuffer-completion-help)) 648 (minibuffer-completion-help))
648 (if (not (get-buffer-window "*Completions*")) 649 (if (not (get-buffer-window "*Completions*"))
649 nil 650 nil
650 (select-window (get-buffer-window "*Completions*")) 651 (select-window (get-buffer-window "*Completions*"))
651 (goto-char (next-single-property-change (point-min) 'list-mode-item nil 652 (goto-char (next-single-char-property-change (point-min) 'list-mode-item
652 (point-max))))) 653 nil (point-max)))))
653 654
654 ;;; list-mode.el ends here 655 ;;; list-mode.el ends here