Mercurial > emacs
comparison lisp/isearch.el @ 24919:7b31dd5d71bb
(isearch-done): If search ends in middle of intangible
text (due to text property), move on to the limit of that text.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 02 Jul 1999 12:53:04 +0000 |
parents | 1d21edd48d82 |
children | 036b2fb4944f |
comparison
equal
deleted
inserted
replaced
24918:5784771d1cca | 24919:7b31dd5d71bb |
---|---|
644 (if isearch-input-method-local-p | 644 (if isearch-input-method-local-p |
645 (setq input-method-function isearch-input-method-function) | 645 (setq input-method-function isearch-input-method-function) |
646 (kill-local-variable 'input-method-function)) | 646 (kill-local-variable 'input-method-function)) |
647 | 647 |
648 (force-mode-line-update) | 648 (force-mode-line-update) |
649 | |
650 ;; If we ended in the middle of some intangible text, | |
651 ;; move to the further end of that intangible text. | |
652 (let ((after (if (eobp) nil | |
653 (get-text-property (point) 'intangible))) | |
654 (before (if (bobp) nil | |
655 (get-text-property (1- (point)) 'intangible)))) | |
656 (when (and before after (eq before after)) | |
657 (if isearch-forward | |
658 (goto-char (next-single-property-change (point) 'intangible)) | |
659 (goto-char (previous-single-property-change (point) 'intangible))))) | |
649 | 660 |
650 (if (and (> (length isearch-string) 0) (not nopush)) | 661 (if (and (> (length isearch-string) 0) (not nopush)) |
651 ;; Update the ring data. | 662 ;; Update the ring data. |
652 (isearch-update-ring isearch-string isearch-regexp)) | 663 (isearch-update-ring isearch-string isearch-regexp)) |
653 | 664 |
1611 "Return t if all the text from BEG to END is invisible." | 1622 "Return t if all the text from BEG to END is invisible." |
1612 (and (/= beg end) | 1623 (and (/= beg end) |
1613 ;; Check that invisibility runs up to END. | 1624 ;; Check that invisibility runs up to END. |
1614 (save-excursion | 1625 (save-excursion |
1615 (goto-char beg) | 1626 (goto-char beg) |
1616 (let | 1627 (let ( |
1617 ;; can-be-opened keeps track if we can open some overlays. | 1628 ;; can-be-opened keeps track if we can open some overlays. |
1618 ((can-be-opened (eq search-invisible 'open)) | 1629 (can-be-opened (eq search-invisible 'open)) |
1619 ;; the list of overlays that could be opened | 1630 ;; the list of overlays that could be opened |
1620 (crt-overlays nil)) | 1631 (crt-overlays nil)) |
1621 (when (and can-be-opened isearch-hide-immediately) | 1632 (when (and can-be-opened isearch-hide-immediately) |
1622 (isearch-close-unecessary-overlays beg end)) | 1633 (isearch-close-unecessary-overlays beg end)) |
1623 ;; If the following character is currently invisible, | 1634 ;; If the following character is currently invisible, |
1624 ;; skip all characters with that same `invisible' property value. | 1635 ;; skip all characters with that same `invisible' property value. |
1625 ;; Do that over and over. | 1636 ;; Do that over and over. |
1626 (while (and (< (point) end) | 1637 (while (and (< (point) end) |
1627 (let ((prop | 1638 (let ((prop |