diff options
| author | Richard M. Stallman | 1999-07-02 12:53:04 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1999-07-02 12:53:04 +0000 |
| commit | df01192be7a249c771330e203a9ff6dbcffd72d9 (patch) | |
| tree | 713a5fc3aad48a2b2ec1f09fcfe180099d89911d | |
| parent | 094d978996da9605ca32cd05e738e6f456bac5bc (diff) | |
| download | emacs-df01192be7a249c771330e203a9ff6dbcffd72d9.tar.gz emacs-df01192be7a249c771330e203a9ff6dbcffd72d9.zip | |
(isearch-done): If search ends in middle of intangible
text (due to text property), move on to the limit of that text.
| -rw-r--r-- | lisp/isearch.el | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el index 6164498de10..59535459849 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -647,6 +647,17 @@ is treated as a regexp. See \\[isearch-forward] for more info." | |||
| 647 | 647 | ||
| 648 | (force-mode-line-update) | 648 | (force-mode-line-update) |
| 649 | 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))))) | ||
| 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)) |
| @@ -1613,13 +1624,13 @@ If there is no completion possible, say so and continue searching." | |||
| 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. |