[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: isearch hooks
Re: isearch hooks
Mon, 28 Jun 2004 01:34:59 +0300
Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)
Richard Stallman <address@hidden> writes:
> I added two new hooks: `isearch-push-state-function' and
> `isearch-pop-state-function' to save/restore the current Info file
> and node names in the search status stack.
> I don't understand the motivation for these two hooks.
> Would you please explain the idea of this design?
> Why is this the right way to extend Isearch?
The commands that move the point back to the previous search result
restore the previous point by setting it by `goto-char' to the
position saved in the search status stack `isearch-cmds'. But this
doesn't work when the current search buffer switches during the search
like with changing the current Info node.
There is a need to save additional information to the search stack
to be able to restore the current search buffer to its previous state.
In case of Info this means going to the Info node where the previous
search point was located. The hook `isearch-push-state-function'
returns additional information appended to the element of the
search status stack. And `isearch-pop-state-function' calls the
function to restore the current buffer to its previous state.
Perhaps even one hook that adds to the stack a function to restore
the current search buffer would be enough. For example,
(defun Info-isearch-push-state-function ()
(Info-find-node ,Info-current-file ,Info-current-node)
(goto-char (car (cdr (cdr cmd))))))
will add a lambda expression as 12-th element of the list pushed to the
stack and which can be called later to restore the previous Info node.
I don't know what is more preferable: two hooks or one hook with lambda.
Re: query-replace-interactive not documented, Juri Linkov, 2004/06/11
- isearch hooks (was: query-replace-interactive not documented), (continued)
- Re: isearch hooks (was: query-replace-interactive not documented), Richard Stallman, 2004/06/18
- Re: isearch hooks, Juri Linkov, 2004/06/19
- Re: isearch hooks, Richard Stallman, 2004/06/20
- Re: isearch hooks, Juri Linkov, 2004/06/21
- Re: isearch hooks, Richard Stallman, 2004/06/22
- Re: isearch hooks, Juri Linkov, 2004/06/25
- Re: isearch hooks, Richard Stallman, 2004/06/27
- Re: isearch hooks,
Juri Linkov <=
- Re: isearch hooks, Richard Stallman, 2004/06/28
- Re: isearch hooks (was: query-replace-interactive not documented), Stefan, 2004/06/28
- Re: isearch hooks, Juri Linkov, 2004/06/28