help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hook for search next


From: tomer
Subject: Re: hook for search next
Date: Wed, 6 May 2009 23:47:29 -0700 (PDT)
User-agent: G2/1.0

On May 6, 5:52 pm, Kevin Rodgers <kevin.d.rodg...@gmail.com> wrote:
> tomer wrote:
> > On May 5, 3:40 pm, Kevin Rodgers <kevin.d.rodg...@gmail.com> wrote:
> >> tomer wrote:
> >>> i want to print message after each search (ctrl-s) in search-minor
> >>> mode.Is it possilbe to hook for this purpose?
> >>> Is there other way other than hook?
> >>> it is very important.
> >> ,----[ C-h v isearch-mode-end-hook RET ]
> >> | isearch-mode-end-hook is a variable defined in `isearch.el'.
> >> | Its value is nil
> >> |
> >> |
> >> | Documentation:
> >> | Function(s) to call after terminating an incremental search.
> >> | When these functions are called, `isearch-mode-end-hook-quit'
> >> | is non-nil if the user quit the search.
> >> |
> >> | [back]
> >> `----
>
> >> --
> >> Kevin Rodgers
> >> Denver, Colorado, USA
>
> > Thanks for the answer,
> > I knew that hooks, these hook are only in the end of the search.
> > I need a hook each time a new search is found (each time pressing ctrl
> > +s in isearch mode).
> > Is it possbile?
>
> Try after-advising isearch-search and check isearch-success.
>
> --
> Kevin Rodgers
> Denver, Colorado, USA- Hide quoted text -
>
> - Show quoted text -

Thanks a lot
I have succeed in other way , but i will try this also.
here is my solution:

(defun tl-isearch-start()
  (if (eq major-mode 'specman-mode)
  (add-hook 'post-command-hook 'specman-describe-context)))

(defun tl-isearch-end()
  (if (eq major-mode 'specman-mode)
  (remove-hook 'post-command-hook 'specman-describe-context)))

(add-hook 'isearch-mode-hook 'tl-isearch-start)

(add-hook 'isearch-mode-end-hook 'tl-isearch-end)

Thanks a lot for the help



reply via email to

[Prev in Thread] Current Thread [Next in Thread]