diff options
| author | Eli Zaretskii | 2023-01-01 11:04:22 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2023-01-01 11:04:22 +0200 |
| commit | b394359261c05fe847fac6a2075aa22f9a0eec2f (patch) | |
| tree | c112ab427368419b775effcdeb4b5c717ba27720 | |
| parent | ab3210e7092f6bd8465e7f653be73f0f124153f9 (diff) | |
| download | emacs-b394359261c05fe847fac6a2075aa22f9a0eec2f.tar.gz emacs-b394359261c05fe847fac6a2075aa22f9a0eec2f.zip | |
Improve documentation of 'isearch-open-overlay-temporary'
* lisp/isearch.el (isearch-open-overlay-temporary): Document that
the overlay passed to the 'isearch-open-invisible-temporary'
function cannot be deleted too early. (Bug#60399)
| -rw-r--r-- | lisp/isearch.el | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el index ba67cce841a..d20d816a428 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -3723,8 +3723,14 @@ Optional third argument, if t, means if fail just return nil (no error). | |||
| 3723 | (defun isearch-open-overlay-temporary (ov) | 3723 | (defun isearch-open-overlay-temporary (ov) |
| 3724 | (if (not (null (overlay-get ov 'isearch-open-invisible-temporary))) | 3724 | (if (not (null (overlay-get ov 'isearch-open-invisible-temporary))) |
| 3725 | ;; Some modes would want to open the overlays temporary during | 3725 | ;; Some modes would want to open the overlays temporary during |
| 3726 | ;; isearch in their own way, they should set the | 3726 | ;; isearch in their own way, they should set the overlay's |
| 3727 | ;; `isearch-open-invisible-temporary' to a function doing this. | 3727 | ;; `isearch-open-invisible-temporary' property to a function |
| 3728 | ;; doing this. | ||
| 3729 | ;; Warning: if your code uses this technique, it should not | ||
| 3730 | ;; delete the overlay passed to that function, since the values | ||
| 3731 | ;; of the `invisible' property will be recorded on that overlay, | ||
| 3732 | ;; to be restored after isearch is done with the text hidden by | ||
| 3733 | ;; the overlay. | ||
| 3728 | (funcall (overlay-get ov 'isearch-open-invisible-temporary) ov nil) | 3734 | (funcall (overlay-get ov 'isearch-open-invisible-temporary) ov nil) |
| 3729 | ;; Store the values for the `invisible' property, and then set it to nil. | 3735 | ;; Store the values for the `invisible' property, and then set it to nil. |
| 3730 | ;; This way the text hidden by this overlay becomes visible. | 3736 | ;; This way the text hidden by this overlay becomes visible. |